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

# Delete Run

> Delete a run record.

If the run is active (pending or running) and `force=0`, returns 409
Conflict. Set `force=1` to cancel the run first (best-effort) and then
delete it. Returns 204 No Content on success.



## OpenAPI

````yaml /openapi.json delete /threads/{thread_id}/runs/{run_id}
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}/runs/{run_id}:
    delete:
      tags:
        - Thread Runs
      summary: Delete Run
      description: |-
        Delete a run record.

        If the run is active (pending or running) and `force=0`, returns 409
        Conflict. Set `force=1` to cancel the run first (best-effort) and then
        delete it. Returns 204 No Content on success.
      operationId: delete_run_threads__thread_id__runs__run_id__delete
      parameters:
        - name: thread_id
          in: path
          required: true
          schema:
            type: string
            title: Thread Id
        - name: run_id
          in: path
          required: true
          schema:
            type: string
            title: Run Id
        - name: force
          in: query
          required: false
          schema:
            type: integer
            maximum: 1
            minimum: 0
            description: Set to 1 to cancel an active run before deleting it.
            default: 0
            title: Force
          description: Set to 1 to cancel an active run before deleting it.
      responses:
        '204':
          description: Successful Response
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentProtocolError'
        '409':
          description: Resource state conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentProtocolError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AgentProtocolError:
      properties:
        error:
          type: string
          title: Error
          description: Error type
        message:
          type: string
          title: Message
          description: Human-readable error message
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
          description: Additional error details
      type: object
      required:
        - error
        - message
      title: AgentProtocolError
      description: Standard Agent Protocol error response
    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

````