Developers
Public API errors
Read the one error body every Costfluent Public API operation answers with, and decide from its code whether to retry.
Every error, from a refused token to a failed validation, answers with the same body: RFC 7807 problem details, sent as application/problem+json, with a machine-readable code and whether a retry can succeed.
Code
The fields
| Field | Meaning |
|---|---|
status | The HTTP status, repeated in the body. |
code | What went wrong, in snake case, such as not_found or validation_failed. It stays the same across releases; branch on it, never on the text. |
retryable | Whether repeating the same request later can succeed. |
title, detail | A summary and, when there is one, the specifics, for a person to read. The wording can change. |
traceId | The request's trace. Quote it when you contact support. |
errors | The individual failures: one entry per invalid field, with its name and reason, or one general entry. |
Status codes
| Status | When |
|---|---|
400 | The request is malformed or a field is invalid; errors names each field. |
401 | The token is missing, invalid, expired or revoked, or is a workspace token whose workspace was deleted. |
403 | The token lacks the operation's capability (errors[0] names it: name is capability, reason the capability, such as viewCosts, and code missing_capability), a workspace token names another workspace, the token carries the capability but the member who created it does not hold it there (detail says so and errors names no capability, so a new token with the capability does not help; see Authentication), or Costfluent's MCP server or command line asked for a change while the organization does not let AI agents create and change objects (agent_writes_disabled; see MCP server); see Authentication. |
404 | The object does not exist or is not visible to this token (not_found), or no operation is served at the path, such as a misspelt path or an operation this API version does not have (operation_not_found). Only not_found means the object is gone; after operation_not_found, check the path and the API version rather than treating the object as deleted. |
409 | The request conflicts with the object's current state, or with a change made at the same moment. A deletion refused because something still uses the object, such as a budget measuring a cost report, answers in_use, and errors names what uses it. |
412 | An If-Match names a version the object no longer has; read it again and retry. See Data formats. |
422 | A business rule refuses the request, such as a limit of your plan, or an Idempotency-Key already used with another request (idempotency_key_reused); see Data formats. |
429 | Too many requests; see Rate limits. |
500 | An unexpected error. Quote the traceId. |
503 | A dependency is briefly unavailable; retry after Retry-After. |
How it behaves
retryableistrueforrate_limit_exceeded,provider_unavailable,external_timeout,service_unavailable,concurrency_conflictandrequest_timeout. Retry those with a delay; retrying anything else repeats the same answer.- A
400from a request body that is not valid JSON, or a field of the wrong type, carries the same shape as one from a failed rule.