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

# Withdraw funds

> Withdraws funds to an external address and returns submitted transfer details.



## OpenAPI

````yaml /openapi/openapi.json post /execution/withdraw
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/withdraw:
    post:
      tags:
        - Execution
      summary: Withdraw funds
      description: >-
        Withdraws funds to an external address and returns submitted transfer
        details.
      operationId: withdrawManaged
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - amountRaw
                - tokenSymbol
                - destinationAddress
                - destinationChainId
              properties:
                amountRaw:
                  pattern: ^[1-9][0-9]*$
                  description: Positive integer string in the token's native decimals.
                  type: string
                tokenSymbol:
                  description: Stable-coin symbol the withdrawal is denominated in.
                  type: string
                  enum:
                    - USDC
                    - USDC.e
                    - USDT
                destinationAddress:
                  pattern: ^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$
                  description: >-
                    Recipient address. EVM destinations: 0x-prefixed 20-byte
                    hex. Solana: base58 (32–44 chars).
                  type: string
                destinationChainId:
                  minimum: 1
                  description: Chain ID where the recipient address should receive funds.
                  type: integer
                max:
                  description: Cap to the deliverable maximum (withdraw-max intent).
                  type: boolean
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                required:
                  - withdrawalId
                  - status
                  - requested
                  - completedAmountRaw
                  - destination
                  - legs
                  - expected
                  - pricingStatus
                  - errorMessage
                  - sources
                properties:
                  withdrawalId:
                    type: string
                  status:
                    description: >-
                      DB-backed withdrawal status. Mirrors the WithdrawalStatus
                      Prisma enum.
                    type: string
                    enum:
                      - pending
                      - bridging
                      - transferring
                      - completed
                      - partial
                      - failed
                  requested:
                    type: object
                    required:
                      - tokenSymbol
                      - amountRaw
                    properties:
                      tokenSymbol:
                        description: Stable-coin symbol the withdrawal is denominated in.
                        type: string
                        enum:
                          - USDC
                          - USDC.e
                          - USDT
                      amountRaw:
                        pattern: ^[1-9][0-9]*$
                        type: string
                  completedAmountRaw:
                    type: string
                    nullable: true
                  destination:
                    type: object
                    required:
                      - chainId
                      - address
                      - tokenSymbol
                    properties:
                      chainId:
                        minimum: 1
                        type: integer
                      address:
                        pattern: ^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$
                        type: string
                      tokenSymbol:
                        description: Stable-coin symbol the withdrawal is denominated in.
                        type: string
                        enum:
                          - USDC
                          - USDC.e
                          - USDT
                  legs:
                    type: array
                    items:
                      type: object
                      required:
                        - type
                        - status
                        - sourceChainId
                        - destChainId
                        - amountRaw
                        - txHash
                        - bridgeOperationId
                      properties:
                        type:
                          description: >-
                            transfer: same-chain managed-wallet → recipient.
                            bridge: cross-chain via Relay.
                          type: string
                          enum:
                            - transfer
                            - bridge
                        status:
                          description: >-
                            PR-A only emits 'planned'; lifecycle pipeline
                            advances downstream.
                          type: string
                          enum:
                            - planned
                            - submitted
                            - confirmed
                            - failed
                        sourceChainId:
                          type: integer
                        destChainId:
                          type: integer
                        amountRaw:
                          pattern: ^[1-9][0-9]*$
                          type: string
                        txHash:
                          type: string
                          nullable: true
                        bridgeOperationId:
                          type: string
                          nullable: true
                        sourceTokenSymbol:
                          type: string
                        errorMessage:
                          type: string
                          nullable: true
                  expected:
                    type: object
                    required:
                      - outputRaw
                      - feeRaw
                      - etaSeconds
                    properties:
                      outputRaw:
                        type: string
                        nullable: true
                      feeRaw:
                        type: string
                        nullable: true
                      etaSeconds:
                        type: integer
                        nullable: true
                  pricingStatus:
                    description: >-
                      Withdrawal pricing state. 'quoted' rows have a fresh
                      preflight quote; 'unviable' means at least one source leg
                      is too small for required fees.
                    type: string
                    enum:
                      - unquoted
                      - quoting
                      - quoted
                      - unviable
                  errorMessage:
                    type: string
                    nullable: true
                  sources:
                    type: array
                    items:
                      type: object
                      required:
                        - sourceId
                        - chainId
                        - tokenSymbol
                        - tokenAddress
                        - decimals
                        - amountRaw
                        - status
                        - txHash
                        - bridgeOperationId
                      properties:
                        sourceId:
                          type: string
                        chainId:
                          type: integer
                        tokenSymbol:
                          description: >-
                            Stable-coin symbol held by a selected withdrawal
                            source.
                          type: string
                          enum:
                            - USDC
                            - USDC.e
                            - USDT
                            - pUSD
                            - USD1
                        tokenAddress:
                          pattern: ^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$
                          description: >-
                            Source token address: EVM ERC-20 address or Solana
                            SPL mint.
                          type: string
                        decimals:
                          minimum: 0
                          maximum: 36
                          type: integer
                        amountRaw:
                          pattern: ^[1-9][0-9]*$
                          type: string
                        status:
                          description: >-
                            Per-source progression. PR-A only emits 'pending';
                            PR-B/PR-C drive transitions.
                          type: string
                          enum:
                            - pending
                            - submitted
                            - confirmed
                            - failed
                        txHash:
                          type: string
                          nullable: true
                        bridgeOperationId:
                          type: string
                          nullable: true
        '400':
          description: '400'
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
        '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
      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.

````