Skip to main content

Errors

All API errors are returned as JSON with a single human-readable error field:

{ "error": "station not found" }

Status codes

StatusMeaningWhat to do
200 OKSuccess.
400 Bad RequestMalformed query parameter (bad number, bad ISO 8601 timestamp).Fix the client.
401 UnauthorizedToken missing, expired, invalid, or client not registered.Re-fetch the token; if persistent, contact Persium.
403 ForbiddenYour client has been disabled.Contact Persium support.
404 Not FoundResource does not exist or belongs to a different organisation.Verify the UUID is yours.
500 Internal Server ErrorPersium-side issue.Retry with backoff; escalate if persistent.

401 vs 403

These look similar but mean different things.

401 is the token's fault. It's transient: re-fetching usually fixes it. Always re-fetch and retry once before giving up.

403 is your client's fault. The client is registered but disabled. Retrying will not help — contact Persium.

404 confidentiality

Persium does not distinguish between "this UUID doesn't exist" and "this UUID exists but belongs to a different organisation". Both return 404 Not Found. This is deliberate — it prevents your credentials from being used to probe for the existence of other organisations' stations.

If you get 404 for a UUID you believe belongs to you, double-check via GET /stations that the UUID is in your organisation's list.

Retries

For 5xx responses, retry up to 3 times with exponential backoff (e.g. 1s, 2s, 4s).

Do not retry 4xx — the request will not succeed without changes to the request itself (other than the 401 token-refresh case above).

Validation errors

400 Bad Request is most often a query parameter problem:

Likely causeExample error message
Non-numeric page/per_pagestrconv.Atoi: parsing "two": invalid syntax
Bad start_time/end_time formatparsing time "2026-05-01" as "2006-01-02T15:04:05Z07:00": ...
Missing path UUIDuuid is required

Use ISO 8601 with the trailing Z (or an explicit offset) and positive integers for paging.