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

# List threads

> Recent active threads for the authenticated subject (direct) or workspace (relay). Capped at 30, newest first.




## OpenAPI

````yaml /openapi.yaml get /v1/loom/threads
openapi: 3.1.0
info:
  title: Patchwork API
  version: 1.0.0
  description: >
    Public data-plane API. Two products today: Identify (bare account
    resolution) and Loom (threads, runs, and outcomes). Every response is a JSON
    envelope — `status: success` with `data`, or `status: error` with `error`.
  contact:
    url: https://usepatchwork.co
servers:
  - url: https://api.usepatchwork.co
security:
  - bearerAuth: []
tags:
  - name: Identify
    description: Resolve an account or wallet to the institution and rails behind it.
  - name: Loom
    description: Threads, messages, runs, and outcomes for an embedded agent.
paths:
  /v1/loom/threads:
    get:
      tags:
        - Loom
      summary: List threads
      description: >
        Recent active threads for the authenticated subject (direct) or
        workspace (relay). Capped at 30, newest first.
      operationId: listThreads
      parameters:
        - $ref: '#/components/parameters/PatchworkSubject'
      responses:
        '200':
          description: Thread summaries.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeThreadList'
        '401':
          description: Missing or invalid credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    PatchworkSubject:
      name: Patchwork-Subject
      in: header
      required: false
      description: >
        Relay only. Opaque subject id for the acting user. Direct tokens carry
        `sub` instead — do not send this header on a session token.
      schema:
        type: string
  schemas:
    EnvelopeThreadList:
      type: object
      required:
        - status
        - data
      properties:
        status:
          type: string
          const: success
        data:
          type: array
          items:
            $ref: '#/components/schemas/Thread'
    Error:
      type: object
      required:
        - status
        - error
      properties:
        status:
          type: string
          const: error
        error:
          type: object
          required:
            - message
            - code
          properties:
            message:
              type: string
              description: Human-readable explanation.
            code:
              type: string
              description: Stable machine-readable code.
            details:
              description: Optional extra context.
    Thread:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          format: uuid
        title:
          type: string
        subject_ref:
          type: string
          description: Acting user. From the token `sub` (direct) or the request (relay).
        agent:
          type: object
          properties:
            name:
              type: string
        message_count:
          type: integer
        last_message:
          type: object
          properties:
            role:
              type: string
            content:
              type: string
            created_at:
              type: string
              format: date-time
        pending_elicitation:
          description: Present when a run is waiting for user input.
          type: object
          properties:
            run_id:
              type: string
              format: uuid
            kind:
              type: string
            prompt:
              type: object
        pending_action:
          description: Present when a run is waiting for an approval outcome.
          type: object
          properties:
            run_id:
              type: string
              format: uuid
            tool_call_id:
              type: string
              format: uuid
            patch_ref:
              type: string
            args:
              type: object
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        Identify accepts a workspace API key (`sk_…`). Loom accepts either a
        short-lived session token (direct) or a workspace API key (relay).

````