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.

JSONCode
{ "type": "about:blank", "title": "Validation Failed", "status": 400, "code": "validation_failed", "retryable": false, "traceId": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01", "errors": [ { "name": "amount", "reason": "\"1.123456789\" is not a decimal amount with at most 8 decimal places." } ] }

The fields

FieldMeaning
statusThe HTTP status, repeated in the body.
codeWhat 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.
retryableWhether repeating the same request later can succeed.
title, detailA summary and, when there is one, the specifics, for a person to read. The wording can change.
traceIdThe request's trace. Quote it when you contact support.
errorsThe individual failures: one entry per invalid field, with its name and reason, or one general entry.

Status codes

StatusWhen
400The request is malformed or a field is invalid; errors names each field.
401The token is missing, invalid, expired or revoked, or is a workspace token whose workspace was deleted.
403The 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.
404The 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.
409The 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.
412An If-Match names a version the object no longer has; read it again and retry. See Data formats.
422A 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.
429Too many requests; see Rate limits.
500An unexpected error. Quote the traceId.
503A dependency is briefly unavailable; retry after Retry-After.

How it behaves

  • retryable is true for rate_limit_exceeded, provider_unavailable, external_timeout, service_unavailable, concurrency_conflict and request_timeout. Retry those with a delay; retrying anything else repeats the same answer.
  • A 400 from 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.