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

# Cancel an order

> Cancels one of your open (`wait`) orders and refunds unmatched
collateral. Same route for custodial and non-custodial resting
orders — non-custodial placement is via Atlas; once resting, cancel
is here. Terminal orders return 422.



## OpenAPI

````yaml /api-reference/openapi/calibri.yaml post /api/v2/pythia/orders/{id}/cancel
openapi: 3.1.0
info:
  title: Calibri API
  version: 1.0.0
  description: >-
    The Calibri API. Discover markets, read live books, place signed orders, and
    manage positions and account data.

    Routed by path prefix to the service that answers it — which is an
    implementation detail, not something a caller has to reason about.
servers:
  - description: Production
    url: https://calibri.io
security: []
tags:
  - name: Health
    description: Service liveness.
    x-displayName: Health
  - name: Events
    description: Discover events and their metadata.
    x-displayName: Events
  - name: Markets
    description: List markets and load market detail for trading.
    x-displayName: Markets
  - name: Series
    description: Recurring event series.
    x-displayName: Series
  - name: Tags
    description: Editorial shelves used to browse the catalogue.
    x-displayName: Tags
  - name: Market Data
    description: Order book, depth, trade tape, tickers, and candles.
    x-displayName: Market Data
  - name: Assets
    description: Underlying asset price history for price-feed markets.
    x-displayName: Assets
  - name: Community
    description: Leaderboard and platform activity.
    x-displayName: Community
  - name: Currencies
    description: Currency registry.
    x-displayName: Currencies
  - name: Trade
    description: Place, list, and cancel orders.
    x-displayName: Trade
  - name: Positions
    description: Your matched contracts.
    x-displayName: Positions
  - name: Wallet
    description: Self-custody Safe, passkey, session keys, and relay.
    x-displayName: Wallet
  - name: Rewards
    description: Maker rebates and referral earnings.
    x-displayName: Rewards
  - name: Account
    description: Balances, ledger, PnL, limits, preferences, and profile.
    x-displayName: Account
  - name: Categories
    description: Categories
    x-displayName: Categories
  - name: Other
    description: Other
    x-displayName: Other
externalDocs:
  description: ''
  url: ''
paths:
  /api/v2/pythia/orders/{id}/cancel:
    post:
      tags:
        - Trade
      summary: Cancel an order
      description: |-
        Cancels one of your open (`wait`) orders and refunds unmatched
        collateral. Same route for custodial and non-custodial resting
        orders — non-custodial placement is via Atlas; once resting, cancel
        is here. Terminal orders return 422.
      parameters:
        - description: Order id
          in: path
          name: id
          required: true
          schema:
            type: integer
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderCancelResult'
          description: Accepted
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Entity
      security:
        - apiKey: []
components:
  schemas:
    OrderCancelResult:
      properties:
        id:
          example: 1420
          type: integer
        state:
          enum:
            - cancel
          example: cancel
          type: string
      type: object
    ErrorResponse:
      properties:
        errors:
          description: Match on the code, not the HTTP status or any human text.
          example:
            - order.not_found
          items:
            type: string
          type: array
          uniqueItems: false
      type: object
  securitySchemes:
    apiKey:
      description: >-
        HMAC-signed API key. Send X-Auth-Apikey, X-Auth-Nonce and
        X-Auth-Signature.
      in: header
      name: X-Auth-Apikey
      type: apiKey

````

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