---
title: "Add Message to Case Communication Thread"
source_url: https://docs.rapyd.net/en/add-message-to-case-communication-thread.html
lang: en
---

# Add Message to Case Communication Thread

Add a new message to an existing communication thread.

### Parameters

### Request Path Parameters

- - thread_token (string, required)
  - Unique token for communication thread. String starting with **comm_**.

### 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 (object)
  - Identifier tokens (strings starting with **batch_**) of files referenced by this message. The maximum number of files that can be referenced is 5. See also [Upload File to Communication Center](https://docs.rapyd.net/en/upload-file-to-communication-center.md "Upload File to Communication Center")

  - content (string, required)
  - The text content of the message.

  - content_structured (object)
  - Includes the `ops` array, which provides formatting information on the content.

    - ops (object)
    - A single content-formatting operation.

      - insert (string)
      - The inserted text portion of the content. Note: **/n** indicates a line break.

      - attributes (object)
      - Boolean formatting parameters of the inserted text. The following are common attributes. See also the [Quill library formats](https://quilljs.com/docs/formats/).

        - bold (boolean)
        - When the value is true, the inserted text is formatted in bold.

        - italic (boolean)
        - When the value is true, the inserted text is formatted in italic.

        - underline (boolean)
        - When the value is true, the inserted text is underlined.

### 200 OK Response

- attachments (object)
- Identifier tokens (strings starting with **batch_**) of files referenced by this message. The maximum number of files that can be referenced is 5.

  - file_id (string)
  - The identifier of the attachment to download. Obtain it from the attachments array of a message. See also response in Get Case Communication Thread.

  - file_name (string)
  - The name of the file.

- comm_token (string)
- Unique token for communication thread. String starting with **comm_**.

- content (string)
- The contents of the message.

- content_structured (object)
- Includes the `ops` array, which provides formatting information on the content.

  - ops (object)
  - A single content-formatting operation.

    - insert (string)
    - The inserted text portion of the content. Note: **/n** indicates a line break.

    - attributes (object)
    - Boolean formatting parameters of the inserted text. The following are common attributes. See also the [Quill library formats](https://quilljs.com/docs/formats/).

      - bold (boolean)
      - When the value is true, the inserted text is formatted in bold.

      - italic (boolean)
      - When the value is true, the inserted text is formatted in italic.

      - underline (boolean)
      - When the value is true, the inserted text is underlined.

- created_at (string)
- The Unix Epoch time when the message was created.

- message_direction (string)
- The direction of the message. Values include:

  - **incoming:** A message that was received.

  - **outgoing:** - A message that was sent.

- token (string)
- Unique token for message. String starting with **msg_**.

- updated_at (string)
- The Unix Epoch time when the message was updated.

- v1/threads/:thread_token/messages

- Add Message to Case Communication Thread
- ```curl
  curl -X post 'https://api.rapyd.net/v1/threads/comm_5eda2b2651d2a9bda22845aff027ca53/messages' \
  -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 '{
      "content": "Please review these documents",
      "content_structured": {
          "ops": [
              {
                  "insert": "Please review these documents",
                  "attributes": {
                      "bold": true,
                      "underline": true
                  }
              }
          ]
      },
      "attachments": [
          "batch_a2d38836563775b3b84214352bb01e41",
          "batch_415e274c1c31f37c74b6fd7a6e732505"
      ]
  }
  '
   
  ```
- ```json
  {
      "status": {
          "error_code": "",
          "status": "SUCCESS",
          "message": "",
          "response_code": "",
          "operation_id": "037dd31b-4173-464a-b476-e9689d022d3b"
      },
      "data": [
          {
              "comm_token": "comm_5eda2b2651d2a9bda22845aff027ca53",
              "token": "msg_d6600ab008e35ac08c05cce98350d226",
              "content": "Please review these documents",
              "content_structured": {
                  "ops": [
                      {
                          "insert": "Please review these documents",
                          "attributes": {
                              "bold": true,
                              "underline": true
                          }
                      }
                  ]
              },
              "message_direction": "outgoing",
              "attachments": [
                  {
                      "file_id": "377a5b5b-01df-4b24-a8b7-0a3075c6b6f3",
                      "file_name": "2021-07-28_23-56-19.png"
                  },
                  {
                      "file_id": "c31c1f07-7c9a-45f5-847c-470e6811b3ea",
                      "file_name": "2021-08-30_20-13-16.png"
                  }
              ],
              "created_at": 1752493136,
              "updated_at": 1752493136
          }
      ]
  }
  ```
