# Enqueue create ticket

Enqueues ticket creation for asynchronous processing, returning if the job was enqueued successfully to be processed. We attempt to perform a best-effort validation on inputs before tasks are enqueued. If the given parameters are incorrect, we won't enqueue the job.

Endpoint: POST /tickets/enqueue
Version: 2.17
Security: bearerAuth

## Header parameters:

  - `Intercom-Version` (string)

## Request fields (application/json):

  - `ticket_type_id` (string, required)
    The ID of the type of ticket you want to create
    Example: 1234

  - `contacts` (array, required)
    The list of contacts (users or leads) affected by this ticket. Currently only one is allowed
    Example: [{"id":"1234"}]

  - `contacts.id` (string, required)
    The identifier for the contact as given by Intercom.

  - `contacts.external_id` (string, required)
    The external_id you have defined for the contact who is being added as a participant.

  - `contacts.email` (string, required)
    The email you have defined for the contact who is being added as a participant. If a contact with this email does not exist, one will be created.

  - `conversation_to_link_id` (string)
    The ID of the conversation you want to link to the ticket. Here are the valid ways of linking two tickets:
- conversation | back-office ticket
- customer tickets | non-shared back-office ticket
- conversation | tracker ticket
- customer ticket | tracker ticket
    Example: 1234

  - `company_id` (string)
    The ID of the company that the ticket is associated with. The unique identifier for the company which is given by Intercom
    Example: 5f4d3c1c-7b1b-4d7d-a97e-6095715c6632

  - `created_at` (integer)
    The time the ticket was created. If not provided, the current time will be used.
    Example: 1590000000

  - `assignment` (object)

  - `assignment.admin_assignee_id` (string)
    The ID of the admin to which the ticket is assigned. If not provided, the ticket will be unassigned.
    Example: 123

  - `assignment.team_assignee_id` (string)
    The ID of the team to which the ticket is assigned. If not provided, the ticket will be unassigned.
    Example: 8

  - `channel` (string)
    The channel through which the ticket is created. Only supported for customer ticket types. Defaults to "messenger" if not provided.
    Enum: "email"

## Response 200 fields (application/json):

  - `type` (string)
    The type of the object
    Enum: "job"

  - `id` (string, required)
    The id of the job that's currently being processed or has completed.
    Example: 20

  - `url` (string)
    API endpoint URL to check the job status.
    Example: https://api.intercom.io/jobs/status/20

  - `status` (string)
    The status of the job execution.
    Enum: "pending", "success", "failed"

  - `resource_type` (string)
    The type of resource created during job execution.
    Example: ticket

  - `resource_id` (string)
    The id of the resource created during job execution (e.g. ticket id)
    Example: 123

  - `resource_url` (string)
    The url of the resource created during job exeuction. Use this url to fetch the resource.
    Example: http://api.intercom.io/tickets/123

## Response 400 fields (application/json):

  - `type` (string, required)
    The type is error.list
    Example: error.list

  - `request_id` (string)
    Example: f93ecfa8-d08a-4325-8694-89aeb89c8f85

  - `errors` (array, required)
    An array of one or more error objects

  - `errors.code` (string, required)
    A string indicating the kind of error, used to further qualify the HTTP response code
    Example: unauthorized

  - `errors.message` (string)
    Optional. Human readable description of the error.
    Example: Access Token Invalid

  - `errors.field` (string)
    Optional. Used to identify a particular field or query parameter that was in error.
    Example: email

## Response 401 fields (application/json):

  - `type` (string, required)
    The type is error.list
    Example: error.list

  - `request_id` (string)
    Example: f93ecfa8-d08a-4325-8694-89aeb89c8f85

  - `errors` (array, required)
    An array of one or more error objects

  - `errors.code` (string, required)
    A string indicating the kind of error, used to further qualify the HTTP response code
    Example: unauthorized

  - `errors.message` (string)
    Optional. Human readable description of the error.
    Example: Access Token Invalid

  - `errors.field` (string)
    Optional. Used to identify a particular field or query parameter that was in error.
    Example: email

