HTTP 402 Insufficient prepaid credit. A publish’s estimated cost is above zero and above the workspace’s prepaid credit balance.
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/insufficient-credit/",
"status": 402,
"title": "Insufficient prepaid credit",
"detail": "Add prepaid credit before publishing this post.",
"code": "insufficient_credit",
"balanceMicros": 5000,
"requiredMicros": 15000,
"fundingUrl": "/app/1d3e5f70-2a4b-4c6d-8e0f-123456789abc/settings?tab=billing",
"canManageBilling": true,
"nextAction": "Open /app/1d3e5f70-2a4b-4c6d-8e0f-123456789abc/settings?tab=billing to add prepaid credit and retry.",
"requestId": "0f8e4c2a-6b1d-4e3f-8a9b-7c6d5e4f3a21"
}| Field | Type | Always present |
|---|---|---|
balanceMicros |
integer | Yes |
requiredMicros |
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.