> ## 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.

# Update thread

> Updates the specified chat thread.

## Path parameters

<ParamField path="id" type="string" required />

## Body parameters

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

<ParamField body="customer_external_ids" type="string[]" />

<ParamField body="customer_ids" type="string[]" />

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

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

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

<ParamField body="tag_codes" type="string[]" />

## Response body

<Tabs>
  <Tab title="200">
    <ResponseField name="attachments" type="Attachment[]">
      <Expandable title="properties">
        <ResponseField name="attachment_movements" type="AttachmentMovements">
          <Expandable title="properties">
            <ResponseField name="movements" type="AttachmentMovedTo[]">
              <Expandable title="properties">
                <ResponseField name="agent_id" type="integer" />

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

                <ResponseField name="file_id" type="string" />
              </Expandable>
            </ResponseField>

            <ResponseField name="total" type="integer" />
          </Expandable>
        </ResponseField>

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

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

        <ResponseField name="file_not_dangerous" type="boolean">
          null means not verified
        </ResponseField>

        <ResponseField name="file_size" type="integer" />

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

        <ResponseField name="id" type="string" />
      </Expandable>
    </ResponseField>

    <ResponseField name="client_id" type="integer" />

    <ResponseField name="contacts" type="string[]" />

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

    <ResponseField name="customers" type="Customer[]">
      <Expandable title="properties">
        <ResponseField name="account_number" type="string" />

        <ResponseField name="account_type" type="CustomerAccountType">
          <Expandable title="properties" />
        </ResponseField>

        <ResponseField name="alias_ids" type="string[]" />

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

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

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

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

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

        <ResponseField name="created_by" type="integer" />

        <ResponseField name="custom_fields" type="object" />

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

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

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

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

        <ResponseField name="domicile_codes" type="string[]" />

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

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

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

        <ResponseField name="kyc_level" type="integer" />

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

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

        <ResponseField name="name_variations" type="CustomerNameVariation[]">
          <Expandable title="properties">
            <ResponseField name="company_name" type="string" />

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

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

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

            <ResponseField name="trading_name" type="string" />
          </Expandable>
        </ResponseField>

        <ResponseField name="nationality_code" type="string">
          deprecated. Use nationality\_codes instead
        </ResponseField>

        <ResponseField name="nationality_codes" type="string[]" />

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

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

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

        <ResponseField name="review_groups" type="string[]" />

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

        <ResponseField name="trading_name" type="string" />
      </Expandable>
    </ResponseField>

    <ResponseField name="external_message_ids" type="string[]" />

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

    <ResponseField name="last_message" type="Message">
      <Expandable title="properties">
        <ResponseField name="agent_id" type="integer" />

        <ResponseField name="attachments" type="Attachment[]">
          <Expandable title="properties">
            <ResponseField name="attachment_movements" type="AttachmentMovements">
              <Expandable title="properties">
                <ResponseField name="movements" type="AttachmentMovedTo[]">
                  <Expandable title="properties">
                    <ResponseField name="agent_id" type="integer" />

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

                    <ResponseField name="file_id" type="string" />
                  </Expandable>
                </ResponseField>

                <ResponseField name="total" type="integer" />
              </Expandable>
            </ResponseField>

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

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

            <ResponseField name="file_not_dangerous" type="boolean">
              null means not verified
            </ResponseField>

            <ResponseField name="file_size" type="integer" />

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

            <ResponseField name="id" type="string" />
          </Expandable>
        </ResponseField>

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

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

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

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

        <ResponseField name="delivery" type="MessageDelivery">
          <Expandable title="properties" />
        </ResponseField>

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

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

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

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

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

        <ResponseField name="origin" type="MessageOrigin">
          <Expandable title="properties" />
        </ResponseField>

        <ResponseField name="priority" type="integer" />

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

        <ResponseField name="read_by_agents" type="integer[]" />

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

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

        <ResponseField name="to" type="string" />
      </Expandable>
    </ResponseField>

    <ResponseField name="message_count" type="integer" />

    <ResponseField name="reminder" type="ThreadReminder">
      <Expandable title="properties">
        <ResponseField name="delay" type="integer" />

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

        <ResponseField name="number_left" type="integer" />
      </Expandable>
    </ResponseField>

    <ResponseField name="review_groups" type="string[]" />

    <ResponseField name="status" type="ThreadStatus">
      <Expandable title="properties" />
    </ResponseField>

    <ResponseField name="tags" type="string[]" />

    <ResponseField name="updated_at" type="string" />
  </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
  {
    "comment": "string",
    "customer_external_ids": [
      "string"
    ],
    "customer_ids": [
      "string"
    ],
    "reminder": {
      "delay": "integer",
      "number_left": "integer"
    },
    "status": "integer",
    "tag_codes": [
      "string"
    ]
  }
  ```

  ```javascript JavaScript

    const response = await fetch(
      "POST /api/v1/thread/{id}",
      {
        method: "post",
        headers: {
          "Content-Type": "application/json",
          "Authorization": `Bearer {token}`
        },
        body: JSON.stringify({
    "comment": "string",
    "customer_external_ids": [
      "string"
    ],
    "customer_ids": [
      "string"
    ],
    "reminder": {
      "delay": "integer",
      "number_left": "integer"
    },
    "status": "integer",
    "tag_codes": [
      "string"
    ]
  })
      }
    );
              
            
  ```
</RequestExample>

<ResponseExample>
  ```json 200
  {
    "attachments": [
      {
        "attachment_movements": {
          "movements": [
            {
              "agent_id": "integer",
              "customer_id": "string",
              "file_id": "string"
            }
          ],
          "total": "integer"
        },
        "file_mime": "string",
        "file_name": "string",
        "file_not_dangerous": "boolean",
        "file_size": "integer",
        "file_type": "string",
        "id": "string"
      }
    ],
    "client_id": "integer",
    "contacts": [
      "string"
    ],
    "created_at": "string",
    "customers": [
      {
        "account_number": "string",
        "account_type": {},
        "alias_ids": [
          "string"
        ],
        "client_id": "string",
        "comment": "string",
        "company_name": "string",
        "contacts": "string",
        "created_at": "string",
        "created_by": "integer",
        "custom_fields": "object",
        "customer_type": "string",
        "date_of_birth": "string",
        "disabled": "boolean",
        "domicile_code": "string",
        "domicile_codes": [
          "string"
        ],
        "external_id": "string",
        "first_name": "string",
        "id": "string",
        "kyc_level": "integer",
        "last_name": "string",
        "middle_name": "string",
        "name_variations": [
          {
            "company_name": "string",
            "first_name": "string",
            "last_name": "string",
            "middle_name": "string",
            "trading_name": "string"
          }
        ],
        "nationality_code": "string",
        "nationality_codes": [
          "string"
        ],
        "parent_external_id": "string",
        "phone": "string",
        "registration_number": "string",
        "review_groups": [
          "string"
        ],
        "revision_number": "string",
        "trading_name": "string"
      }
    ],
    "external_message_ids": [
      "string"
    ],
    "id": "string",
    "last_message": {
      "agent_id": "integer",
      "attachments": [
        {
          "attachment_movements": {
            "movements": [
              {
                "agent_id": "integer",
                "customer_id": "string",
                "file_id": "string"
              }
            ],
            "total": "integer"
          },
          "file_mime": "string",
          "file_name": "string",
          "file_not_dangerous": "boolean",
          "file_size": "integer",
          "file_type": "string",
          "id": "string"
        }
      ],
      "bcc": "string",
      "cc": "string",
      "content": "string",
      "created_at": "string",
      "delivery": {},
      "error_when_trying_to_send": "string",
      "external_message_id": "string",
      "from": "string",
      "id": "string",
      "mailbox_id": "string",
      "origin": {},
      "priority": "integer",
      "raw_message": "string",
      "read_by_agents": [
        "integer"
      ],
      "reply_to_external_message_id": "string",
      "subject": "string",
      "to": "string"
    },
    "message_count": "integer",
    "reminder": {
      "delay": "integer",
      "next_date": "string",
      "number_left": "integer"
    },
    "review_groups": [
      "string"
    ],
    "status": {},
    "tags": [
      "string"
    ],
    "updated_at": "string"
  }
  ```

  ```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" />
