> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.neetodesk.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create comment

> Creates a comment for a specific ticket.

<Info>Replace `{your-subdomain}` with your workspace's subdomain. <br /> Learn how to find your subdomain in [Workspace subdomain](/api/workspace-subdomain).</Info>


## OpenAPI

````yaml bundled/comments.yaml POST /tickets/{ticket_id}/comments
openapi: 3.0.3
info:
  title: NeetoDesk APIs
  version: 2.0.0
servers:
  - description: NeetoDesk APIs
    url: https://{your-subdomain}.neetodesk.com/api/external/v2
    variables:
      your-subdomain:
        default: spinkart
        description: >-
          Replace **spinkart** with your [workspace's
          subdomain](/api/workspace-subdomain).
security: []
paths:
  /tickets/{ticket_id}/comments:
    post:
      summary: Create a comment for a ticket
      description: Creates a comment for a specific ticket.
      parameters:
        - $ref: '#/components/parameters/api_key_header'
        - $ref: '#/components/parameters/ticket_id_param'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCommentRequest'
      responses:
        '201':
          description: Created - Comment created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCommentResponse'
components:
  parameters:
    api_key_header:
      in: header
      name: X-Api-Key
      description: >-
        Use the X-Api-Key header to provide your workspace API key. Refer to
        [Authentication](/api/authentication) for more information.
      required: true
      schema:
        type: string
        default: your-api-key
    ticket_id_param:
      in: path
      name: ticket_id
      description: >-
        ID of the ticket. You can use either the ticket ID (UUID) or ticket
        number (sequential number) interchangeably. Refer to [Getting Ticket
        ID](/api/getting-ticket-id) section for detailed instructions.
      required: true
      schema:
        type: string
  schemas:
    CreateCommentRequest:
      type: object
      required:
        - author_email
        - content
      properties:
        author_email:
          type: string
          description: >
            Email address to attribute the comment to. Matching is
            case-insensitive.

            How it resolves depends on `author_type`:


            - `agent` — matches an existing team member only. A team member is
            never
              created, because that would mean a seat, an invitation and a billing change.
              An unknown address is rejected.
            - `customer` — matches an existing customer, and creates one if
            there is none.
              This is what an import uses, since a historical thread is full of people who
              have since left.
            - omitted — matches an existing team member, then an existing
            customer, and
              creates nothing. An unknown address is rejected.
          example: lenor@example.com
        author_type:
          type: string
          enum:
            - agent
            - customer
          description: >
            Which kind of author `author_email` refers to, for addresses that
            could be

            either. Also the switch that allows a customer to be created on
            demand; see

            `author_email`.
          example: customer
        content:
          type: string
          description: Content for the comment.
          example: We are looking into the issue.
        comment_type:
          type: string
          enum:
            - reply
            - note
          description: The type of the comment. Defaults to `reply`.
          example: note
        created_at:
          type: string
          format: date-time
          description: >
            Original time the comment was written, for importing a historical
            thread.

            ISO 8601. The ticket's `updated_at` becomes the later of its current
            value and

            this date, so posting a thread in order leaves the ticket dated by
            its newest

            comment and posting one out of order never drags it backwards. A
            value that

            cannot be parsed is rejected.
          example: '2021-06-09T12:00:00Z'
        message_id:
          type: string
          description: >
            Caller-supplied identifier, unique per ticket. Posting the same
            `message_id`

            twice returns the comment already created rather than a duplicate,
            which makes

            an interrupted import safe to re-run. The repeat also answers `201`,
            so a

            re-run cannot be told apart from a first write by status code alone.
          example: cp-worklog-9912@example.com
        attachments:
          type: array
          items:
            type: string
          description: >
            Signed ids returned by [Upload attachment](/api/attachments/create).

            A signed id minted in another workspace is rejected. Attachments are

            all-or-nothing: if any id in the array is unknown, malformed or from
            another

            workspace, the whole request fails and no comment is created.
          example:
            - eyJfcmFpbHMiOnsiZGF0YSI6IjEyMyJ9fQ==
        mentions:
          type: array
          description: >-
            Optional list of users to mention in the comment. Mentions are only
            supported when `comment_type` is `note`. For inline placement,
            include `@Full Name` for each mentioned user in `content`.
          items:
            type: object
            required:
              - email
            properties:
              email:
                type: string
                description: >-
                  Email address of the user to mention. The user must be active
                  in the same organization.
                example: daniel.kuhlman@example.com
    CreateCommentResponse:
      type: object
      properties:
        comment:
          $ref: '#/components/schemas/Comment'
    Comment:
      type: object
      properties:
        id:
          type: string
          example: aaaabbbb-cccc-dddd-eeee-ffff00002222
        created_at:
          type: string
          format: date-time
        comment_type:
          type: string
          example: reply
        content:
          type: string
          example: We are looking into the issue and will update you shortly.
        author:
          $ref: '#/components/schemas/Author'
        attachments:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                example: aaaabbbb-cccc-dddd-eeee-ffff00003333
              url:
                type: string
                example: https://example.com/attachments/screenshot.png
              filename:
                type: string
                example: screenshot.png
        mentions:
          type: array
          items:
            $ref: '#/components/schemas/Mention'
    Author:
      type: object
      properties:
        id:
          type: string
          example: aaaabbbb-cccc-dddd-eeee-ffff00001111
        name:
          type: string
          example: Oliver Smith
        email:
          type: string
          example: oliver@example.com
        type:
          type: string
          example: user
    Mention:
      type: object
      properties:
        id:
          type: string
          example: aaaabbbb-cccc-dddd-eeee-ffff00005555
        name:
          type: string
          example: Daniel Kuhlman
        email:
          type: string
          format: email
          example: daniel.kuhlman@example.com

````