const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: '1000000000000000000',
to: '0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382',
tokenAddress: '0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382',
signature: '0x1234567890abcdef...',
message: {
salt: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
data: '0xa9059cbb0000000000000000000000003270bf32ab647e90ef94a026c70aa1daaaada23820000000000000000000000000000000000000000000000000de0b6b3a7640000'
},
smartWalletAddress: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'
})
};
fetch('https://api.gnosispay.com/api/v1/accounts/withdraw', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.gnosispay.com/api/v1/accounts/withdraw \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "1000000000000000000",
"to": "0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382",
"tokenAddress": "0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382",
"signature": "0x1234567890abcdef...",
"message": {
"salt": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"data": "0xa9059cbb0000000000000000000000003270bf32ab647e90ef94a026c70aa1daaaada23820000000000000000000000000000000000000000000000000de0b6b3a7640000"
},
"smartWalletAddress": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
}
'import requests
url = "https://api.gnosispay.com/api/v1/accounts/withdraw"
payload = {
"amount": "1000000000000000000",
"to": "0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382",
"tokenAddress": "0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382",
"signature": "0x1234567890abcdef...",
"message": {
"salt": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"data": "0xa9059cbb0000000000000000000000003270bf32ab647e90ef94a026c70aa1daaaada23820000000000000000000000000000000000000000000000000de0b6b3a7640000"
},
"smartWalletAddress": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gnosispay.com/api/v1/accounts/withdraw"
payload := strings.NewReader("{\n \"amount\": \"1000000000000000000\",\n \"to\": \"0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382\",\n \"tokenAddress\": \"0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382\",\n \"signature\": \"0x1234567890abcdef...\",\n \"message\": {\n \"salt\": \"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\",\n \"data\": \"0xa9059cbb0000000000000000000000003270bf32ab647e90ef94a026c70aa1daaaada23820000000000000000000000000000000000000000000000000de0b6b3a7640000\"\n },\n \"smartWalletAddress\": \"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gnosispay.com/api/v1/accounts/withdraw")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"1000000000000000000\",\n \"to\": \"0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382\",\n \"tokenAddress\": \"0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382\",\n \"signature\": \"0x1234567890abcdef...\",\n \"message\": {\n \"salt\": \"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\",\n \"data\": \"0xa9059cbb0000000000000000000000003270bf32ab647e90ef94a026c70aa1daaaada23820000000000000000000000000000000000000000000000000de0b6b3a7640000\"\n },\n \"smartWalletAddress\": \"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gnosispay.com/api/v1/accounts/withdraw")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"1000000000000000000\",\n \"to\": \"0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382\",\n \"tokenAddress\": \"0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382\",\n \"signature\": \"0x1234567890abcdef...\",\n \"message\": {\n \"salt\": \"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\",\n \"data\": \"0xa9059cbb0000000000000000000000003270bf32ab647e90ef94a026c70aa1daaaada23820000000000000000000000000000000000000000000000000de0b6b3a7640000\"\n },\n \"smartWalletAddress\": \"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "clp3j1f9a0000a1cdh6ezx2qv",
"safeAddress": "0x1234567890abcdef1234567890abcdef12345678",
"transactionData": "{\"to\":\"0x123\",\"value\":\"0\",\"data\":\"0xabcdef\"}",
"enqueueTaskId": "task_abc123",
"operationType": "CALL",
"userId": "user_123",
"status": "QUEUING",
"createdAt": "2025-02-07T12:34:56Z",
"dispatchTaskId": "<string>",
"readyAt": "2023-11-07T05:31:56Z"
}
}{
"error": "Unauthorized"
}{
"error": "Couldn't find associated Safe for the user"
}{
"error": "amount must be a valid integer"
}{
"message": "An unexpected error occurred."
}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.
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: '1000000000000000000',
to: '0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382',
tokenAddress: '0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382',
signature: '0x1234567890abcdef...',
message: {
salt: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef',
data: '0xa9059cbb0000000000000000000000003270bf32ab647e90ef94a026c70aa1daaaada23820000000000000000000000000000000000000000000000000de0b6b3a7640000'
},
smartWalletAddress: '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'
})
};
fetch('https://api.gnosispay.com/api/v1/accounts/withdraw', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.gnosispay.com/api/v1/accounts/withdraw \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "1000000000000000000",
"to": "0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382",
"tokenAddress": "0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382",
"signature": "0x1234567890abcdef...",
"message": {
"salt": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"data": "0xa9059cbb0000000000000000000000003270bf32ab647e90ef94a026c70aa1daaaada23820000000000000000000000000000000000000000000000000de0b6b3a7640000"
},
"smartWalletAddress": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
}
'import requests
url = "https://api.gnosispay.com/api/v1/accounts/withdraw"
payload = {
"amount": "1000000000000000000",
"to": "0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382",
"tokenAddress": "0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382",
"signature": "0x1234567890abcdef...",
"message": {
"salt": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"data": "0xa9059cbb0000000000000000000000003270bf32ab647e90ef94a026c70aa1daaaada23820000000000000000000000000000000000000000000000000de0b6b3a7640000"
},
"smartWalletAddress": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gnosispay.com/api/v1/accounts/withdraw"
payload := strings.NewReader("{\n \"amount\": \"1000000000000000000\",\n \"to\": \"0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382\",\n \"tokenAddress\": \"0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382\",\n \"signature\": \"0x1234567890abcdef...\",\n \"message\": {\n \"salt\": \"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\",\n \"data\": \"0xa9059cbb0000000000000000000000003270bf32ab647e90ef94a026c70aa1daaaada23820000000000000000000000000000000000000000000000000de0b6b3a7640000\"\n },\n \"smartWalletAddress\": \"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gnosispay.com/api/v1/accounts/withdraw")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"1000000000000000000\",\n \"to\": \"0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382\",\n \"tokenAddress\": \"0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382\",\n \"signature\": \"0x1234567890abcdef...\",\n \"message\": {\n \"salt\": \"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\",\n \"data\": \"0xa9059cbb0000000000000000000000003270bf32ab647e90ef94a026c70aa1daaaada23820000000000000000000000000000000000000000000000000de0b6b3a7640000\"\n },\n \"smartWalletAddress\": \"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gnosispay.com/api/v1/accounts/withdraw")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"1000000000000000000\",\n \"to\": \"0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382\",\n \"tokenAddress\": \"0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382\",\n \"signature\": \"0x1234567890abcdef...\",\n \"message\": {\n \"salt\": \"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\",\n \"data\": \"0xa9059cbb0000000000000000000000003270bf32ab647e90ef94a026c70aa1daaaada23820000000000000000000000000000000000000000000000000de0b6b3a7640000\"\n },\n \"smartWalletAddress\": \"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "clp3j1f9a0000a1cdh6ezx2qv",
"safeAddress": "0x1234567890abcdef1234567890abcdef12345678",
"transactionData": "{\"to\":\"0x123\",\"value\":\"0\",\"data\":\"0xabcdef\"}",
"enqueueTaskId": "task_abc123",
"operationType": "CALL",
"userId": "user_123",
"status": "QUEUING",
"createdAt": "2025-02-07T12:34:56Z",
"dispatchTaskId": "<string>",
"readyAt": "2023-11-07T05:31:56Z"
}
}{
"error": "Unauthorized"
}{
"error": "Couldn't find associated Safe for the user"
}{
"error": "amount must be a valid integer"
}{
"message": "An unexpected error occurred."
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The amount to withdraw in the token's base units.
^[1-9][0-9]*$"1000000000000000000"
The address to withdraw to.
^0x[a-fA-F0-9]{40}$"0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382"
The address of the token to withdraw. Use "0x0000000000000000000000000000000000000000" for native token (xDAI) withdrawals.
^0x[a-fA-F0-9]{40}$"0x3270bf32AB647e90eF94A026c70Aa1daaaDA2382"
The wallet signature authorizing this withdraw.
"0x1234567890abcdef..."
The message object containing transaction data and salt.
Show child attributes
Show child attributes
Optional. If using a smart account, the address of the smart wallet to use for the withdraw.
"0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
Response
Successfully submitted the withdraw request.
Show child attributes
Show child attributes