Skip to main content
LogBrew API errors use one JSON envelope. Use code and next_action for program behavior. Show error and next as plain text. Do not match the wording of error or next.
Some responses add fields, such as limit, reset_at, or retry_after_seconds. The error codes table names them.

Handle an error response

  1. Read the HTTP status.
  2. Make sure that the body is JSON before you read code.
  3. Use the status and code together to select the client branch.
  4. Show error and next as plain text. Do not render them as HTML or run them as commands.
  5. Use next_action for automatic recovery. If the client does not recognize the action, stop and show the error.
  6. Keep the returned limit, reset_at, and retry_after_seconds values with the failed request.
  7. Before you retry, use the retry rules.
If the response has no JSON envelope, keep the HTTP status and record the code as unavailable. Do not invent a LogBrew code. A proxy or network failure can produce this result. Do not replace a LogBrew code with the HTTP status name. For example, a 400 response can contain invalid_json or invalid_path. Each code needs a different correction. For logs, record the HTTP status and code. Do not log the full body, credentials, or recovery tokens.

Error codes

The same code can occur on more than one route. The next text and the next_action values can change by route. Use the returned values. An endpoint returns only the codes that apply to its authentication, method, body, and limits. An organization has no member limit and no project limit. The API does not return member_limit_exceeded. An unknown ID and an ID that you cannot access can return the same response. Do not use error text to find which account owns an ID. An unknown API path returns 404 with not_found.

Limit fields

Read the current allowance and use from the account API.

Retry rules

Use the code and the operation to decide on a retry. The status alone is not sufficient.
  • Do not start parallel retries for one failed request.
  • For rate_limited, the response also has the Retry-After and X-RateLimit-After headers. Both contain the same number of seconds as retry_after_seconds.
  • An account can run at most 8 telemetry and log reads at the same time. A further read waits up to 5 seconds for a free slot. Then it returns 429 with rate_limited and the Retry-After header. Wait that long, then send the read again.
  • A timeout does not prove that the result is empty.
A rate limit controls request frequency. A usage limit controls the account allowance for a billing period. Both use 429. Keep their fields separate. During either limit, show that collection or a read is delayed. Do not show old data as the result of a new read.

Writes

A timeout, a 5xx response, or a network failure does not prove that a write failed. Before you send a write again:
  1. If the route supports an idempotency key, send the same key and the same body again. Use a new key only for new work.
  2. If the route has no idempotency key, read the resource first. Send the write again only if the change is not present.
  3. If you cannot find the result, stop automatic retries and tell the user.
These routes accept a retry key: An Idempotency-Key value has 1 to 128 visible ASCII characters. Other values return 422 with validation_failed. idempotency_conflict means that the key belongs to a different request. Do not change the body of a retry that uses the original key.

Request shape errors

invalid_json means that the server cannot accept the body as the route’s JSON shape. Examine the content type, body size, JSON syntax, required fields, and field types. The HTTP status shows which part failed: validation_failed with the error invalid query parameters means that the server cannot read the query string. Examine the parameter names and value types. Do not send unknown query parameters. The query filters reference lists the parameters for each route. invalid_path with status 400 means that a path value, such as a project ID, has the wrong format. Do not move a path value into a query parameter. A 500 response with invalid_path or invalid_multipart does not prove that the request was wrong. Use the retry rules.

Authentication and access errors

  • unauthorized means that account authentication is missing, invalid, or expired. Send Authorization: Bearer <token>, or sign in again. Some routes return next_action.code authorize_request with a route-specific next, such as a live feed connection without a valid ticket.
  • ingest_key_invalid applies to telemetry ingestion only. Configure a current key for the exact project.
  • forbidden means that the account cannot do the action. Do not retry with other resource IDs.
  • not_found means that the resource is not available to the account.
Do not use an ingest key in place of an account bearer. Do not use an account bearer in place of an ingest key.

Keep error details safe

  • An account_recovery_available response contains a short-lived recovery_token. Keep it in protected client state. Do not put it in logs, URLs, screenshots, support reports, or agent prompts.
  • The 500 codes always use the message Internal error. The response does not name the component that failed. Do not guess the cause.
  • Do not add credentials, private diagnostics, or customer data to an error that you show.
  • An API response does not give permission for a purchase, a deletion, or another account change. Get the user’s approval before those actions.

Examples

These examples show the envelope shape. The error and next text can be different on each route.

Validation failure

Invalid query parameters

Invalid JSON

Invalid path value

Invalid multipart upload

Invalid WebSocket upgrade

Authentication failure

Invalid ingest key

This response applies to telemetry ingestion, not to account reads. The key must belong to the project in the request.

Resource not found

Access denied

Unsupported method

Request timeout

Idempotency conflict

Rate limit

Usage limit

The next text and next_action depend on whether paid checkout is open. Paid checkout is not open yet, so the response looks like this example. When checkout opens, next_action.code is wait_or_upgrade and the target is billing.

Artifact storage limit

Account recovery available

This response adds deleted_at and a short-lived recovery_token. Keep the token in protected client state.

Account recovery expired

Organization paused

Server error

storage_error, json_error, and internal_error use the same error message. The code, next, and next_action values are different.
For endpoints, authentication, and filters, read the Telemetry API.