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

# Cancel an order

> Deprecated: use POST /execution/orders/cancel with { orderId }. For Hyperliquid self-custody, cancelSignature carries venue, the single-order cancel action, a fresh millisecond nonce and its r/s/v signature from the EOA or approved client-held agg agent. For Polymarket, it carries a ClobAuth signature and timestamp. Cancels a queued managed order or an active open limit order. Terminal orders cannot be cancelled. A self-custody limit order that has already been submitted to the venue needs `cancelSignature` from its signing wallet; without it the call returns 409 and the order is unchanged. One whose submission has not started yet can be cancelled without a signature. A 200 response carrying `status: "cancel_pending"` for a self-custody order is not final: continue polling while AGG reconciles venue state. An order whose submission is already in progress also returns 409 — retry once it is open.



## OpenAPI

````yaml /openapi/openapi.json post /execution/orders/{orderId}/cancel
openapi: 3.0.2
info:
  title: AGG API
  version: 1.0.0
  description: >-
    Prediction market aggregator REST API — authentication, users, venue events,
    venue markets, orderbooks, charts, and execution workflows.
servers:
  - url: https://api.agg.market
    description: Production
  - url: https://api.staging.agg.market
    description: Staging
security: []
paths:
  /execution/orders/{orderId}/cancel:
    post:
      tags:
        - Execution
      summary: Cancel an order
      description: >-
        Deprecated: use POST /execution/orders/cancel with { orderId }. For
        Hyperliquid self-custody, cancelSignature carries venue, the
        single-order cancel action, a fresh millisecond nonce and its r/s/v
        signature from the EOA or approved client-held agg agent. For
        Polymarket, it carries a ClobAuth signature and timestamp. Cancels a
        queued managed order or an active open limit order. Terminal orders
        cannot be cancelled. A self-custody limit order that has already been
        submitted to the venue needs `cancelSignature` from its signing wallet;
        without it the call returns 409 and the order is unchanged. One whose
        submission has not started yet can be cancelled without a signature. A
        200 response carrying `status: "cancel_pending"` for a self-custody
        order is not final: continue polling while AGG reconciles venue state.
        An order whose submission is already in progress also returns 409 —
        retry once it is open.
      operationId: cancelManagedOrder
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                cancelSignature:
                  anyOf:
                    - additionalProperties: false
                      description: >-
                        Self-custody Polymarket limit orders only; omit it for
                        managed orders. An EIP-712 signature by the order's
                        signing wallet (the `signingAddress` the order was
                        placed with) over Polymarket's CLOB L1 auth message:
                        domain `{ name: "ClobAuthDomain", version: "1", chainId:
                        137 }`, primary type `ClobAuth` with fields `address`
                        (address), `timestamp` (string), `nonce` (uint256),
                        `message` (string), where `address` is the signing
                        wallet, `timestamp` is the `timestamp` below encoded as
                        a decimal string, `nonce` is 0, and `message` is "This
                        message attests that I control the given wallet". Ask
                        the user to sign when they cancel. The signature is
                        never persisted or logged. The CLOB credentials derived
                        from it are used only for this request and are not
                        stored.
                      type: object
                      required:
                        - signature
                        - timestamp
                      properties:
                        signature:
                          pattern: ^0x[0-9a-fA-F]{130}$
                          description: A 65-byte hex signature (`0x` + 130 hex characters).
                          type: string
                        timestamp:
                          minimum: 0
                          description: >-
                            Unix seconds — the value that was signed. Use the
                            current time. Rejected if more than 480 seconds in
                            the future; Polymarket rejects one older than about
                            two minutes.
                          type: integer
                    - additionalProperties: false
                      description: >-
                        Hyperliquid cancellation signed by the linked EOA or its
                        currently approved agg agent. Sign the single-order
                        cancel action using the Hyperliquid L1 action signer,
                        with nonce Date.now(). The asset and order ID must match
                        this order. Never send the private key.
                      type: object
                      required:
                        - venue
                        - action
                        - nonce
                        - signature
                      properties:
                        venue:
                          type: string
                          enum:
                            - hyperliquid
                        action:
                          additionalProperties: false
                          type: object
                          required:
                            - type
                            - cancels
                          properties:
                            type:
                              type: string
                              enum:
                                - cancel
                            cancels:
                              minItems: 1
                              maxItems: 1
                              type: array
                              items:
                                additionalProperties: false
                                type: object
                                required:
                                  - a
                                  - o
                                properties:
                                  a:
                                    minimum: 0
                                    maximum: 9007199254740991
                                    type: integer
                                  o:
                                    minimum: 1
                                    maximum: 9007199254740991
                                    type: integer
                        nonce:
                          minimum: 1
                          maximum: 9007199254740991
                          type: integer
                        signature:
                          additionalProperties: false
                          type: object
                          required:
                            - r
                            - s
                            - v
                          properties:
                            r:
                              pattern: ^0x[0-9a-fA-F]{64}$
                              type: string
                            s:
                              pattern: ^0x[0-9a-fA-F]{64}$
                              type: string
                            v:
                              type: number
                              enum:
                                - 27
                                - 28
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                required:
                  - quoteId
                  - orderIds
                  - status
                properties:
                  quoteId:
                    type: string
                    nullable: true
                  orderIds:
                    type: array
                    items:
                      type: string
                  status:
                    type: string
                    enum:
                      - cancelled
                      - cancel_pending
        '401':
          description: '401'
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
        '403':
          description: '403'
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
        '404':
          description: '404'
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
        '409':
          description: '409'
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
      deprecated: true
      security:
        - appId: []
          bearerAuth: []
components:
  securitySchemes:
    appId:
      type: apiKey
      in: header
      name: x-app-id
      description: Your application ID. Required for all app-tier and user-tier routes.
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT access token returned by POST /auth/verify. Required for user-tier
        routes.

````