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

# Get withdrawal signing data

> Get the data a user must sign to request a withdrawal.

Get the data a user must sign to request a withdrawal.

> [!NOTE]
>
> Use a Broker API Key and pass the target user's wallet in X-User-Wallet-Address. The gateway checks that the wallet belongs to your Broker. See [Broker API Key and signing](https://dexbuilder.mintlify.site/en/api-reference/common/broker-authentication.md).

## Usage notes

* `address` is the user's bound signing wallet and the withdrawal destination. `to_address` is optional; if provided, it must equal `address`. This platform API does not support third-party withdrawal destinations.
* For EVM, response `data` is hex-encoded EIP-712 TypedData for wallet signing, not onchain transaction data. Do not broadcast it to `contract_address`.
* `timestamp` is a Unix timestamp in milliseconds. After signing, pass the signature components and the unchanged `timestamp` to [Submit a withdrawal](https://dexbuilder.mintlify.site/en/api-reference/dexbuilder/withdraw-submit.md).


## OpenAPI

````yaml openapi/dexbuilder-en.yaml POST /api/v4/dexbuilder/withdraw/sign_data
openapi: 3.0.3
info:
  title: DexBuilder Platform Broker API
  version: 1.0.0
  description: >-
    DexBuilder Platform Broker API for asset configuration, user queries,
    deposits, and withdrawals. See the shared gateway documentation for
    authentication and wallet verification.
servers:
  - url: https://api.dexbuilder.com
security: []
paths:
  /api/v4/dexbuilder/withdraw/sign_data:
    post:
      tags:
        - Withdrawal
      summary: Get withdrawal signing data
      operationId: dexBuilderWithdrawSignData
      parameters:
        - $ref: '#/components/parameters/SubUserWalletAddr'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PerpWithdrawSignDataRequest'
      responses:
        '200':
          description: Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvelopeWithdrawSignData'
        '400':
          $ref: '#/components/responses/OpenAPIBadRequest'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '401':
          $ref: '#/components/responses/GatewayUnauthorized'
        '403':
          $ref: '#/components/responses/ProjectAccessDenied'
      security:
        - BrokerAPIKey: []
          Timestamp: []
          Signature: []
components:
  parameters:
    SubUserWalletAddr:
      name: X-User-Wallet-Address
      in: header
      required: true
      description: >-
        Target user's wallet address. The gateway verifies that the user belongs
        to the current Broker.
      schema:
        type: string
  schemas:
    PerpWithdrawSignDataRequest:
      type: object
      properties:
        chain:
          $ref: '#/components/schemas/OpenAPIChainId'
        token_symbol:
          type: string
          description: Token symbol
        token_address:
          type: string
          description: Token contract
        token_amount:
          type: string
          description: Withdrawal amount as a decimal string
        to_address:
          type: string
          description: >-
            Optional. If provided, it must equal the bound signing wallet
            address; third-party withdrawal destinations are not supported.
        address:
          type: string
          description: >-
            Bound user wallet that signs the request; must match
            X-User-Wallet-Address
      required:
        - chain
        - token_symbol
        - token_address
        - token_amount
        - address
    EnvelopeWithdrawSignData:
      allOf:
        - $ref: '#/components/schemas/EnvelopeBase'
        - type: object
          properties:
            data:
              $ref: '#/components/schemas/PerpWithdrawSignDataResponse'
    ErrorEnvelope:
      allOf:
        - $ref: '#/components/schemas/EnvelopeBase'
        - type: object
          required:
            - label
          properties:
            label:
              type: string
              description: Stable machine-readable error label
            data:
              nullable: true
              description: Usually null on error
    OpenAPIChainId:
      type: string
      enum:
        - base
        - bsc
        - ethereum
        - solana
        - arbitrum
      description: 'Network identifier: base, bsc, ethereum, solana, or arbitrum.'
      example: ethereum
    EnvelopeBase:
      type: object
      properties:
        code:
          type: integer
          example: 0
          description: Business code; 0 indicates success
        message:
          type: string
          example: success
          description: Human-readable message; success responses use success
        reason:
          type: string
          description: Error reason identifier; usually empty on success
        trace_id:
          type: string
          description: Trace ID to provide when requesting support
    PerpWithdrawSignDataResponse:
      type: object
      properties:
        data:
          type: string
          description: >-
            For EVM, UTF-8 hex (0x-prefixed) of the complete EIP-712 TypedData
            JSON. The wallet signs the TypedData hash. This is not onchain
            transaction input; do not broadcast it to the Vault.
        contract_address:
          type: string
          description: Vault contract
        timestamp:
          type: integer
          format: int64
          description: >-
            Unix timestamp in milliseconds. Pass this value unchanged to
            withdraw/submit.
  responses:
    OpenAPIBadRequest:
      description: 'Invalid request: parameters, body, user identity, or business validation'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            invalidArgument:
              summary: Invalid parameter
              value:
                label: INVALID_ARGUMENT
                message: invalid argument
            userNotFound:
              summary: User not found
              value:
                label: USER_NOT_FOUND
                message: User not found
            missingHeader:
              summary: Missing required header
              value:
                label: MISSING_REQUIRED_HEADER
                message: invalid headers
    GatewayUnauthorized:
      description: Invalid Broker API Key, signature, or timestamp
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            invalidKey:
              summary: Invalid API Key
              value:
                label: INVALID_KEY
                message: Invalid key provided
                code: 401
                trace_id: abc123
            invalidSignature:
              summary: Invalid signature
              value:
                label: INVALID_SIGNATURE
                message: Invalid signature
                code: 401
                trace_id: abc123
    ProjectAccessDenied:
      description: Project not bound, or Broker and API Key do not match
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          example:
            code: 40300801
            reason: P_DEX_BUILDER_IN_PROJECT_ACCESS_DENIED
            label: PROJECT_ACCESS_DENIED
            message: project access denied
            data: null
  securitySchemes:
    BrokerAPIKey:
      type: apiKey
      in: header
      name: KEY
      description: Broker API Key
    Timestamp:
      type: apiKey
      in: header
      name: Timestamp
      description: Unix timestamp in seconds
    Signature:
      type: apiKey
      in: header
      name: SIGN
      description: Hexadecimal HMAC-SHA512 signature generated with the Broker Secret Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.