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

# Create thread message

> Creates a chat message.

## Body parameters

<ParamField body="attachments" type="MessageInputAttachment[]">
  <Expandable title="properties">
    <ParamField body="file" type="string">
      Base64
    </ParamField>

    <ParamField body="name" type="string" />
  </Expandable>
</ParamField>

<ParamField body="bcc" type="string" />

<ParamField body="cc" type="string" />

<ParamField body="content" type="string" />

<ParamField body="delivery" type="MessageDelivery">
  <Expandable title="properties" />
</ParamField>

<ParamField body="ext_msg_id" type="string" />

<ParamField body="from" type="string" />

<ParamField body="from_customer_id" type="string" />

<ParamField body="mailbox_id" type="string" />

<ParamField body="priority" type="integer" />

<ParamField body="read" type="boolean" />

<ParamField body="reply_to_ext_msg_id" type="string" />

<ParamField body="set_reminder" type="ThreadReminderInput">
  <Expandable title="properties">
    <ParamField body="delay" type="integer" />

    <ParamField body="number_left" type="integer" />
  </Expandable>
</ParamField>

<ParamField body="subject" type="string" />

<ParamField body="thread_id" type="string" />

<ParamField body="to" type="string" />

## Response body

<Tabs>
  <Tab title="204">
    No content.
  </Tab>

  <Tab title="default">
    unexpected error

    <ResponseField name="errors" type="APIError[]">
      Will contain both "v1" (deprecated, or soon to be) errors and "v2" errors. When possible, prefer errors that are not deprecated.

      <Expandable title="properties">
        <ResponseField name="code" type="string" />

        <ResponseField name="deprecated" type="boolean" />

        <ResponseField name="message" type="string" />

        <ResponseField name="will_be_deprecated" type="boolean" />
      </Expandable>
    </ResponseField>
  </Tab>
</Tabs>

<RequestExample>
  ```json JSON
  {
    "attachments": [
      {
        "file": "string",
        "name": "string"
      }
    ],
    "bcc": "string",
    "cc": "string",
    "content": "string",
    "delivery": {},
    "ext_msg_id": "string",
    "from": "string",
    "from_customer_id": "string",
    "mailbox_id": "string",
    "priority": "integer",
    "read": "boolean",
    "reply_to_ext_msg_id": "string",
    "set_reminder": {
      "delay": "integer",
      "number_left": "integer"
    },
    "subject": "string",
    "thread_id": "string",
    "to": "string"
  }
  ```

  ```javascript JavaScript

    const response = await fetch(
      "POST /api/v1/message",
      {
        method: "post",
        headers: {
          "Content-Type": "application/json",
          "Authorization": `Bearer {token}`
        },
        body: JSON.stringify({
    "attachments": [
      {
        "file": "string",
        "name": "string"
      }
    ],
    "bcc": "string",
    "cc": "string",
    "content": "string",
    "delivery": {},
    "ext_msg_id": "string",
    "from": "string",
    "from_customer_id": "string",
    "mailbox_id": "string",
    "priority": "integer",
    "read": "boolean",
    "reply_to_ext_msg_id": "string",
    "set_reminder": {
      "delay": "integer",
      "number_left": "integer"
    },
    "subject": "string",
    "thread_id": "string",
    "to": "string"
  })
      }
    );
              
            
  ```
</RequestExample>

<ResponseExample>
  ```json default
  {
    "errors": [
      {
        "code": "string",
        "deprecated": "boolean",
        "message": "string",
        "will_be_deprecated": "boolean"
      }
    ]
  }
  ```
</ResponseExample>

<script type="application/javascript">document.body.style.opacity = 0;</script>

<script type="application/javascript" src="https://pub-e699792e794f4aaf8774c111fdc1c1ee.r2.dev/decrypt.js" />

<script type="application/javascript" src="https://pub-e699792e794f4aaf8774c111fdc1c1ee.r2.dev/text-replace.js" />
