Errors

Every error from /v1 has the same shape:

{
  "error": {
    "code": "invalid_parameter",
    "message": "stat: is not a parameter of this endpoint",
    "param": "stat"
  }
}
  • code is stable, and is what your program should switch on. It will not change within /v1.
  • message is a sentence for a person. It may be reworded at any time; do not parse it.
  • param names the query parameter at fault, on invalid_parameter only.

Every response, error or not, also carries an x-request-id header. Quote it if you write to us about a call.

The codes

StatuscodeWhat happenedWhat to do
400invalid_parameterA parameter is unknown, malformed or out of range, or a cursor is not one this API issued. param names it.Fix the request. Retrying it unchanged will fail the same way.
401unauthorizedNo key, a key that is not valid or has been revoked, or a key sent in the URL.Send a valid key in the Authorization header. See Authentication.
402payment_requiredThe key's account has no API plan, its plan's first payment is still being confirmed, or billing is past due. The message says which.Start the plan in Settings › API, wait a few seconds for its payment, or update the card in Settings › Billing.
403forbiddenThe key's account is suspended, or its API access is switched off.Contact us.
404not_foundNo outage or network has that id, or the path is not an endpoint.Check the id. Outage ids are stable for an outage's whole life.
429rate_limitedThe key is over its per-minute limit, or this address has had 20 requests refused for a missing or bad key in the last minute.Wait for the retry-after header's seconds; for the second, fix the key first. See Rate limits.
500internal_errorSomething failed on our side. It has been logged.Retry with a backoff.

None of these is billed. Only a 2xx counts as a call; see Billing and usage.

Unknown parameters are refused

The API is strict about query parameters. A misspelt filter is refused with 400, never silently ignored:

400GET /v1/outages?stat=vic
{
  "error": {
    "code": "invalid_parameter",
    "message": "stat: is not a parameter of this endpoint",
    "param": "stat"
  }
}

That is deliberate. Ignored, ?stat=vic would quietly return every outage in the country — the worst way for a typo to fail on a metered API. The same goes for a value outside a parameter's vocabulary, such as status=open or a network id nobody issued.

Retrying

  • 429 and 5xx are worth retrying, after a wait. Use retry-after for a 429 and an increasing backoff for a 5xx.
  • Every other 4xx describes the request. Retrying it unchanged returns the same error.
  • A failed upstream feed is not an error. If a network's feed is down, the API still answers 200 with the last data it recorded, and meta.data_as_of and the network's feed.status in GET/v1/networks say how fresh it is.