> ## 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.

> ## Agent Instructions
> To integrate AGG, start with Quickstart: REST (https://docs.agg.market/quickstart/rest), then Order lifecycle & statuses (https://docs.agg.market/concepts/order-lifecycle).
> Track every trade until it reaches a terminal status. Before retrying a failed or timed-out call, read Errors, retries & idempotency (https://docs.agg.market/concepts/errors).
> The API reference is generated from https://docs.agg.market/openapi/openapi.json.

# Submit signatures for a pending self-custody fill

> Accepts client-produced signatures for a self-custodial fill. POST /execution/fill never returns the payloads to sign directly — signature requests are produced asynchronously, after the fill response is sent. Poll GET /execution/status for `pendingSignatures` instead, sign each payload, then submit them here. Returns the next batch (empty when done).



## OpenAPI

````yaml /openapi/openapi.json post /execution/fill/{quoteId}/signatures
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
security: []
tags:
  - name: Authentication
    description: Sign users in and manage their session tokens.
  - name: Markets
    description: Find events, markets and outcomes to trade.
  - name: Market Data
    description: Live orderbooks, prices, charts and scores for those markets.
  - name: Trading
    description: Quote, place, sign, track and cancel orders.
  - name: Portfolio
    description: A user's orders, positions, balances and activity.
  - name: Funding
    description: Deposit addresses, withdrawals, balance refills and fiat on-ramp.
  - name: Users
    description: The signed-in user's profile, linked accounts, KYC and venue keys.
  - name: Hosted Venue Accounts
    description: Provision, fund and withdraw from venue accounts hosted for the user.
  - name: Webhooks
    description: Configure and operate webhook delivery to your server.
  - name: Partner Admin
    description: Server-side reads across your app's users, orders and analytics.
  - name: Paper Trading
    description: Simulated accounts and orders for testing without real funds.
  - name: News
    description: News feeds linked to markets.
  - name: Correlated Markets
    description: Markets related to a given market and the effect of its resolution.
paths:
  /execution/fill/{quoteId}/signatures:
    post:
      tags:
        - Trading
      summary: Submit signatures for a pending self-custody fill
      description: >-
        Accepts client-produced signatures for a self-custodial fill. POST
        /execution/fill never returns the payloads to sign directly — signature
        requests are produced asynchronously, after the fill response is sent.
        Poll GET /execution/status for `pendingSignatures` instead, sign each
        payload, then submit them here. Returns the next batch (empty when
        done).
      operationId: submitFillSignatures
      parameters:
        - name: quoteId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - signatures
              properties:
                signatures:
                  minItems: 1
                  maxItems: 32
                  type: array
                  items:
                    type: object
                    required:
                      - stepId
                    properties:
                      stepId:
                        minLength: 1
                        maxLength: 128
                        description: >-
                          `stepId` of the pendingSignatures entry being
                          answered.
                        type: string
                      signature:
                        minLength: 1
                        maxLength: 2048
                        description: >-
                          0x-prefixed hex signature. Send this for every `type`
                          except `transaction`.
                        type: string
                      txHash:
                        minLength: 66
                        maxLength: 66
                        description: >-
                          0x-prefixed 32-byte hash of the transaction you
                          broadcast. Send this, and only this, for `type:
                          "transaction"`. Exactly one of `signature` and
                          `txHash` is required.
                        type: string
            example:
              signatures:
                - stepId: polymarket-order-cmf3r1a2b00c4mw0lq8y7e3uj
                  signature: >-
                    0x5d2c8f1a4e7b0d3c6f9a2e5b8d1c4f7a0e3b6d9c2f5a8e1b4d7c0f3a6e9b2d5c8f1a4e7b0d3c6f9a2e5b8d1c4f7a0e3b6d9c2f5a8e1b4d7c0f3a6e9b2d5c8f1a1b
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FillResponse'
              example:
                quoteId: k2r8v5n1x7c4m9t3b6q0w2za
                orderIds:
                  - cmf3r1a2b00c4mw0lq8y7e3uj
                  - cmf3r1a3c00c5mw0lt2k9w6nd
                status: pending
        '400':
          description: '400'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: '401'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '403':
          description: '403'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: '404'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '409':
          description: '409'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - appId: []
          bearerAuth: []
components:
  schemas:
    FillResponse:
      type: object
      required:
        - quoteId
        - orderIds
        - status
      properties:
        alreadyAccepted:
          description: >-
            `true` when this quote was already accepted; the call had no new
            effect.
          type: boolean
        quoteId:
          description: The quote being filled. Poll GET /execution/status with it.
          type: string
        orderIds:
          description: >-
            Orders created for the fill, including tracking orders for shares
            redeemed instead of sold.
          type: array
          items:
            type: string
        status:
          description: >-
            Always `pending`: accepted, not yet executed. Poll GET
            /execution/status.
          type: string
          enum:
            - pending
        redeemId:
          description: >-
            Present when a sell quote includes resolved shares that are redeemed
            rather than sold.
          type: string
        message:
          description: Readable note about redemption, when relevant.
          type: string
        pendingSignatures:
          description: >-
            Self-custody only: requests the user's wallet must sign before
            execution continues. Absent for managed custody. Answer them on POST
            /execution/fill/{quoteId}/signatures.
          type: array
          items:
            $ref: '#/components/schemas/PendingSignature'
    ErrorMessage:
      type: object
      required:
        - message
      properties:
        message:
          type: string
    PendingSignature:
      description: >-
        One request the user's wallet must sign (or send) before execution
        continues.
      type: object
      required:
        - stepId
        - type
        - venue
        - signerAddress
        - payload
        - expiresAt
      properties:
        stepId:
          description: >-
            Id of the execution step waiting on this request. Send it back
            verbatim.
          type: string
        type:
          $ref: '#/components/schemas/SignatureRequestType'
        venue:
          description: >-
            Who the request is for. Open set: usually a venue (`polymarket`,
            `hyperliquid`); `relay` for a bridge transfer and `referral` for a
            referral payout.
          type: string
        signerAddress:
          description: >-
            Address that must sign (or send) this request. For Hyperliquid it
            may be the user's approved agent address.
          type: string
        chainId:
          description: >-
            Chain the request is for, when set. Often absent: read the chain
            from `payload.domain.chainId` or `payload.chainId`.
          type: number
        payload:
          description: >-
            The data to sign or send, verbatim. Shape depends on `type`:
            `eip712`: viem-style typed data `{ domain, types, primaryType,
            message }`; sign it with signTypedData. `personal_sign`: either a
            string message, or `{ raw: "0x…" }` meaning sign those raw bytes
            (`signMessage({ message: { raw } })`). `transaction`: `{ chainId,
            to, value, data }` where `chainId` is a decimal string, `value` a
            decimal wei string and `data` hex; broadcast it from `signerAddress`
            and return `txHash`. `hl_l1_action`: EIP-712 typed data for a
            Hyperliquid action (primary type `Agent`, chainId 1337); sign with
            signTypedData. `eip7702_authorization`: `{ contractAddress, chainId,
            nonce }` (numbers for `chainId` and `nonce`); sign the EIP-7702
            authorization for them. `safe_tx`: `{ domain, types, primaryType:
            "SafeTx", message, safeTxHash }`; sign the raw 32-byte `safeTxHash`
            with personal_sign (`signMessage({ message: { raw: safeTxHash }
            })`), not with signTypedData.
        expiresAt:
          description: >-
            ISO-8601. After this the request is void and the trade must be
            re-quoted.
          type: string
        purpose:
          description: >-
            Why the request is asked for, when known; for display and routing
            only. Open set. Known values: `funding`, `funding_and_fee`, `fee` (a
            self-custody funding batch), `app_fee` (the app fee),
            `referral_payout` (an app-paid referral, signed by
            `referralPayerAddress`; read `type`, it is a `transaction` on EVM
            chains and an `eip712` on HyperCore), `hl_referral` (a partner
            referral code for the user's Hyperliquid account; see `optional`).
          type: string
        optional:
          description: >-
            `true` when the trade proceeds without this request, e.g. `purpose:
            "hl_referral"`. If your signer declines it, skip it and submit the
            rest.
          type: boolean
    SignatureRequestType:
      description: >-
        What to do with `payload`. `eip712`: sign typed data. `personal_sign`:
        sign a message (EIP-191). `transaction`: broadcast a transaction and
        return its hash. `solana_transaction`: sign a Solana transaction (not
        currently issued). `hl_l1_action`: sign a Hyperliquid action's typed
        data. `eip7702_authorization`: sign an EIP-7702 authorization (a raw
        digest many wallets cannot produce; if yours cannot, fill with
        `approveMode: "user_broadcast"` instead of throwing). `safe_tx`: a
        Polymarket Safe transaction; see `payload`.
      type: string
      enum:
        - eip712
        - personal_sign
        - transaction
        - solana_transaction
        - hl_l1_action
        - eip7702_authorization
        - safe_tx
  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.

````