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

# Void a command

> Settles an organization-scoped command key. `VOIDED` prevents any later submission under that key; `WRITTEN` returns the intent already written. Waits for concurrent writes and returns the same outcome on retries. API keys need intent edit permission for the account environment; users need an admin role.



## OpenAPI

````yaml /api-reference/intents.openapi.json post /v1/intents/void
openapi: 3.1.0
info:
  title: intents
  description: ''
  license:
    name: ''
  version: 0.1.0
servers:
  - url: https://api.anthid.com
    description: Production
security: []
tags:
  - name: Intents
    description: >-
      Submit create, replace, and cancel commands, and void one that went
      unanswered
  - name: Intents
    description: Read retained intent actions and refused submissions
paths:
  /v1/intents/void:
    post:
      tags:
        - Intents
      summary: Void a command
      description: >-
        Settles an organization-scoped command key. `VOIDED` prevents any later
        submission under that key; `WRITTEN` returns the intent already written.
        Waits for concurrent writes and returns the same outcome on retries. API
        keys need intent edit permission for the account environment; users need
        an admin role.
      operationId: voidCommand
      requestBody:
        description: The trading account and the key of the command to void
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VoidCommandParams'
            example:
              idempotency_key: order-20260805-001-a3f
              intent_id: 0199f4d0-7c62-7a4a-9d1e-2b6f5c0a1e33
              trading_account_id: 550e8400-e29b-41d4-a716-446655440000
        required: true
      responses:
        '200':
          description: >-
            The key is settled. `VOIDED`: no command was or will be written
            under it. `WRITTEN`: the command was written before the void
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VoidCommandResponse'
              example:
                intent_id: 0199f4d0-7c62-7a4a-9d1e-2b6f5c0a1e33
                outcome: VOIDED
        '400':
          description: >-
            Request body is invalid, or the idempotency_key is empty or longer
            than 255 bytes
          content:
            application/json:
              schema:
                type: string
            text/plain:
              schema:
                type: string
        '401':
          description: >-
            Missing or invalid credentials, or missing intent edit permission
            for the account's environment or organization admin role, or missing
            organization context
          content:
            application/json:
              schema:
                type: string
        '404':
          description: Trading account is missing or belongs to another organization
          content:
            application/json:
              schema:
                type: string
        '413':
          description: Request body exceeds the size limit
          content:
            text/plain:
              schema:
                type: string
        '415':
          description: Content-Type must be application/json
          content:
            text/plain:
              schema:
                type: string
        '422':
          description: JSON does not match the request schema
          content:
            text/plain:
              schema:
                type: string
        '429':
          description: Caller exceeded the request rate limit
        '500':
          description: Server or upstream error. Retry to establish the outcome
          content:
            application/json:
              schema:
                type: string
      security:
        - apiKeyAuth: []
        - bearerAuth: []
components:
  schemas:
    VoidCommandParams:
      type: object
      description: |-
        A command to void: the key it was sent under, on the account it was for.

        For a caller whose command went unanswered. Voiding its key settles what
        became of it, for good: either the command was written, or it never will
        be.
      required:
        - trading_account_id
        - idempotency_key
      properties:
        idempotency_key:
          type: string
          description: The `Idempotency-Key` the command was submitted under.
        intent_id:
          type:
            - string
            - 'null'
          format: uuid
          description: |-
            The intent the command was on: the one a create named, or the one a
            replace or cancel referenced. Recorded with the void, never checked.
        trading_account_id:
          type: string
          format: uuid
          description: Trading account the command was for.
    VoidCommandResponse:
      type: object
      description: |-
        The answer to a void: final either way, however long the command's own
        write took.
      required:
        - outcome
      properties:
        intent_id:
          type:
            - string
            - 'null'
          format: uuid
          description: |-
            The written command's intent. For a voided key, the intent the void
            named, if it named one.
        outcome:
          $ref: '#/components/schemas/CommandOutcome'
    CommandOutcome:
      type: string
      description: What became of the command a void named.
      enum:
        - VOIDED
        - WRITTEN
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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