HTTP 402 Monthly spend cap reached. The workspace has a monthly spend cap, and this period’s spend plus the publish’s estimated cost would pass it.
When it happens
2 operations declare it: POST /api/v1/posts and POST /api/v1/posts/{postId}/publish.
Response body
{
"type": "https://pubnio.com/docs/problems/spend-cap-reached/",
"status": 402,
"title": "Monthly spend cap reached",
"detail": "This publish would exceed the workspace monthly variable spend cap.",
"code": "spend_cap_reached",
"capMicros": 20000000,
"periodSpendMicros": 19990000,
"estimatedMicros": 15000,
"fundingUrl": "/app/1d3e5f70-2a4b-4c6d-8e0f-123456789abc/settings?tab=billing",
"canManageBilling": false,
"nextAction": "Ask a workspace owner to adjust the spend cap at /app/1d3e5f70-2a4b-4c6d-8e0f-123456789abc/settings?tab=billing.",
"requestId": "0f8e4c2a-6b1d-4e3f-8a9b-7c6d5e4f3a21"
}| Field | Type | Always present |
|---|---|---|
capMicros |
integer | Yes |
periodSpendMicros |
integer | Yes |
estimatedMicros |
integer | Yes |
fundingUrl |
string | Yes |
canManageBilling |
boolean | Yes |
nextAction |
string | Yes |
Recovery for agents
- Do what
nextActionsays.
Retryable
No: the SDKs mark HTTP 402 not retryable.
Limits
- Match on
typeorcode, not ondetail.