Overview
Errors
Errors use standard HTTP status codes. The body has a _tag your code can check and a message written for people.
{ "_tag": "NotFound", "message": "Brand not found" }Status codes
Section titled “Status codes”| Status | _tag |
Meaning |
|---|---|---|
400 |
InvalidRequest |
The request is malformed or a value isn’t allowed |
401 |
Unauthorized |
The key is missing, invalid, revoked or expired |
402 |
PlanLimitExceeded |
The plan’s limit or credit balance doesn’t cover this |
402 |
SubscriptionRequired |
The account has no active subscription |
403 |
Forbidden |
The key lacks the permission for this request |
404 |
NotFound |
The resource doesn’t exist, or belongs to another account |
429 |
RateLimited |
Too many requests. See Rate limits |
502 |
UpstreamError |
A service Footnote depends on failed. Try again |
Handling errors
Section titled “Handling errors”- Branch on
_tag, not on the text ofmessage, which can change. - A
404is returned for another account’s resources as well as missing ones, so it never confirms that something exists. 429and502are safe to retry after a wait. Other4xxresponses mean the request needs to change first.