# Reply to a ticket

`POST /tickets/{id}/reply`

> This is a subset of the full specification, limited to the `POST /tickets/{id}/reply` 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/{id}/reply` operation.
  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/{id}/reply:
    post:
      summary: Reply to a ticket
      operationId: replyTicket
      description: You can reply to a ticket with a message from an admin or on behalf of a contact, or with a note for admins.
      parameters:
        - name: Intercom-Version
          in: header
          schema:
            $ref: '#/components/schemas/intercom_version'
        - name: id
          in: path
          required: true
          schema:
            title: Ticket ID
            type: string
            description: |-
              The id of the ticket to target.

              **Not the Inbox ticket ID**

              This is the internal `id` field from the API response, not the `ticket_id` displayed in the Intercom Inbox (e.g., #12345). Use the `id` value from the ticket object returned by the API.
            example: '123'
      tags:
        - Tickets
      responses:
        '200':
          description: Admin quick_reply reply
          content:
            application/json:
              examples:
                Admin note reply:
                  value:
                    type: ticket_part
                    id: '31'
                    part_type: note
                    body: |-
                      <h2>An Unordered HTML List</h2>
                      <ul>
                      <li>Coffee</li>
                      <li>Tea</li>
                      <li>Milk</li>
                      </ul>
                      <h2>An Ordered HTML List</h2>
                      <ol>
                      <li>Coffee</li>
                      <li>Tea</li>
                      <li>Milk</li>
                      </ol>
                    created_at: 1736201911
                    updated_at: 1736201911
                    author:
                      id: '991266696'
                      type: admin
                      name: Ciaran417 Lee
                      email: admin417@email.com
                    attachments: []
                    redacted: false
                Admin quick_reply reply:
                  value:
                    type: ticket_part
                    id: '33'
                    part_type: quick_reply
                    created_at: 1736201915
                    updated_at: 1736201915
                    author:
                      id: '991266701'
                      type: admin
                      name: Ciaran421 Lee
                      email: admin421@email.com
                    attachments: []
                    redacted: false
              schema:
                $ref: '#/components/schemas/ticket_reply'
        '400':
          description: Bad Request
          content:
            application/json:
              examples:
                User reply:
                  value:
                    type: error.list
                    request_id: 9fbb1df1-ff74-4519-8091-ff7f794a58f1
                    errors:
                      - code: parameter_mismatch
                        message: User replies are not allowed on Backoffice tickets
                Admin comment on a back-office ticket:
                  value:
                    type: error.list
                    request_id: 7a1c9f02-5d3e-4b8a-9c21-6f0d84e5b713
                    errors:
                      - code: parameter_mismatch
                        message: Comments are not allowed on Backoffice tickets not shared with user. Use message_type 'note' instead, or share the ticket with the customer
                Admin comment on a tracker ticket:
                  value:
                    type: error.list
                    request_id: c4e2a980-31bf-4d76-8a05-2e9cb17f4d6a
                    errors:
                      - code: parameter_mismatch
                        message: Comments are not allowed on Tracker tickets. Use message_type 'note' instead
              schema:
                $ref: '#/components/schemas/error'
        '401':
          description: Unauthorized
          content:
            application/json:
              examples:
                Unauthorized:
                  value:
                    type: error.list
                    request_id: 2e147097-ebc0-48e4-b756-eb765362cb96
                    errors:
                      - code: unauthorized
                        message: Access Token Invalid
              schema:
                $ref: '#/components/schemas/error'
        '404':
          description: Not found
          content:
            application/json:
              examples:
                Not found:
                  value:
                    type: error.list
                    request_id: 32005c52-543d-409e-88df-cdc2ef696b8c
                    errors:
                      - code: not_found
                        message: Resource Not Found
              schema:
                $ref: '#/components/schemas/error'
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/contact_reply_ticket_request'
                - $ref: '#/components/schemas/admin_reply_ticket_request'
            examples:
              user_reply:
                summary: User reply
                value:
                  message_type: comment
                  type: user
                  intercom_user_id: 677c56b36abd011ad17ff5b6
                  body: Thanks again :)
              admin_note_reply:
                summary: Admin note reply
                value:
                  message_type: note
                  type: admin
                  admin_id: 991266696
                  body: <html> <body>  <h2>An Unordered HTML List</h2>  <ul>   <li>Coffee</li>   <li>Tea</li>   <li>Milk</li> </ul>    <h2>An Ordered HTML List</h2>  <ol>   <li>Coffee</li>   <li>Tea</li>   <li>Milk</li> </ol>   </body> </html>
              admin_note_cross_post_reply:
                summary: Admin note reply with cross-post to linked conversations
                value:
                  message_type: note
                  type: admin
                  admin_id: 991266696
                  body: This note will be cross-posted to all linked conversations.
                  cross_post: true
              admin_quick_reply_reply:
                summary: Admin quick_reply reply
                value:
                  message_type: quick_reply
                  type: admin
                  admin_id: 991266701
                  reply_options:
                    - text: 'Yes'
                      uuid: 884f7963-b954-4476-8082-10ecca2e2dac
                    - text: 'No'
                      uuid: e569aabd-8a51-43f3-a553-fa08256ebd8d
              not_found:
                summary: Not found
                value:
                  message_type: comment
                  type: user
                  intercom_user_id: 677c56bd6abd011ad17ff5b9
                  body: Thanks again :)
components:
  schemas:
    admin_reply_ticket_request:
      title: Admin Reply on ticket
      type: object
      description: Payload of the request to reply on behalf of an admin
      properties:
        message_type:
          type: string
          description: The type of reply. Tracker tickets and back-office tickets that are not shared with the customer do not support `comment`; use `note` instead.
          enum:
            - comment
            - note
            - quick_reply
          example: comment
        type:
          type: string
          enum:
            - admin
          example: admin
        body:
          type: string
          description: The text body of the reply. Notes accept some HTML formatting. Must be present for comment and note message types.
          example: Hello there!
        admin_id:
          type: string
          description: The id of the admin who is authoring the comment.
          example: '3156780'
        created_at:
          type: integer
          description: The time the reply was created. If not provided, the current time will be used.
          example: 1590000000
        reply_options:
          title: Quick Reply Options
          type: array
          description: The quick reply options to display. Must be present for quick_reply message types.
          items:
            title: Quick Reply Option
            type: object
            properties:
              text:
                type: string
                description: The text to display in this quick reply option.
              uuid:
                type: string
                format: uuid
                description: A unique identifier for this quick reply option. This value will be available within the metadata of the comment ticket part that is created when a user clicks on this reply option.
            required:
              - text
              - uuid
        attachment_urls:
          type: array
          description: A list of image URLs that will be added as attachments. You can include up to 10 URLs.
          items:
            type: string
            format: uri
          maxItems: 10
        cross_post:
          type: boolean
          description: If set to true, the note will be cross-posted to all linked conversations. Only applicable to note message types on back-office tickets.
          example: true
      required:
        - message_type
        - type
        - admin_id
    contact_reply_base_request:
      title: Contact Reply Base Object
      type: object
      properties:
        message_type:
          type: string
          enum:
            - comment
        type:
          type: string
          enum:
            - user
        body:
          type: string
          description: The text body of the comment.
        created_at:
          type: integer
          description: The time the reply was created. If not provided, the current time will be used.
          example: 1590000000
        attachment_urls:
          title: Attachment URLs
          type: array
          description: A list of image URLs that will be added as attachments. You can include up to 10 URLs.
          items:
            type: string
            format: uri
          maxItems: 10
      required:
        - message_type
        - type
        - body
    contact_reply_ticket_email_request:
      title: Email
      type: object
      description: Payload of the request to reply on behalf of a contact using their `email`
      properties:
        email:
          type: string
          description: The email you have defined for the user.
      allOf:
        - $ref: '#/components/schemas/contact_reply_base_request'
      required:
        - email
    contact_reply_ticket_intercom_user_id_request:
      title: Intercom User ID
      type: object
      description: Payload of the request to reply on behalf of a contact using their `intercom_user_id`
      allOf:
        - $ref: '#/components/schemas/contact_reply_base_request'
      properties:
        intercom_user_id:
          type: string
          description: The identifier for the contact as given by Intercom.
      required:
        - intercom_user_id
    contact_reply_ticket_request:
      title: Contact Reply on ticket
      oneOf:
        - $ref: '#/components/schemas/contact_reply_ticket_intercom_user_id_request'
        - $ref: '#/components/schemas/contact_reply_ticket_user_id_request'
        - $ref: '#/components/schemas/contact_reply_ticket_email_request'
    contact_reply_ticket_user_id_request:
      title: User ID
      type: object
      description: Payload of the request to reply on behalf of a contact using their `user_id`
      allOf:
        - $ref: '#/components/schemas/contact_reply_base_request'
      properties:
        user_id:
          type: string
          description: The external_id you have defined for the contact.
      required:
        - user_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
    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
    part_attachment:
      title: Part attachment
      type: object
      description: The file attached to a part
      properties:
        type:
          type: string
          description: The type of attachment
          example: upload
        name:
          type: string
          description: The name of the attachment
          example: example.png
        url:
          type: string
          description: The URL of the attachment
          example: https://picsum.photos/200/300
        content_type:
          type: string
          description: The content type of the attachment
          example: image/png
        filesize:
          type: integer
          description: The size of the attachment
          example: 100
        width:
          type: integer
          description: The width of the attachment
          example: 100
        height:
          type: integer
          description: The height of the attachment
          example: 100
    ticket_part_author:
      title: Ticket part author
      type: object
      description: The author that wrote or triggered the part. Can be a bot, admin, team or user.
      properties:
        type:
          type: string
          description: The type of the author
          example: admin
          enum:
            - admin
            - bot
            - team
            - user
        id:
          type: string
          description: The id of the author
          example: '274'
        name:
          type: string
          nullable: true
          description: The name of the author
          example: Operator
        email:
          type: string
          format: email
          description: The email of the author
          example: operator+abcd1234@intercom.io
    ticket_reply:
      title: A Ticket Part representing a note, comment, or quick_reply on a ticket
      type: object
      description: A Ticket Part representing a note, comment, or quick_reply on a ticket
      properties:
        type:
          type: string
          description: Always ticket_part
          example: ticket_part
          enum:
            - ticket_part
        id:
          type: string
          description: The id representing the part.
          example: '3'
        part_type:
          type: string
          description: Type of the part
          example: note
          enum:
            - note
            - comment
            - quick_reply
        body:
          type: string
          nullable: true
          description: The message body, which may contain HTML.
          example: <p>Okay!</p>
        created_at:
          type: integer
          format: date-time
          description: The time the note was created.
          example: 1663597223
        updated_at:
          type: integer
          format: date-time
          description: The last time the note was updated.
          example: 1663597260
        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'
        redacted:
          type: boolean
          description: Whether or not the ticket part has been redacted.
          example: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
```
