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

# Update thread client associations

> Add or remove client associations from all messages in a thread. This allows linking email threads to specific clients for better organization and tracking.



## OpenAPI

````yaml /api-reference/cx/swagger.json post /inbox/thread/{thread}/_client
openapi: 3.0.0
info:
  description: CX API.
  title: CX API
  contact:
    name: API Support
    url: https://stax.ai
    email: support@stax.ai
  version: '1.0'
servers:
  - url: https://api.cx.stax.ai
security: []
paths:
  /inbox/thread/{thread}/_client:
    post:
      tags:
        - Inbox
      summary: Update thread client associations
      description: >-
        Add or remove client associations from all messages in a thread. This
        allows linking email threads to specific clients for better organization
        and tracking.
      parameters:
        - description: Thread ID
          name: thread
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties:
                type: string
        description: >-
          Client update data (add: client ID to add, remove: client ID to
          remove)
        required: true
      responses:
        '200':
          description: Client associations updated successfully
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: boolean
        '400':
          description: Invalid client ID or failed to parse request body
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      description: CX API key. Create one in CX under Settings → Advanced → API Keys.
      in: header
      name: x-api-key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.