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

# CancelInvocationAPI mirrors the erdo_cancel_thread_invocation MCP tool.


> The body sets exactly one selector: active (stop what the thread is running now, with its child runs), run\_id (one root run from the runs API, running or queued), invocation\_id (one invocation, refused with FailedPrecondition when the thread has moved on) or all\_queued (drop every queued message). Success acknowledges delivery; callers must read each run for terminal state.




## OpenAPI

````yaml /api/openapi.json post /v1/threads/{threadID}/cancel-invocation
openapi: 3.0.0
info:
  title: Erdo API
  description: >-
    Erdo's REST API: query and write datasets, run agents, manage threads,
    integrations, pages, evals, workstreams, experiments, and bounded outreach.
    Authenticate with a Bearer API key (erdo_api_...) or scoped token
    (erdo_token_...).
  version: '2026-11-21'
servers:
  - url: https://api.erdo.ai
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/threads/{threadID}/cancel-invocation:
    post:
      summary: |
        CancelInvocationAPI mirrors the erdo_cancel_thread_invocation MCP tool.
      description: >
        The body sets exactly one selector: active (stop what the thread is
        running now, with its child runs), run\_id (one root run from the runs
        API, running or queued), invocation\_id (one invocation, refused with
        FailedPrecondition when the thread has moved on) or all\_queued (drop
        every queued message). Success acknowledges delivery; callers must read
        each run for terminal state.
      operationId: POST:mcp.CancelInvocationAPI
      parameters:
        - allowEmptyValue: true
          explode: false
          in: path
          name: threadID
          required: true
          schema:
            type: string
          style: simple
      requestBody:
        content:
          application/json:
            schema:
              properties:
                active:
                  type: boolean
                all_queued:
                  type: boolean
                invocation_id:
                  type: string
                run_id:
                  type: string
              type: object
              required:
                - invocation_id
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  cancelled:
                    items:
                      $ref: '#/components/schemas/thread.CancelledInvocation'
                    type: array
                  success:
                    type: boolean
                type: object
          description: Success response
        default:
          $ref: '#/components/responses/APIError'
components:
  schemas:
    thread.CancelledInvocation:
      properties:
        invocation_id:
          format: uuid
          type: string
        queued:
          title: >
            Queued marks a turn that had not started: it is dropped from the
            queue.
          type: boolean
        run_id:
          format: uuid
          type: string
      title: |
        CancelledInvocation is one invocation a cancel request targeted.
      type: object
  responses:
    APIError:
      content:
        application/json:
          schema:
            externalDocs:
              url: https://pkg.go.dev/encore.dev/beta/errs#Error
            properties:
              code:
                description: Error code
                example: not_found
                externalDocs:
                  url: https://pkg.go.dev/encore.dev/beta/errs#ErrCode
                type: string
              details:
                description: Error details
                type: object
              message:
                description: Error message
                type: string
            title: APIError
            type: object
      description: Error response
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: An Erdo API key (erdo_api_...) or scoped token (erdo_token_...).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.