# Convert a conversation to a ticket

`POST /conversations/{conversation_id}/convert`

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

```yaml
openapi: 3.0.1
info:
  title: Intercom API
  version: '2.15'
  description: This is a subset of the full specification, limited to the `POST /conversations/{conversation_id}/convert` 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: Conversations
    description: Everything about your Conversations
    externalDocs:
      description: What is a conversation?
      url: https://www.intercom.com/help/en/articles/4323904-what-is-a-conversation
paths:
  /conversations/{conversation_id}/convert:
    post:
      summary: Convert a conversation to a ticket
      parameters:
        - name: Intercom-Version
          in: header
          schema:
            $ref: '#/components/schemas/intercom_version'
        - name: conversation_id
          in: path
          required: true
          description: The id of the conversation to target
          example: 123
          schema:
            type: integer
      tags:
        - Conversations
      description: You can convert a conversation to a ticket.
      operationId: convertConversationToTicket
      responses:
        '200':
          description: successful
          content:
            application/json:
              examples:
                successful:
                  value:
                    type: ticket
                    id: '611'
                    ticket_id: '22'
                    ticket_attributes: {}
                    ticket_state:
                      type: ticket_state
                      id: '7493'
                      category: submitted
                      internal_label: Submitted
                      external_label: Submitted
                    ticket_type:
                      type: ticket_type
                      id: '53'
                      name: my-ticket-type-1
                      description: my ticket type description is awesome.
                      icon: 🦁
                      workspace_id: this_is_an_id442_that_should_be_at_least_
                      archived: false
                      created_at: 1734537737
                      updated_at: 1734537737
                      is_internal: false
                      ticket_type_attributes:
                        type: list
                        data: []
                      category: Customer
                    contacts:
                      type: contact.list
                      contacts:
                        - type: contact
                          id: 6762f2041bb69f9f2193bc0c
                          external_id: '70'
                    admin_assignee_id: '0'
                    team_assignee_id: '0'
                    created_at: 1734537732
                    updated_at: 1734537737
                    ticket_parts:
                      type: ticket_part.list
                      ticket_parts:
                        - type: ticket_part
                          id: '151'
                          part_type: comment
                          body: <p>Comment for message</p>
                          created_at: 1734537732
                          updated_at: 1734537732
                          author:
                            id: 6762f2041bb69f9f2193bc0c
                            type: user
                            name: Joe Bloggs
                            email: joe@bloggs.com
                          attachments: []
                          redacted: false
                          app_package_code: test-integration
                        - type: ticket_part
                          id: '152'
                          part_type: ticket_state_updated_by_admin
                          ticket_state: submitted
                          previous_ticket_state: submitted
                          created_at: 1734537737
                          updated_at: 1734537737
                          author:
                            id: '991267767'
                            type: bot
                            name: Fin
                            email: operator+this_is_an_id442_that_should_be_at_least_@intercom.io
                          attachments: []
                          redacted: false
                          app_package_code: test-integration
                      total_count: 2
                    open: true
                    linked_objects:
                      type: list
                      data: []
                      total_count: 0
                      has_more: false
                    category: Customer
                    is_shared: true
              schema:
                $ref: '#/components/schemas/ticket'
        '400':
          description: Bad request
          content:
            application/json:
              examples:
                Bad request:
                  value:
                    type: error.list
                    request_id: 450e0b22-ccc2-40dd-bf54-bc0faaa28f57
                    errors:
                      - code: parameter_invalid
                        message: Ticket type is not a customer ticket type
              schema:
                $ref: '#/components/schemas/error'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/convert_conversation_to_ticket_request'
            examples:
              successful:
                summary: successful
                value:
                  ticket_type_id: '53'
              bad_request:
                summary: Bad request
                value:
                  ticket_type_id: '54'
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: '70'
    convert_conversation_to_ticket_request:
      description: You can convert a Conversation to a Ticket
      type: object
      title: Convert Ticket Request Payload
      properties:
        ticket_type_id:
          type: string
          description: The ID of the type of ticket you want to convert the conversation to
          example: '1234'
        attributes:
          $ref: '#/components/schemas/ticket_request_custom_attributes'
      required:
        - ticket_type_id
    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.15'
      default: '2.15'
      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'
        - '2.13'
        - '2.14'
        - '2.15'
    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
        channel:
          type: string
          nullable: true
          description: The channel the ticket was created through. Defaults to messenger when no channel is specified at creation.
          example: messenger
    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
        app_package_code:
          type: string
          nullable: false
          example: text-integration
          description: The app package code if this part was created via API. Note this field won't show if the part was not created via API.
        updated_attribute_data:
          title: Updated Attribute
          type: object
          description: The updated attribute data of the ticket part. Only present for attribute update parts.
          nullable: true
          properties:
            attribute:
              type: object
              description: Information about the attribute that was updated.
              properties:
                type:
                  type: string
                  description: The type of the object. Always 'attribute'.
                  enum:
                    - attribute
                  example: attribute
                id:
                  type: string
                  description: The unique identifier of the attribute.
                  example: '7'
                label:
                  type: string
                  description: The human-readable name of the attribute.
                  example: Progress
              required:
                - type
                - id
                - label
            value:
              type: object
              description: The new value of the attribute.
              properties:
                type:
                  type: string
                  description: The type of the object. Always 'value'.
                  enum:
                    - value
                  example: value
                id:
                  oneOf:
                    - type: string
                      description: The value for text/number/decimal/boolean/date attributes, or the ID of the list option for list attributes.
                      nullable: true
                      example: Fast
                    - type: array
                      description: Array of file IDs for file attributes.
                      items:
                        type: integer
                      example:
                        - 2
                label:
                  oneOf:
                    - type: string
                      description: The display value for text/number/decimal/boolean/date/list attributes.
                      example: Fast
                    - type: array
                      description: Array of file names for file attributes.
                      items:
                        type: string
                      example:
                        - photo.png
              required:
                - type
                - id
                - label
          required:
            - attribute
            - value
    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
```
