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

# Cancel a turn

> Cancel the turn a conversation is working on.

<Note>
Free. This call does not consume credits.
</Note>

A cancelled turn is free, and the conversation is `idle`, ready for another
message. Cancelling a conversation whose latest turn is already `cancelled`
returns it again. A conversation with no turn working, whether it completed,
failed or waits for input, answers `409 NO_ACTIVE_TURN`, and so does one whose
turn finishes while the call is made.



## OpenAPI

````yaml /api-ref/openapi.json post /agent/conversations/{conversationId}/cancel
openapi: 3.1.0
info:
  title: Specter API
  termsOfService: https://tryspecter.com/terms/
  contact:
    name: API support
    email: api-support@tryspecter.com
  version: 1.0.0
servers:
  - url: https://app.tryspecter.com/api/v1
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Enrich
    description: >-
      Look up a company, person, or investor and, if Specter does not already
      hold it, fetch it on demand. Includes email-based person enrichment.
  - name: Search
    description: Find records across every product from a single plain-English query.
  - name: Agent
    description: >-
      Start a conversation with the Specter Agent, send it messages, answer what
      it asks, and read or cancel its turns.
  - name: Companies
    description: >-
      Company profiles, funding, headcount, traction, the per-company signals
      and sub-resources attached to a single company, and identifier resolution.
  - name: People
    description: >-
      Specter people records: profile data, contact details, and per-person
      lookups for a known person ID.
  - name: Investors
    description: >-
      Specter investor records: profile, activity, targeting, funds, portfolio
      companies, and the funding rounds they have participated in.
  - name: Transactions
    description: 'Transaction detail by ID: funding rounds, acquisitions, and IPOs.'
  - name: Revenue Signals
    description: >-
      Revenue and profitability signals: by ID, by date, and for a saved list or
      company search.
  - name: Talent Signals
    description: 'Talent signals: by ID and in bulk by ID.'
  - name: Investor Interest Signals
    description: 'Investor interest signals: by ID and in bulk by ID.'
  - name: Company Lists
    description: Create, query, and maintain lists of companies, including their results.
  - name: Investor Lists
    description: Create, query, and maintain lists of investors, including their results.
  - name: People Lists
    description: Create, query, and maintain lists of people, including their results.
  - name: Saved Searches
    description: List and delete searches saved via tryspecter.com.
  - name: Company Saved Searches
    description: Details and results for saved company searches.
  - name: People Saved Searches
    description: Details and results for saved people searches.
  - name: Investor Saved Searches
    description: Details and results for saved investor searches.
  - name: Talent Signals Saved Searches
    description: Details and results for saved Talent Signals searches.
  - name: Investor Interest Saved Searches
    description: Details and results for saved Investor Interest Signals searches.
  - name: Funding Rounds Saved Searches
    description: Details and results for saved funding-round searches.
  - name: Acquisitions Saved Searches
    description: Details and results for saved acquisition searches.
  - name: IPOs Saved Searches
    description: Details and results for saved IPO searches.
  - name: Network
    description: >-
      Your team's LinkedIn network: the people and companies your teammates are
      connected to, and your reach into a given company.
  - name: Account
    description: >-
      Organisation-level resources: your team's members, API call logs, and
      credit balance.
paths:
  /agent/conversations/{conversationId}/cancel:
    post:
      tags:
        - Agent
      summary: Cancel a turn
      description: >-
        Cancel the turn a conversation is working on.


        <Note>

        Free. This call does not consume credits.

        </Note>


        A cancelled turn is free, and the conversation is `idle`, ready for
        another

        message. Cancelling a conversation whose latest turn is already
        `cancelled`

        returns it again. A conversation with no turn working, whether it
        completed,

        failed or waits for input, answers `409 NO_ACTIVE_TURN`, and so does one
        whose

        turn finishes while the call is made.
      operationId: cancelAgentTurn
      parameters:
        - name: conversationId
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: The ID of the agent conversation, from its `id`.
            examples:
              - 3f6c8f0e-2c1a-4b5e-9d7a-1b2c3d4e5f60
            title: Conversationid
          description: The ID of the agent conversation, from its `id`.
      responses:
        '200':
          description: The conversation, `idle`, with its turn `cancelled`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Conversation'
        '401':
          $ref: '#/components/responses/ApiKeyMissingOrApiKeyNotValid'
        '403':
          $ref: '#/components/responses/NotPermitted'
        '404':
          $ref: '#/components/responses/NotFound404_2'
        '409':
          $ref: '#/components/responses/NoApiUserOrNoActiveTurn'
        '422':
          $ref: '#/components/responses/ValidationFailed422'
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          $ref: '#/components/responses/KeyVerificationUnavailable'
components:
  schemas:
    Conversation:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: The conversation's ID. Pass it to the other conversation endpoints.
          examples:
            - 3f6c8f0e-2c1a-4b5e-9d7a-1b2c3d4e5f60
        state:
          $ref: '#/components/schemas/ConversationState'
          description: >-
            `working` while the latest turn is `queued` or `running`.
            `input_required` while it waits for you. `idle` once it has
            `completed`, `failed` or been `cancelled`: a conversation never
            reads as failed, and is ready for another message.
          examples:
            - idle
        turn:
          $ref: '#/components/schemas/Turn'
          description: >-
            The conversation's latest turn. Read an earlier one with [Get a
            turn](/api-reference/agent/get-a-turn).
        web_url:
          type: string
          title: Web Url
          description: >-
            A link to the conversation in the Specter web app. It opens for
            anyone who can see the conversation there.
          examples:
            - >-
              https://app.tryspecter.com/agent/3f6c8f0e-2c1a-4b5e-9d7a-1b2c3d4e5f60
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When the conversation started.
          examples:
            - '2026-12-01T09:30:00Z'
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: When the conversation last changed.
          examples:
            - '2026-12-01T09:30:48Z'
      type: object
      required:
        - id
        - state
        - turn
        - web_url
        - created_at
        - updated_at
      title: Conversation
      description: A conversation with the Specter Agent and its latest turn.
    ConversationState:
      type: string
      enum:
        - working
        - input_required
        - idle
      title: ConversationState
      description: >-
        What a conversation is doing. A failed or cancelled turn leaves it
        `idle`.
    Turn:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: >-
            The turn's ID. It does not change when the turn is answered after
            stopping for input.
          examples:
            - 9b1d7c52-6f0e-4a8b-8d3f-5e2a1c7b9d40
        status:
          $ref: '#/components/schemas/TurnStatus'
          description: >-
            `queued` and `running` mean the agent is still working. `completed`
            means it answered. `input_required` means the turn stopped for you,
            to approve a write it held or to answer a question: `input_requests`
            says what it waits for, and you answer through [Continue a
            conversation](/api-reference/agent/continue-a-conversation).
            `failed` and `cancelled` are final and free.
          examples:
            - completed
        message:
          type: string
          title: Message
          description: The message that started the turn.
          examples:
            - Which Berlin fintechs raised a Series A in the last year?
        answer:
          anyOf:
            - type: string
            - type: 'null'
          title: Answer
          description: >-
            The agent's reply in Markdown, with links to Specter pages. For a
            question it is the question. `null` until the turn is `completed` or
            `input_required`, and `null` for held writes the agent said nothing
            about.
          examples:
            - >-
              Three Berlin fintechs raised a Series A in the last year:
              [Hedgehog
              Payments](https://app.tryspecter.com/companies/5e3bc2b700c8f4c966ad2bbd).
        follow_ups:
          items:
            type: string
          type: array
          title: Follow Ups
          description: >-
            Up to three questions the agent suggests asking next. Empty when it
            has none.
          examples:
            - - Compare their funding
              - Who invested in them?
        input_requests:
          items:
            $ref: '#/components/schemas/AgentInputRequest'
          type: array
          title: Input Requests
          description: >-
            What the turn waits for when `status` is `input_required`: the
            writes it holds, or else its question. Empty in every other state,
            and once a later turn exists.
          examples:
            - []
        credits_used:
          anyOf:
            - type: integer
            - type: 'null'
          title: Credits Used
          description: >-
            Credits the turn cost, summed over the work it took, and 0 for a
            turn that failed or was cancelled before it cost anything. `null`
            while the turn is going: the cost is known only when it ends.
          examples:
            - 7
        error:
          anyOf:
            - $ref: '#/components/schemas/TurnError'
            - type: 'null'
          description: Why the turn failed. `null` unless `status` is `failed`.
          examples:
            - null
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When the turn started.
          examples:
            - '2026-12-01T09:30:00Z'
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completed At
          description: >-
            When the turn last stopped: it finished, failed, was cancelled, or
            is waiting for input. `null` while it is going.
          examples:
            - '2026-12-01T09:30:48Z'
      type: object
      required:
        - id
        - status
        - message
        - answer
        - follow_ups
        - input_requests
        - credits_used
        - error
        - created_at
        - completed_at
      title: Turn
      description: One message you sent and everything the agent did about it.
    ApiKeyMissing:
      properties:
        errorCode:
          type: string
          const: API_KEY_MISSING
          title: Errorcode
        message:
          type: string
          title: Message
          examples:
            - No API Key was presented on the header X-API-KEY
      type: object
      required:
        - errorCode
        - message
      title: ApiKeyMissing
    ApiKeyNotValid:
      properties:
        errorCode:
          type: string
          enum:
            - API_KEY_NOT_VALID
            - key_from_another_org
          title: Errorcode
          description: >-
            `key_from_another_org` when an `ak_` key was issued for an
            organization its owner no longer belongs to.
        message:
          type: string
          title: Message
          examples:
            - API key present, but not valid
      type: object
      required:
        - errorCode
        - message
      title: ApiKeyNotValid
    NotPermitted:
      properties:
        errorCode:
          type: string
          enum:
            - NOT_PERMITTED
            - user_suspended
            - api_access_not_granted
            - org_key_disabled
            - member_keys_disabled
            - member_keys_admins_only
          title: Errorcode
          description: >-
            `NOT_PERMITTED` for a team key; the other codes are the reasons an
            `ak_` key is refused.
        message:
          type: string
          title: Message
          examples:
            - API key present, but you are not permitted
      type: object
      required:
        - errorCode
        - message
      title: NotPermitted
    NotFound:
      properties:
        errorCode:
          type: string
          const: NOT_FOUND
          title: Errorcode
        message:
          type: string
          title: Message
          examples:
            - Not Found
      type: object
      required:
        - errorCode
        - message
      title: NotFound
    NoApiUser:
      properties:
        errorCode:
          type: string
          const: NO_API_USER
          title: Errorcode
        message:
          type: string
          title: Message
          examples:
            - >-
              Your organization's API user is not set up yet, so there is no
              owner for this item. Contact support.
      type: object
      required:
        - errorCode
        - message
      title: NoApiUser
    NoActiveTurn:
      properties:
        errorCode:
          type: string
          const: NO_ACTIVE_TURN
          title: Errorcode
        message:
          type: string
          title: Message
          examples:
            - This conversation has no turn in progress to cancel.
      type: object
      required:
        - errorCode
        - message
      title: NoActiveTurn
    ValidationFailed:
      properties:
        errorCode:
          type: string
          const: VALIDATION_ERROR
          title: Errorcode
        message:
          type: string
          title: Message
          description: >-
            Why the request was rejected: each invalid field, with the path to
            it.
          examples:
            - Field required (body.name)
      type: object
      required:
        - errorCode
        - message
      title: ValidationFailed
    RateLimited:
      properties:
        errorCode:
          type: string
          const: RATE_LIMITED
          title: Errorcode
        message:
          type: string
          title: Message
          examples:
            - You have been rate-limited
      type: object
      required:
        - errorCode
        - message
      title: RateLimited
    KeyVerificationUnavailable:
      properties:
        errorCode:
          type: string
          const: clerk_unavailable
          title: Errorcode
        message:
          type: string
          title: Message
          examples:
            - Key verification is temporarily unavailable
      type: object
      required:
        - errorCode
        - message
      title: KeyVerificationUnavailable
    TurnStatus:
      type: string
      enum:
        - queued
        - running
        - completed
        - input_required
        - failed
        - cancelled
      title: TurnStatus
      description: >-
        Where a turn stands. `queued` and `running` are in progress; the rest
        are final.
    AgentInputRequest:
      properties:
        id:
          type: string
          title: Id
          description: Identifies the request. Key your answer by it in `input_responses`.
          examples:
            - int-call_abc
        type:
          type: string
          enum:
            - approval
            - question
          title: Type
          description: >-
            `approval` asks you to approve a write the agent held. `question`
            asks you something.
          examples:
            - approval
            - question
        message:
          type: string
          title: Message
          description: What is asked, in a sentence fit to show a person.
          examples:
            - Create the list "Berlin fintech"?
            - Which of the two companies named Hedgehog do you mean?
        requested_schema:
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
          type: object
          title: Requested Schema
          description: >-
            A flat JSON Schema of the reply `content`. Empty for an approval.
            For a question, a `reply` string. The `content` of your answer must
            match this schema. The `enum` on `reply`, when present, lists the
            agent's suggested answers; any text is accepted.
          examples:
            - properties: {}
              type: object
            - properties:
                reply:
                  enum:
                    - The Berlin fintech
                    - The fintech in San Francisco
                  title: Your answer
                  type: string
              required:
                - reply
              type: object
        tool_call:
          anyOf:
            - $ref: '#/components/schemas/AgentToolCall'
            - type: 'null'
          description: For an `approval`, the write that is held. `null` for a question.
          examples:
            - arguments:
                name: Berlin fintech
                product_type: company
              name: create_list
            - null
      type: object
      required:
        - id
        - type
        - message
        - requested_schema
        - tool_call
      title: AgentInputRequest
      description: One thing a turn is waiting for, after an MCP elicitation request.
    TurnError:
      properties:
        code:
          type: string
          title: Code
          description: A stable code for why the turn failed.
          examples:
            - TURN_FAILED
        message:
          type: string
          title: Message
          description: What happened, in a sentence fit to show a person.
          examples:
            - >-
              The agent could not finish this request. The failed attempt was
              not charged; send the message again.
      type: object
      required:
        - code
        - message
      title: TurnError
    JsonValue: {}
    AgentToolCall:
      properties:
        name:
          type: string
          title: Name
          description: The tool the agent wants to call.
          examples:
            - create_list
        arguments:
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
          type: object
          title: Arguments
          description: The arguments it would call the tool with.
          examples:
            - name: Berlin fintech
              product_type: company
      type: object
      required:
        - name
        - arguments
      title: AgentToolCall
  responses:
    ApiKeyMissingOrApiKeyNotValid:
      description: Unauthorized
      content:
        application/json:
          schema:
            anyOf:
              - $ref: '#/components/schemas/ApiKeyMissing'
              - $ref: '#/components/schemas/ApiKeyNotValid'
    NotPermitted:
      description: Forbidden - There is no permissions to use the endpoint
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NotPermitted'
    NotFound404_2:
      description: >-
        Not Found - the conversation does not exist or was not started with the
        API.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NotFound'
    NoApiUserOrNoActiveTurn:
      description: >-
        Conflict - your organization has no API user yet (`NO_API_USER`), or the
        conversation has no turn working (`NO_ACTIVE_TURN`).
      content:
        application/json:
          schema:
            anyOf:
              - $ref: '#/components/schemas/NoApiUser'
              - $ref: '#/components/schemas/NoActiveTurn'
    ValidationFailed422:
      description: Validation Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationFailed'
    RateLimited:
      description: Too Many Requests - API Rate limit exceeded
      headers:
        X-RateLimit-Limit:
          description: The total rate limit allowed for this endpoint
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: The number of requests remaining
          schema:
            type: integer
        X-RateLimit-Reset:
          description: The number of seconds until the rate limit resets
          schema:
            type: number
            format: float
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimited'
    KeyVerificationUnavailable:
      description: >-
        Key verification is temporarily unavailable, so an `ak_` key could not
        be checked. Retry after the interval in `Retry-After`.
      headers:
        Retry-After:
          description: The number of seconds to wait before retrying
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/KeyVerificationUnavailable'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````

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