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

# Withdraw

> Withdraws the user's Polymarket proxy-wallet collateral to an arbitrary `dstWalletAddress`. Optional `dstToken` swaps the proxy collateral into a different token (and/or chain) before delivery.

Unlike `/withdrawToEoa`, this endpoint **always requires** an EIP-712 `signatureByEvmEoa` produced by the user's EOA over `{ dstToken, dstWalletAddress, expiration }` — see the [Polymarket Signing Guide](../polymarket-signing). The signature is what authorizes funds being sent to a wallet other than the EOA.

The endpoint awaits successful execution of the withdrawal transaction before returning the transaction hash.



## OpenAPI

````yaml /swap-api-reference/openapi.json post /workflows/polymarket/withdraw
openapi: 3.1.0
info:
  title: Swaps API
  description: >-
    The Swaps API provides instant cross-chain swap and bridge functionality for
    decentralized applications.

    It supports multiple virtual machines (EVM, Solana, Bitcoin) and various DEX
    protocols and bridge solutions.
  version: 3.0.0
  contact:
    name: Swaps.xyz
    url: https://swaps.xyz
servers:
  - url: https://api-v2.swaps.xyz/api
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /workflows/polymarket/withdraw:
    post:
      tags:
        - Polymarket
      summary: Withdraw
      description: >-
        Withdraws the user's Polymarket proxy-wallet collateral to an arbitrary
        `dstWalletAddress`. Optional `dstToken` swaps the proxy collateral into
        a different token (and/or chain) before delivery.


        Unlike `/withdrawToEoa`, this endpoint **always requires** an EIP-712
        `signatureByEvmEoa` produced by the user's EOA over `{ dstToken,
        dstWalletAddress, expiration }` — see the [Polymarket Signing
        Guide](../polymarket-signing). The signature is what authorizes funds
        being sent to a wallet other than the EOA.


        The endpoint awaits successful execution of the withdrawal transaction
        before returning the transaction hash.
      operationId: withdraw
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - evmEoa
                - dstWalletAddress
                - expiration
                - signatureByEvmEoa
              properties:
                evmEoa:
                  $ref: '#/components/schemas/EvmAddress'
                  description: User's EVM wallet address (the signer)
                dstWalletAddress:
                  $ref: '#/components/schemas/EvmAddress'
                  description: Wallet address that receives the withdrawn funds
                srcTokenAddress:
                  $ref: '#/components/schemas/EvmAddress'
                  description: >-
                    Optional source token address to withdraw from the proxy
                    wallet. Always on Polygon, so only the address is needed.
                    Defaults to pUSD collateral. Set to USDC.e to sweep funds
                    stuck as USDC.e.
                dstToken:
                  $ref: '#/components/schemas/PolymarketDstToken'
                  description: >-
                    Optional destination token (address + chainId). When set,
                    the source token is swapped into this token before delivery.
                expiration:
                  type: integer
                  description: >-
                    Unix timestamp (seconds) when the signature expires. Must be
                    within the next ~300 seconds.
                signatureByEvmEoa:
                  $ref: '#/components/schemas/Hex'
                  description: EIP-712 signature by the EOA over the `Withdraw` typed data.
      responses:
        '200':
          description: Withdrawal executed successfully
          content:
            application/json:
              schema:
                type: object
                required:
                  - txHash
                  - status
                properties:
                  txHash:
                    $ref: '#/components/schemas/Hex'
                    description: Transaction hash of the withdrawal
                  status:
                    type: string
                    description: Status message of the withdrawal
        '400':
          description: >-
            Bad request due to missing or invalid parameters, or an
            invalid/expired signature
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      servers:
        - url: https://api-v2.swaps.xyz/api
          description: Core Swap API Server
components:
  schemas:
    EvmAddress:
      type: string
      pattern: ^0x[a-fA-F0-9]{40}$
      description: EVM address (0x prefix + 40 hex characters)
    PolymarketDstToken:
      type: object
      required:
        - address
        - chainId
      description: >-
        Destination token used by Polymarket workflow endpoints. When provided,
        proceeds are swapped into this token before delivery.
      properties:
        address:
          $ref: '#/components/schemas/EvmAddress'
          description: Destination token contract address
        chainId:
          type: number
          description: Destination chain ID. See the [chain list](/resources/chain-list).
    Hex:
      type: string
      pattern: ^0x[a-fA-F0-9]*$
      description: Hex string with 0x prefix
    ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          description: Always false for error responses
          enum:
            - false
          example: false
        error:
          type: object
          required:
            - code
            - name
            - message
            - title
            - statusCode
            - timestamp
          properties:
            code:
              type: string
              description: Error type code for programmatic handling
            name:
              type: string
              description: Error class name
            message:
              type: string
              description: Detailed error message
            title:
              type: string
              description: Short, user-friendly error title
            statusCode:
              type: integer
              description: HTTP status code
            details:
              type: object
              description: Additional error details
              additionalProperties: true
            timestamp:
              type: string
              description: ISO 8601 timestamp when the error occurred
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: 'Limited demo key for API Reference: `5c951bc81da566bbd030ba8e20724063`.'

````