# Create a ticket

`POST /tickets`

> This is a subset of the full specification, limited to the `POST /tickets` operation.
>
> You can find the full specification here: /_bundle/docs/references/@2.12/rest-api/api.intercom.io.yaml

```yaml
openapi: 3.0.1
info:
  title: Intercom API
  version: '2.12'
  description: This is a subset of the full specification, limited to the `POST /tickets` operation. Components more than 3 `$ref` hops away are not included.
  contact:
    name: Intercom Developer Hub
    url: https://developers.intercom.com
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
servers:
  - url: https://api.intercom.io
    description: The production API server
  - url: https://api.eu.intercom.io
    description: The european API server
  - url: https://api.au.intercom.io
    description: The australian API server
security:
  - bearerAuth: []
tags:
  - name: Tickets
    description: Everything about your tickets
paths:
  /tickets:
    post:
      summary: Create a ticket
      parameters:
        - name: Intercom-Version
          in: header
          schema:
            $ref: '#/components/schemas/intercom_version'
      tags:
        - Tickets
      description: You can create a new ticket.
      operationId: createTicket
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              examples:
                Successful response:
                  value:
                    type: ticket
                    id: '160'
                    ticket_id: '12'
                    ticket_attributes:
                      _default_title_: example
                      _default_description_: there is a problem
                    ticket_state:
                      type: ticket_state
                      id: '2733'
                      category: submitted
                      internal_label: Submitted
                      external_label: Submitted
                    ticket_type:
                      type: ticket_type
                      id: '36'
                      name: my-ticket-type-23
                      description: my ticket type description is awesome.
                      icon: 🦁
                      workspace_id: this_is_an_id683_that_should_be_at_least_
                      archived: false
                      created_at: 1736201956
                      updated_at: 1736201956
                      is_internal: false
                      ticket_type_attributes:
                        type: list
                        data:
                          - type: ticket_type_attribute
                            id: '63'
                            workspace_id: this_is_an_id683_that_should_be_at_least_
                            name: _default_title_
                            description: ola
                            data_type: string
                            input_options: null
                            order: 0
                            required_to_create: true
                            required_to_create_for_contacts: false
                            visible_on_create: true
                            visible_to_contacts: false
                            default: false
                            ticket_type_id: 36
                            archived: false
                            created_at: 1736201956
                            updated_at: 1736201956
                          - type: ticket_type_attribute
                            id: '64'
                            workspace_id: this_is_an_id683_that_should_be_at_least_
                            name: _default_description_
                            description: ola
                            data_type: string
                            input_options: null
                            order: 0
                            required_to_create: true
                            required_to_create_for_contacts: false
                            visible_on_create: true
                            visible_to_contacts: false
                            default: false
                            ticket_type_id: 36
                            archived: false
                            created_at: 1736201956
                            updated_at: 1736201956
                      category: Back-office
                    contacts:
                      type: contact.list
                      contacts:
                        - type: contact
                          id: 677c56e46abd011ad17ff5c1
                          external_id: '70'
                    admin_assignee_id: '0'
                    team_assignee_id: '0'
                    created_at: 1736201957
                    updated_at: 1736201958
                    ticket_parts:
                      type: ticket_part.list
                      ticket_parts:
                        - type: ticket_part
                          id: '50'
                          part_type: ticket_state_updated_by_admin
                          ticket_state: submitted
                          previous_ticket_state: submitted
                          created_at: 1736201957
                          updated_at: 1736201957
                          author:
                            id: '991266752'
                            type: bot
                            name: Fin
                            email: operator+this_is_an_id683_that_should_be_at_least_@intercom.io
                          attachments: []
                          redacted: false
                      total_count: 1
                    open: true
                    linked_objects:
                      type: list
                      data: []
                      total_count: 0
                      has_more: false
                    category: Back-office
                    is_shared: false
              schema:
                $ref: '#/components/schemas/ticket'
        '401':
          description: Unauthorized
          content:
            application/json:
              examples:
                Unauthorized:
                  value:
                    type: error.list
                    request_id: ed4d2bb1-bf94-4922-9d05-7794e25de19d
                    errors:
                      - code: unauthorized
                        message: Access Token Invalid
              schema:
                $ref: '#/components/schemas/error'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/create_ticket_request'
            examples:
              successful_response:
                summary: Successful response
                value:
                  ticket_type_id: 36
                  contacts:
                    - id: 677c56e46abd011ad17ff5c1
                  ticket_attributes:
                    _default_title_: example
                    _default_description_: there is a problem
components:
  schemas:
    contact_reference:
      title: Contact Reference
      type: object
      description: reference to contact object
      properties:
        type:
          type: string
          description: always contact
          enum:
            - contact
          example: contact
        id:
          type: string
          description: The unique identifier for the contact which is given by Intercom.
          example: 5ba682d23d7cf92bef87bfd4
        external_id:
          type: string
          nullable: true
          description: The unique identifier for the contact which is provided by the Client.
          example: f3b87a2e09d514c6c2e79b9a
    create_ticket_request:
      description: You can create a Ticket
      type: object
      title: Create Ticket Request Payload
      properties:
        ticket_type_id:
          type: string
          description: The ID of the type of ticket you want to create
          example: '1234'
        contacts:
          type: array
          description: The list of contacts (users or leads) affected by this ticket. Currently only one is allowed
          items:
            type: object
            oneOf:
              - title: ID
                properties:
                  id:
                    type: string
                    description: The identifier for the contact as given by Intercom.
                required:
                  - id
              - title: External ID
                properties:
                  external_id:
                    type: string
                    description: The external_id you have defined for the contact who is being added as a participant.
                required:
                  - external_id
              - title: Email
                properties:
                  email:
                    type: string
                    description: 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.
                required:
                  - email
          example:
            - id: '1234'
        company_id:
          type: string
          description: 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:
          type: integer
          description: The time the ticket was created. If not provided, the current time will be used.
          example: 1590000000
        ticket_attributes:
          $ref: '#/components/schemas/ticket_request_custom_attributes'
      required:
        - ticket_type_id
        - contacts
    error:
      type: object
      title: Error
      description: The API will return an Error List for a failed request, which will contain one or more Error objects.
      properties:
        type:
          type: string
          description: The type is error.list
          example: error.list
        request_id:
          type: string
          nullable: true
          format: uuid
          description: ''
          example: f93ecfa8-d08a-4325-8694-89aeb89c8f85
        errors:
          type: array
          description: An array of one or more error objects
          items:
            properties:
              code:
                type: string
                description: A string indicating the kind of error, used to further qualify the HTTP response code
                example: unauthorized
              message:
                type: string
                nullable: true
                description: Optional. Human readable description of the error.
                example: Access Token Invalid
              field:
                type: string
                nullable: true
                description: Optional. Used to identify a particular field or query parameter that was in error.
                example: email
            required:
              - code
      required:
        - type
        - errors
    file_attribute:
      title: File
      type: object
      description: The value describing a file upload set for a custom attribute
      properties:
        type:
          type: string
          example: upload
        name:
          type: string
          description: The name of the file
          example: Screenshot.png
        url:
          type: string
          description: The url of the file. This is a temporary URL and will expire after 30 minutes.
          example: https://intercom-attachments-1.com/.../Screenshot.png
        content_type:
          type: string
          description: The type of file
          example: image/png
        filesize:
          type: integer
          description: The size of the file in bytes
          example: 11308309
        width:
          type: integer
          description: The width of the file in pixels, if applicable
          example: 3024
        height:
          type: integer
          description: The height of the file in pixels, if applicable
          example: 1964
    intercom_version:
      description: Intercom API version.</br>By default, it's equal to the version set in the app package.
      type: string
      example: '2.12'
      default: '2.12'
      enum:
        - '1.0'
        - '1.1'
        - '1.2'
        - '1.3'
        - '1.4'
        - '2.0'
        - '2.1'
        - '2.2'
        - '2.3'
        - '2.4'
        - '2.5'
        - '2.6'
        - '2.7'
        - '2.8'
        - '2.9'
        - '2.10'
        - '2.11'
        - '2.12'
        - Preview
    linked_object:
      title: Linked Object
      type: object
      description: A linked conversation or ticket.
      properties:
        type:
          type: string
          description: ticket or conversation
          enum:
            - ticket
            - conversation
          example: ticket
        id:
          type: string
          description: The ID of the linked object
          example: '7583'
        category:
          type: string
          description: Category of the Linked Ticket Object.
          enum:
            - Customer
            - Back-office
            - Tracker
            - null
          example: Customer
          nullable: true
    linked_object_list:
      title: Linked Objects
      type: object
      description: An object containing metadata about linked conversations and linked tickets. Up to 1000 can be returned.
      properties:
        type:
          type: string
          description: Always list.
          enum:
            - list
          example: list
        total_count:
          type: integer
          description: The total number of linked objects.
          example: 100
        has_more:
          type: boolean
          description: Whether or not there are more linked objects than returned.
          example: false
        data:
          type: array
          description: An array containing the linked conversations and linked tickets.
          items:
            $ref: '#/components/schemas/linked_object'
    ticket:
      title: Ticket
      type: object
      x-tags:
        - Tickets
      description: Tickets are how you track requests from your users.
      nullable: true
      properties:
        type:
          type: string
          description: Always ticket
          enum:
            - ticket
          default: ticket
          example: ticket
        id:
          type: string
          description: The unique identifier for the ticket which is given by Intercom.
          example: '1295'
        ticket_id:
          type: string
          description: The ID of the Ticket used in the Intercom Inbox and Messenger. Do not use ticket_id for API queries.
          example: '1390'
        category:
          type: string
          description: Category of the Ticket.
          enum:
            - Customer
            - Back-office
            - Tracker
          example: Customer
        ticket_attributes:
          $ref: '#/components/schemas/ticket_custom_attributes'
        ticket_state:
          $ref: '#/components/schemas/ticket_state'
        ticket_type:
          $ref: '#/components/schemas/ticket_type'
        contacts:
          $ref: '#/components/schemas/ticket_contacts'
        admin_assignee_id:
          type: string
          description: The id representing the admin assigned to the ticket.
          example: '1295'
        team_assignee_id:
          type: string
          description: The id representing the team assigned to the ticket.
          example: '1295'
        created_at:
          type: integer
          format: date-time
          description: The time the ticket was created as a UTC Unix timestamp.
          example: 1663597223
        updated_at:
          type: integer
          format: date-time
          description: The last time the ticket was updated as a UTC Unix timestamp.
          example: 1663597260
        open:
          type: boolean
          description: Whether or not the ticket is open. If false, the ticket is closed.
          example: true
        snoozed_until:
          type: integer
          format: date-time
          description: The time the ticket will be snoozed until as a UTC Unix timestamp. If null, the ticket is not currently snoozed.
          example: 1663597260
        linked_objects:
          $ref: '#/components/schemas/linked_object_list'
        ticket_parts:
          $ref: '#/components/schemas/ticket_parts'
        is_shared:
          type: boolean
          description: Whether or not the ticket is shared with the customer.
          example: true
    ticket_contacts:
      title: Contacts
      type: object
      x-tags:
        - Tickets
      description: The list of contacts affected by a ticket.
      properties:
        type:
          type: string
          description: always contact.list
          enum:
            - contact.list
          example: contact.list
        contacts:
          type: array
          description: The list of contacts affected by this ticket.
          items:
            $ref: '#/components/schemas/contact_reference'
    ticket_custom_attributes:
      title: Ticket Attributes
      type: object
      description: An object containing the different attributes associated to the ticket as key-value pairs. For the default title and description attributes, the keys are `_default_title_` and `_default_description_`.
      additionalProperties:
        anyOf:
          - type: string
            nullable: true
          - type: number
          - type: boolean
          - type: array
          - $ref: '#/components/schemas/file_attribute'
      example:
        _default_title_: Found a bug
        _default_description_: The button's not working
    ticket_part:
      title: Ticket Part
      type: object
      x-tags:
        - Tickets
      description: A Ticket Part represents a message in the ticket.
      properties:
        type:
          type: string
          description: Always ticket_part
          example: ticket_part
        id:
          type: string
          description: The id representing the ticket part.
          example: '3'
        part_type:
          type: string
          description: The type of ticket part.
          example: comment
        body:
          type: string
          nullable: true
          description: The message body, which may contain HTML.
          example: <p>Okay!</p>
        previous_ticket_state:
          type: string
          enum:
            - submitted
            - in_progress
            - waiting_on_customer
            - resolved
          description: The previous state of the ticket.
          example: submitted
        ticket_state:
          type: string
          enum:
            - submitted
            - in_progress
            - waiting_on_customer
            - resolved
          description: The state of the ticket.
          example: submitted
        created_at:
          type: integer
          format: date-time
          description: The time the ticket part was created.
          example: 1663597223
        updated_at:
          type: integer
          format: date-time
          description: The last time the ticket part was updated.
          example: 1663597260
        assigned_to:
          $ref: '#/components/schemas/reference'
          nullable: true
          description: The assignee this ticket_part assigned the ticket to, as a reference whose `type` is `admin`, `team` or `bot`. When the part unassigned the ticket, `type` is `nobody_admin` and `id` is `null`. Null when the part did not change the assignment, or when the assignee has since been deleted.
        author:
          $ref: '#/components/schemas/ticket_part_author'
        attachments:
          title: Ticket part attachments
          type: array
          description: A list of attachments for the part.
          items:
            $ref: '#/components/schemas/part_attachment'
        external_id:
          type: string
          nullable: true
          description: The external id of the ticket part
          example: abcd1234
        redacted:
          type: boolean
          description: Whether or not the ticket part has been redacted.
          example: false
    ticket_parts:
      title: Ticket Parts
      type: object
      description: A list of Ticket Part objects for each note and event in the ticket. There is a limit of 500 parts.
      properties:
        type:
          type: string
          description: ''
          enum:
            - ticket_part.list
          example: ticket_part.list
        ticket_parts:
          title: Tickt Parts
          type: array
          description: A list of Ticket Part objects for each ticket. There is a limit of 500 parts.
          items:
            $ref: '#/components/schemas/ticket_part'
        total_count:
          type: integer
          description: ''
          example: 2
    ticket_request_custom_attributes:
      title: Ticket Attributes
      type: object
      description: The attributes set on the ticket. When setting the default title and description attributes, the attribute keys that should be used are `_default_title_` and `_default_description_`. When setting ticket type attributes of the list attribute type, the key should be the attribute name and the value of the attribute should be the list item id, obtainable by [listing the ticket type](ref:get_ticket-types). For example, if the ticket type has an attribute called `priority` of type `list`, the key should be `priority` and the value of the attribute should be the guid of the list item (e.g. `de1825a0-0164-4070-8ca6-13e22462fa7e`).
      additionalProperties:
        anyOf:
          - type: string
            nullable: true
          - type: number
          - type: boolean
          - type: array
      example:
        _default_title_: Found a bug
        _default_description_: The button is not working
    ticket_state:
      title: Ticket State
      type: object
      x-tags:
        - Tickets
      description: A ticket state, used to define the state of a ticket.
      nullable: true
      properties:
        type:
          type: string
          description: String representing the object's type. Always has the value `ticket_state`.
          example: ticket_state
        id:
          type: string
          description: The id of the ticket state
          example: '12'
        category:
          type: string
          description: The category of the ticket state
          example: in_progress
          enum:
            - submitted
            - in_progress
            - waiting_on_customer
            - resolved
        internal_label:
          type: string
          description: The state the ticket is currently in, in a human readable form - visible in Intercom
          example: With Dev Team
        external_label:
          type: string
          description: The state the ticket is currently in, in a human readable form - visible to customers, in the messenger, email and tickets portal.
          example: In Progress
    ticket_type:
      title: Ticket Type
      type: object
      x-tags:
        - Tickets
      description: A ticket type, used to define the data fields to be captured in a ticket.
      nullable: true
      properties:
        type:
          type: string
          description: String representing the object's type. Always has the value `ticket_type`.
          example: ticket_type
        id:
          type: string
          description: The id representing the ticket type.
          example: '1295'
        category:
          type: string
          description: Category of the Ticket Type.
          enum:
            - Customer
            - Back-office
            - Tracker
          example: Customer
        name:
          type: string
          description: The name of the ticket type
          example: Bug
        description:
          type: string
          description: The description of the ticket type
          example: A bug that has been reported.
        icon:
          type: string
          description: The icon of the ticket type
          example: 🐞
        workspace_id:
          type: string
          description: The id of the workspace that the ticket type belongs to.
          example: ecahpwf5
        ticket_type_attributes:
          $ref: '#/components/schemas/ticket_type_attribute_list'
        ticket_states:
          title: Ticket States
          type: object
          description: A list of ticket states associated with a given ticket type.
          properties:
            type:
              type: string
              description: String representing the object's type. Always has the value `list`.
              example: list
            data:
              type: array
              description: A list of ticket states associated with a given ticket type.
              items:
                $ref: '#/components/schemas/ticket_state'
        archived:
          type: boolean
          description: Whether the ticket type is archived or not.
          example: false
        created_at:
          type: integer
          format: timestamp
          description: The date and time the ticket type was created.
        updated_at:
          type: integer
          format: timestamp
          description: The date and time the ticket type was last updated.
    ticket_type_attribute_list:
      title: Ticket Type Attributes
      type: object
      description: A list of attributes associated with a given ticket type.
      properties:
        type:
          type: string
          description: String representing the object's type. Always has the value `ticket_type_attributes.list`.
        ticket_type_attributes:
          type: array
          description: A list of ticket type attributes associated with a given ticket type.
          items:
            $ref: '#/components/schemas/ticket_type_attribute'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
```
