---
title: "Add Comment"
source_url: https://docs.rapyd.net/en/add-comment.html
lang: en
---

# Add Comment

Adds a plain text comment, with optional attachments, to an open ticket. You cannot comment on a closed ticket.

To attach files, upload each file with [Upload Attachment](https://docs.rapyd.net/en/upload-attachment.md "Upload Attachment") first and pass the tokens in `attachments`. If the API cannot attach a file, it still adds the comment and returns the failed tokens in `failed_attachments`.

### Parameters

### Request Path Parameters

- - ticket_id (string, required)
  - The ID of the ticket.

### Request Header Parameters

- - access_key (string, required)
  - Unique access key provided by Rapyd for each authorized user.

    See [Developers](https://docs.rapyd.net/en/developers.md "Developers").
- - Content-Type (string, required)
  - Indicates that the data appears in JSON format. Set to **application/json**.
- - idempotency (string)
  - A unique key that prevents the platform from creating the same object twice.

    See [Idempotency](https://docs.rapyd.net/en/idempotency.md "Idempotency").
- - salt (string, required)
  - Random string. Recommended length: 8-16 characters.
- - signature (string, required)
  - Signature calculated for each request individually.

    See [Request Signatures](https://docs.rapyd.net/en/request-signatures.md "Request Signatures").
- - timestamp (string, required)
  - Timestamp for the request, in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time") (seconds).

### Request Body Parameters

- - attachments (array)
  - Array of strings. Batch tokens returned by [Upload Attachment](https://docs.rapyd.net/en/upload-attachment.md "Upload Attachment") . Up to 5.
- - text (string, required)
  - The text of the comment. Maximum length: 1500 characters.

### 200 OK Response

- - attachment_ids (array)
  - Array of strings. The IDs of the files attached to the comment.
- - created_at (number)
  - The time of comment creation, in Unix seconds.
- - failed_attachments (array)
  - Array of strings. The tokens of files that the API could not attach. Returned only when at least one file failed. The API adds the comment anyway.
- - id (string)
  - The ID of the comment.

- /v1/support/tickets/:ticket_id/comments

- Add Comment
- ```curl
  curl -X post 'https://sandboxapi.rapyd.net/v1/support/tickets/49230885151/comments' \
  -H 'access_key: your-access-key-here' \
  -H 'Content-Type: application/json' \
  -H 'idempotency: your-idempotency-parameter-here' \
  -H 'salt: your-random-string-here' \
  -H 'signature: your-calculated-signature-here' \
  -H 'timestamp: your-unix-timestamp-here' \
  --data-raw '{
      "text": "The bank statement is attached.",
      "attachments": [
          "batch_9f1c2d7e4a6b"
      ]
  }'
  ```
- ```json
  {
      "status": {
          "error_code": "",
          "status": "SUCCESS",
          "message": "",
          "response_code": "",
          "operation_id": "6f1c1d0e-2b7a-4f0e-9d0a-3c1d8e2b7a11"
      },
      "data": {
          "id": "63519371323",
          "created_at": 1791448200,
          "attachment_ids": [
              "224063538994"
          ],
          "failed_attachments": []
      }
  }
  ```
