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

# Withdraw from Safe with Signature

> Withdraws ERC20 tokens or native tokens (xDAI) from the user's Safe account.

For ERC20 tokens, provide the token contract address.
For native token (xDAI) withdrawals, use "0x0000000000000000000000000000000000000000" as the tokenAddress.

The signature should be generated by signing the transaction data obtained from
the `/api/v1/accounts/withdraw/transaction-data` endpoint.

The withdrawal is processed through a delay relay mechanism that executes after 3 minutes.




## OpenAPI

````yaml https://api.gnosispay.com/api-docs/spec.json post /api/v1/accounts/withdraw
openapi: 3.0.0
info:
  title: GnosisPay API
  version: 1.0.0
  description: OpenAPI documentation for GnosisPay
servers:
  - url: https://api.gnosispay.com
security: []
tags:
  - name: Account Management
    description: Information about your Account
  - name: Authentication
    description: Authenticate to our API using SIWE
  - name: Card Management
    description: Manage all your Cards
  - name: IBAN
    description: Integrate with Monerium to issue IBANs
  - name: KYC
    description: KYC using Sumsub SDK
  - name: Physical Card Order
    description: Order a Physical Card and manage the process
  - name: Rewards
    description: Cashback Rewards
  - name: Safe Management
    description: Manage your Safe
  - name: Transactions
    description: Manage Card Transactions
  - name: User
    description: Manage User Information
  - name: Webhooks
    description: Manage Webhooks
paths:
  /api/v1/accounts/withdraw:
    post:
      tags:
        - Account Management
      summary: Withdraw from Safe with Signature
      description: >
        Withdraws ERC20 tokens or native tokens (xDAI) from the user's Safe
        account.


        For ERC20 tokens, provide the token contract address.

        For native token (xDAI) withdrawals, use
        "0x0000000000000000000000000000000000000000" as the tokenAddress.


        The signature should be generated by signing the transaction data
        obtained from

        the `/api/v1/accounts/withdraw/transaction-data` endpoint.


        The withdrawal is processed through a delay relay mechanism that
        executes after 3 minutes.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - amount
                - to
                - tokenAddress
                - signature
                - message
              properties:
                amount:
                  type: string
                  pattern: ^[1-9][0-9]*$
                  description: The amount to withdraw in the token's base units.
                  example: '1000000000000000000'
                to:
                  type: string
                  pattern: ^0x[a-fA-F0-9]{40}$
                  description: The address to withdraw to.
                  example: '0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382'
                tokenAddress:
                  type: string
                  pattern: ^0x[a-fA-F0-9]{40}$
                  description: >-
                    The address of the token to withdraw. Use
                    "0x0000000000000000000000000000000000000000" for native
                    token (xDAI) withdrawals.
                  example: '0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382'
                signature:
                  type: string
                  description: The wallet signature authorizing this withdraw.
                  example: 0x1234567890abcdef...
                message:
                  type: object
                  required:
                    - salt
                    - data
                  description: The message object containing transaction data and salt.
                  properties:
                    salt:
                      type: string
                      description: The salt value used in the EIP-712 typed data.
                      example: >-
                        0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
                    data:
                      type: string
                      description: >-
                        The encoded transaction data from the typed data
                        message.
                      example: >-
                        0xa9059cbb0000000000000000000000003270bf32ab647e90ef94a026c70aa1daaaada23820000000000000000000000000000000000000000000000000de0b6b3a7640000
                smartWalletAddress:
                  type: string
                  description: >-
                    Optional. If using a smart account, the address of the smart
                    wallet to use for the withdraw.
                  example: >-
                    0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
      responses:
        '200':
          description: Successfully submitted the withdraw request.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - id
                      - safeAddress
                      - transactionData
                      - enqueueTaskId
                      - operationType
                      - userId
                      - status
                      - createdAt
                    properties:
                      id:
                        type: string
                        description: Unique identifier for the delayed transaction.
                        example: clp3j1f9a0000a1cdh6ezx2qv
                      safeAddress:
                        type: string
                        description: >-
                          The Safe contract address associated with the
                          transaction.
                        example: '0x1234567890abcdef1234567890abcdef12345678'
                      transactionData:
                        type: string
                        description: JSON stringified data payload of the transaction.
                        example: '{"to":"0x123","value":"0","data":"0xabcdef"}'
                      enqueueTaskId:
                        type: string
                        description: Identifier of the task that enqueued this transaction.
                        example: task_abc123
                      dispatchTaskId:
                        type: string
                        nullable: true
                        description: >-
                          Identifier of the task responsible for dispatching
                          this transaction.
                      readyAt:
                        type: string
                        format: date-time
                        nullable: true
                        description: >-
                          Timestamp indicating when the transaction is ready for
                          processing.
                      operationType:
                        type: string
                        enum:
                          - CALL
                          - DELEGATECALL
                        description: Type of operation being performed.
                        example: CALL
                      userId:
                        type: string
                        description: >-
                          Identifier of the user associated with the
                          transaction.
                        example: user_123
                      status:
                        type: string
                        enum:
                          - QUEUING
                          - WAITING
                          - EXECUTING
                          - EXECUTED
                          - FAILED
                        description: Current status of the transaction.
                        example: QUEUING
                      createdAt:
                        type: string
                        format: date-time
                        description: Timestamp of when the transaction was created.
                        example: '2025-02-07T12:34:56Z'
        '401':
          description: Unauthorized - invalid or missing authentication token.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Authentication error message.
                    example: Unauthorized
        '404':
          description: Safe account or token not found for the user.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message explaining why the request failed.
                    example: Couldn't find associated Safe for the user
        '422':
          description: Unprocessable Entity - validation errors in request body.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Details about the validation error.
                    example: amount must be a valid integer
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Details about the server error.
                    example: An unexpected error occurred.
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````