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

# Post Thread Command

> Run a single v2 command on the thread and return its response envelope.

Uses a short-lived session (the run created by ``run.start`` executes on
the worker; the response returns before streaming begins).



## OpenAPI

````yaml /openapi.json post /threads/{thread_id}/commands
openapi: 3.1.0
info:
  title: Aegra
  description: Production-ready Agent Protocol server
  version: 0.9.24
servers: []
security: []
tags:
  - name: Assistants
    description: A configured instance of a graph.
  - name: Threads
    description: Accumulated state and outputs from a group of runs.
  - name: Thread Runs
    description: Invoke a graph on a thread, updating its persistent state.
  - name: Stateless Runs
    description: Invoke a graph without state or memory persistence.
  - name: Crons
    description: Scheduled recurring runs on a cron schedule.
  - name: Store
    description: Persistent key-value and semantic storage available from any thread.
  - name: Event Streaming
    description: Agent Protocol v2 thread event streaming and commands.
  - name: Health
    description: Server health checks and service information.
paths:
  /threads/{thread_id}/commands:
    post:
      tags:
        - Event Streaming
      summary: Post Thread Command
      description: |-
        Run a single v2 command on the thread and return its response envelope.

        Uses a short-lived session (the run created by ``run.start`` executes on
        the worker; the response returns before streaming begins).
      operationId: post_thread_command_threads__thread_id__commands_post
      parameters:
        - name: thread_id
          in: path
          required: true
          schema:
            type: string
            title: Thread Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ThreadCommand'
      responses:
        '200':
          description: Protocol response envelope (success or error)
          content:
            application/json:
              schema: {}
        '404':
          description: Thread owned by another user
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '503':
          description: v2 disabled by flag, or runtime too old for native v3 events
components:
  schemas:
    ThreadCommand:
      properties:
        id:
          type: integer
          title: Id
          description: Client-assigned command id, echoed in the response.
        method:
          type: string
          title: Method
          description: Command method, e.g. run.start or input.respond.
        params:
          additionalProperties: true
          type: object
          title: Params
          description: Method parameters.
      type: object
      required:
        - id
        - method
      title: ThreadCommand
      description: Body for ``POST /threads/{thread_id}/commands`` (JSON-RPC style).
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````