Update the caller's automatic top-up policy.
curl --request PUT \
--url https://api.example.com/v1/billing/auto-top-up \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"enabled": true
}
'import requests
url = "https://api.example.com/v1/billing/auto-top-up"
payload = { "enabled": True }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({enabled: true})
};
fetch('https://api.example.com/v1/billing/auto-top-up', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"ok": true
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}Billing
Update automatic top-up
Enable, disable, or change automatic prepaid funding.
PUT
/
v1
/
billing
/
auto-top-up
Update the caller's automatic top-up policy.
curl --request PUT \
--url https://api.example.com/v1/billing/auto-top-up \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"enabled": true
}
'import requests
url = "https://api.example.com/v1/billing/auto-top-up"
payload = { "enabled": True }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({enabled: true})
};
fetch('https://api.example.com/v1/billing/auto-top-up', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"ok": true
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>"
}
}Automatic top-up is off by default. Enable it with the default
You can also provide
$5.00
threshold and $25.00 recharge target:
{
"enabled": true
}
threshold_usd and recharge_to_usd as decimal strings.
Authorizations
droydApiKeyBearerdroydApiKeyHeader
A Droyd API key in the Authorization Bearer slot.
Headers
Required string length:
8 - 120Pattern:
^[A-Za-z0-9][A-Za-z0-9._:-]{7,119}$Body
application/json
Response
Successful response.
Was this page helpful?
