> ## Documentation Index
> Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-fjmorr-1782499519-e1e0dbe.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Bulk update threads

> Applies one thread update payload to multiple threads in a single call. `data` uses the same shape as the single-thread update payload. The request may include at most 50 thread IDs. Returns one result per thread in the same order as `thread_ids`; the overall response is 200 even when individual threads fail.



## OpenAPI

````yaml /langsmith/headless-fleet-openapi.json post /v1/fleet/threads/bulk-modify
openapi: 3.0.0
info:
  contact: {}
  description: >
    The Fleet API is a headless interface for building and running agents —
    create and configure agents, manage their connections and secrets, run
    threads, and wire up triggers.


    Paths are service-native (e.g. `/v1/fleet/agents`). Self-hosted deployments
    reach them through the gateway under an `/api` prefix (e.g.
    `/api/v1/fleet/agents`).


    ## Authentication


    Every request must carry **one** credential:


    | Scheme | Header | Value |

    | --- | --- | --- |

    | API key | `X-Api-Key` | A LangSmith API key (`lsv2_…`). |

    | Session token | `Authorization` | `Bearer <session JWT>`. |


    Workspace-scoped endpoints additionally require **`X-Tenant-Id`**, set to
    the workspace (tenant) UUID the request operates in. Organization- and
    identity-scoped endpoints omit it.


    ## Errors


    Errors follow [RFC 7807](https://www.rfc-editor.org/rfc/rfc7807) (Problem
    Details) and use one JSON shape across every endpoint:


    ```json

    {
      "type": "about:blank",
      "code": "agent_not_found",
      "detail": "No agent exists with that ID.",
      "status": 404
    }

    ```


    - `type` — URI identifying the error type. Currently always `about:blank`
    (the RFC 7807 default); branch on `code`, not `type`.

    - `code` — stable, machine-readable identifier. Branch on this rather than
    matching `detail`.

    - `detail` — human-readable explanation. Proxied endpoints also echo it as
    `message`.

    - `status` — mirrors the HTTP status code.


    | Status | Meaning |

    | --- | --- |

    | `400` | Malformed request or failed validation. |

    | `401` | Missing or invalid credentials. |

    | `403` | Authenticated, but not permitted to access this resource. |

    | `404` | The resource does not exist or is not visible to your workspace. |

    | `409` | Conflicts with current state (e.g. a duplicate). |

    | `422` | Well-formed but semantically invalid. |

    | `500` | Unexpected server error. |

    | `502` / `503` | An upstream dependency failed or was unavailable. Retries
    are usually safe. |


    ## Pagination


    List endpoints return a fixed-size page and an opaque cursor:


    ```json

    { "items": [ ], "next_cursor": "eyJ…" }

    ```


    - `page_size` — items per page, `1`–`100` (default `20`).

    - `cursor` — pass the previous response's `next_cursor` to fetch the next
    page. An absent or empty `next_cursor` means there are no more results.


    Cursors are opaque — don't construct or parse them.
  title: Fleet API
  version: v1
servers:
  - url: /
security: []
tags:
  - name: agents
  - name: agent connections
  - name: threads
  - name: skills
  - name: auth
  - name: integrations
  - name: secrets
  - name: models
  - name: tenants
  - name: users
paths:
  /v1/fleet/threads/bulk-modify:
    post:
      tags:
        - threads
      summary: Bulk update threads
      description: >-
        Applies one thread update payload to multiple threads in a single call.
        `data` uses the same shape as the single-thread update payload. The
        request may include at most 50 thread IDs. Returns one result per thread
        in the same order as `thread_ids`; the overall response is 200 even when
        individual threads fail.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/threads.BulkUpdateThreadsRequest'
        description: Bulk thread update payload
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/threads.BulkUpdateThreadsResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/threads.ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/threads.ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/threads.ErrorResponse'
        '502':
          description: Bad Gateway
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/threads.ErrorResponse'
      security:
        - API_Key: []
        - Tenant_ID: []
        - Bearer_Auth: []
components:
  schemas:
    threads.BulkUpdateThreadsRequest:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/threads.UpdateThreadRequest'
        thread_ids:
          type: array
          items:
            type: string
    threads.BulkUpdateThreadsResponse:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/threads.BulkUpdateThreadResult'
    threads.ErrorResponse:
      type: object
      properties:
        code:
          type: string
        detail:
          type: string
        status:
          type: integer
        type:
          type: string
    threads.UpdateThreadRequest:
      type: object
      properties:
        metadata:
          $ref: '#/components/schemas/threads.UpdateThreadMetadata'
        title:
          $ref: '#/components/schemas/threads.OptionalField-string'
    threads.BulkUpdateThreadResult:
      type: object
      properties:
        error_code:
          type: string
          example: thread_not_found
        id:
          type: string
          format: uuid
          example: 22222222-2222-2222-2222-222222222222
        message:
          type: string
          example: No thread exists with that ID.
        status:
          type: string
          enum:
            - success
            - failure
          example: success
    threads.UpdateThreadMetadata:
      type: object
      properties:
        is_pinned:
          $ref: '#/components/schemas/threads.OptionalField-bool'
        is_test_run:
          $ref: '#/components/schemas/threads.OptionalField-bool'
        read_status:
          $ref: '#/components/schemas/threads.OptionalField-bool'
        sandbox_recreated_at:
          $ref: '#/components/schemas/threads.OptionalField-string'
        skip_memory_write_protection:
          $ref: '#/components/schemas/threads.OptionalField-bool'
    threads.OptionalField-string:
      type: object
      properties:
        set:
          type: boolean
        value:
          type: string
    threads.OptionalField-bool:
      type: object
      properties:
        set:
          type: boolean
        value:
          type: boolean
  securitySchemes:
    API_Key:
      description: LangSmith API key (`lsv2_...`).
      type: apiKey
      name: X-Api-Key
      in: header
    Tenant_ID:
      description: Workspace (tenant) UUID the request operates in.
      type: apiKey
      name: X-Tenant-Id
      in: header
    Bearer_Auth:
      description: Session JWT, sent as `Bearer <token>`.
      type: apiKey
      name: Authorization
      in: header

````