Reference

Errors

Every error carries a code, the same over REST and the WebSocket. Build your logic on that code: the message text may change, the code never will.

Over REST

JSON
{
  "type": "https://fathomcharts.com/docs/errors#invalid-parameters",
  "title": "Invalid parameters",
  "status": 400,
  "detail": "Invalid indicator parameters",
  "code": "INVALID_PARAMETERS",
  "instance": "req-1b",
  "errors": [
    { "path": "/minimum", "message": "must be >= 1" }
  ]
}
  • code: the error code, listed below;
  • detail: a human-readable explanation;
  • errors: for INVALID_PARAMETERS, the list of problems, with the location of each faulty field (path);
  • instance: the request id, to share with support if needed.

When a history query or an export exceeds your budget, the response also gives its cost (computeUnits) and what you have left (remainingComputeUnits). 429 responses carry a Retry-After header: the number of seconds to wait.

Over the WebSocket

A refused or interrupted subscription receives an error message with its sub. Only that subscription is closed: the connection and your other subscriptions keep running.

JSON
{"sub":"bt","t":"error","code":"UNKNOWN_INDICATOR","message":"unknown indicator `big-trade`"}

A message the server cannot understand (invalid JSON, unknown type…) receives an error without a sub.

With the SDK, a subscription error ends its iteration with a FathomChartsError carrying the received code.

Problems that close the whole connection (key rejected, too many connections, client too slow) do not come as error messages but as close codes.

Code reference

CodeHTTPMeaningWhat to do
INVALID_PARAMETERS
Invalid parameters
400 · 413 · 415Invalid request: a field is unknown, missing, of the wrong type or out of range (400), the body is over 16 KB (413), or the body is not JSON (415).Fix the request. The errors field lists each problem and where it is.
UNKNOWN_INDICATOR
Unknown indicator
404This indicator does not exist.Check the id in the catalog (GET /v1/indicators).
UNKNOWN_INSTRUMENT
Unknown instrument
404This instrument is not available.Check the symbol with GET /v1/instruments. For a contract that is not streamed in real time, set dataset.
NOT_COVERED
Range not covered
402No data for all or part of the requested range.Narrow the range. The estimate lists the missing days (missingDays).
WARMING
Warming up
409The calculation is warming up and not ready yet.Retry in a few moments.
QUOTA_EXCEEDED
Quota exceeded
429 · 409You hit a limit of your plan: the monthly compute budget or export volume (429), the number of subscriptions or custom configurations (WebSocket), or 10 active keys (409).Check GET /v1/usage. Narrow the range, wait for next month (Retry-After), close a subscription or revoke a key.
RATE_LIMITED
Rate limited
429Too many requests in a short time.Wait for the number of seconds given in Retry-After.
CAPACITY
Capacity reached
503The service is temporarily at capacity.Retry with exponential backoff.
CURSOR_EXPIRED
Cursor expired
410The next-page cursor (next) is too old.Run the query again from the start.
UNAUTHORIZED
Unauthorized
401The key or token is missing, invalid, expired or revoked, or the sign-in link has expired or was already used.Check the Authorization header, or request a new token or a new link.
FORBIDDEN
Forbidden
403You are authenticated but not allowed to access what you asked for: the key lacks a scope, the instrument or IP address is not allowed, or your plan does not cover the request.The message says what is missing: adjust the key or add the offer you need.
NOT_FOUND
Not found
404Unknown URL, or the key does not exist.Check the URL and the id.
CONFLICT
Conflict
409The action is not possible in the current state: the key was already rotated, you already own the offer, or the billing country is served by a different payment provider than the account’s.Check the current state before trying again.
WITHDRAWAL_WAIVER_REQUIRED
Withdrawal waiver required
400The checkout was started without the waiver of the right of withdrawal, or with an older version of its text.Reload the account page, tick the box, then try again.
SOURCE_DOWN
Source down
— (WebSocket)Data for this instrument is temporarily unavailable.Retry later. GET /v1/instruments reports the state of each instrument.
UPSTREAM_ERROR
Upstream error
502A service we depend on returned an unexpected response.Retry with exponential backoff.
INTERNAL
Internal error
500Something went wrong on our side.Retry. If it persists, contact support with the instance value of the response.