Get Spend Policy
GET/accounts/{account_id}/billing/spend-policies/{policy_id}
Returns one spend policy. The ETag response header holds the current version; send it as If-Match on a later update or delete.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Path Parameters
Get Spend Policy
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/billing/spend-policies/$POLICY_ID \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN"{
"errors": [
{
"message": "message",
"code": 0
}
],
"messages": [
{
"message": "message",
"code": 0
}
],
"result": {
"id": "6f1c2b8e-3d4a-4f5b-9c6d-7e8f9a0b1c2d",
"account_id": 1234567,
"action": "notification",
"enabled": true,
"name": "Workers cap",
"notification_email": "billing@example.com",
"product_id": "workers",
"threshold_cents": 100,
"version": 1,
"current_state": {
"balance_cents": 0,
"billing_period_end": "2019-12-27T18:11:19.117Z",
"billing_period_start": "2019-12-27T18:11:19.117Z",
"enforcement": {
"applied_generation": 0,
"delivery_status": "pending",
"desired_generation": 0,
"desired_state": "active",
"expires_at": "2019-12-27T18:11:19.117Z"
},
"evaluated_at": "2019-12-27T18:11:19.117Z",
"status": "disabled"
}
},
"success": true
}Returns Examples
{
"errors": [
{
"message": "message",
"code": 0
}
],
"messages": [
{
"message": "message",
"code": 0
}
],
"result": {
"id": "6f1c2b8e-3d4a-4f5b-9c6d-7e8f9a0b1c2d",
"account_id": 1234567,
"action": "notification",
"enabled": true,
"name": "Workers cap",
"notification_email": "billing@example.com",
"product_id": "workers",
"threshold_cents": 100,
"version": 1,
"current_state": {
"balance_cents": 0,
"billing_period_end": "2019-12-27T18:11:19.117Z",
"billing_period_start": "2019-12-27T18:11:19.117Z",
"enforcement": {
"applied_generation": 0,
"delivery_status": "pending",
"desired_generation": 0,
"desired_state": "active",
"expires_at": "2019-12-27T18:11:19.117Z"
},
"evaluated_at": "2019-12-27T18:11:19.117Z",
"status": "disabled"
}
},
"success": true
}