> ## 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 hosted venue funds

> Submits one explicit-amount Solana USDC withdrawal under a caller-owned idempotency key. Agg durably records the exact request before dispatch. An ambiguous provider result is retained for manual review and is never automatically replayed.



## OpenAPI

````yaml /openapi/openapi.json post /users/me/venue-accounts/{venue}/withdrawals
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:
  /users/me/venue-accounts/{venue}/withdrawals:
    post:
      tags:
        - Users
      summary: Withdraw hosted venue funds
      description: >-
        Submits one explicit-amount Solana USDC withdrawal under a caller-owned
        idempotency key. Agg durably records the exact request before dispatch.
        An ambiguous provider result is retained for manual review and is never
        automatically replayed.
      operationId: createHostedVenueWithdrawal
      parameters:
        - name: venue
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - mode
                - requestId
                - amountRaw
                - destinationAddress
              properties:
                mode:
                  type: string
                  enum:
                    - live
                requestId:
                  pattern: >-
                    ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
                  type: string
                amountRaw:
                  pattern: ^[1-9][0-9]{0,31}$
                  type: string
                destinationAddress:
                  minLength: 32
                  maxLength: 44
                  pattern: ^[1-9A-HJ-NP-Za-km-z]+$
                  type: string
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - id
                  - venue
                  - accountId
                  - environment
                  - asset
                  - decimals
                  - network
                  - amountRaw
                  - destinationAddress
                  - status
                  - createdAt
                  - updatedAt
                properties:
                  id:
                    type: string
                  venue:
                    type: string
                    enum:
                      - betdex
                  accountId:
                    type: string
                  environment:
                    type: string
                    enum:
                      - sandbox
                      - production
                  asset:
                    type: string
                    enum:
                      - USDC
                  decimals:
                    type: number
                    enum:
                      - 6
                  network:
                    type: string
                    enum:
                      - solana
                  amountRaw:
                    pattern: ^[1-9][0-9]{0,31}$
                    type: string
                  destinationAddress:
                    minLength: 32
                    maxLength: 44
                    pattern: ^[1-9A-HJ-NP-Za-km-z]+$
                    type: string
                  status:
                    type: string
                    enum:
                      - processing
                      - confirmed
                      - failed
                      - flagged
                      - review_required
                  createdAt:
                    format: date-time
                    type: string
                  updatedAt:
                    format: date-time
                    type: string
        '202':
          description: '202'
          content:
            application/json:
              schema:
                additionalProperties: false
                type: object
                required:
                  - id
                  - venue
                  - accountId
                  - environment
                  - asset
                  - decimals
                  - network
                  - amountRaw
                  - destinationAddress
                  - status
                  - createdAt
                  - updatedAt
                properties:
                  id:
                    type: string
                  venue:
                    type: string
                    enum:
                      - betdex
                  accountId:
                    type: string
                  environment:
                    type: string
                    enum:
                      - sandbox
                      - production
                  asset:
                    type: string
                    enum:
                      - USDC
                  decimals:
                    type: number
                    enum:
                      - 6
                  network:
                    type: string
                    enum:
                      - solana
                  amountRaw:
                    pattern: ^[1-9][0-9]{0,31}$
                    type: string
                  destinationAddress:
                    minLength: 32
                    maxLength: 44
                    pattern: ^[1-9A-HJ-NP-Za-km-z]+$
                    type: string
                  status:
                    type: string
                    enum:
                      - processing
                      - confirmed
                      - failed
                      - flagged
                      - review_required
                  createdAt:
                    format: date-time
                    type: string
                  updatedAt:
                    format: date-time
                    type: string
        '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
        '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
        '503':
          description: '503'
          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.

````