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

# Delete Context by ID

> This endpoint deletes a context (thread) and scrubs all associated data including messages, memories, and memory chunks for the given agent. Thread and task metadata is soft-deleted for audit purposes, while content columns are irreversibly overwritten.




## OpenAPI

````yaml /agentic/auto-generated-openapi.yml delete /agents/{id}/v1/contexts/{contextId}
openapi: 3.1.1
info:
  title: Corti Agent API
  version: 0.1.0
  description: >
    The Corti Agent API allows users to interact with the Corti Agent, enabling
    the creation and management of threads, sending messages, and receiving
    responses.
servers: []
security: []
paths:
  /agents/{id}/v1/contexts/{contextId}:
    delete:
      tags:
        - Agents
      summary: Delete Context by ID
      description: >
        This endpoint deletes a context (thread) and scrubs all associated data
        including messages, memories, and memory chunks for the given agent.
        Thread and task metadata is soft-deleted for audit purposes, while
        content columns are irreversibly overwritten.
      operationId: agents_delete_context
      parameters:
        - $ref: '#/components/parameters/Tenant-Name'
        - $ref: '#/components/parameters/AgentID'
        - name: contextId
          in: path
          required: true
          description: The identifier of the context (thread) to delete.
          schema:
            type: string
      responses:
        '204':
          description: Context deleted successfully.
        '400':
          description: >
            The request could not be processed, possibly due to missing required
            fields or invalid data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentsErrorResponse'
        '401':
          description: |
            Authentication is required to access this endpoint.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentsErrorResponse'
        '404':
          description: Agent or context not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentsErrorResponse'
components:
  parameters:
    Tenant-Name:
      name: Tenant-Name
      in: header
      description: >-
        Identifies a distinct entity within Corti's multi-tenant system. Ensures
        correct routing and authentication of the request.
      required: true
      example: base
      schema:
        type: string
        description: >-
          Identifies a distinct entity within Corti's multi-tenant system.
          Ensures correct routing and authentication of the request.
        example: base
    AgentID:
      name: id
      in: path
      required: true
      description: The identifier of the agent associated with the context.
      schema:
        type: string
        description: The identifier of the agent associated with the context.
        example: 12345678-90ab-cdef-gh12-34567890abc
  schemas:
    AgentsErrorResponse:
      type: object
      required:
        - code
        - description
      properties:
        code:
          type: string
          description: |
            A machine-readable error code that identifies the type of error.
        description:
          type: string
          description: >
            A human-readable description of the error, providing more context
            about what went wrong.
        howToFix:
          type: string
          description: |
            A human-readable message describing how to fix the issue.
        details:
          type: object
          description: |
            An optional object containing additional details about the error.
          additionalProperties: true
        cause:
          type: object
          description: >
            An optional object containing the cause of the error, following the
            same structure as the parent error response.
          additionalProperties: true

````