Errors
Every error code the API returns, and what to do about it.
An error returns a status and a body like this one. Branch on code; the message is for people
and may change. param names the parameter or field at fault, when there is one.
{
"error": {
"code": "invalid_record",
"message": "ttl must be \"auto\" or 60 to 86400 seconds.",
"param": "ttl"
}
}| Status | Code | Meaning | What to do |
|---|---|---|---|
| 400 | invalid_request | A parameter, field or body isn't valid | Fix what param names |
| 401 | missing_key | No Authorization header | Send Authorization: Bearer <key> |
| 401 | invalid_key | The key is unknown, revoked or expired, or lacks Bearer | Use a live key, after Bearer |
| 403 | https_required | The request used plain HTTP | Use https://, and grant the key access again |
| 403 | missing_permission | The key lacks the access this needs | Ask an owner or admin for required_permission |
| 404 | not_found | No such endpoint, or earnings while Access and pricing is off | Check the path; for earnings, see Access and pricing |
| 404 | domain_not_found | No such domain, or the key's access doesn't reach it | Check the name, and what the key reaches with GET /me |
| 404 | record_not_found | No such record on this domain | List the records to find its id |
| 405 | method_not_allowed | The path doesn't take this method, OPTIONS included | See the Allow header |
| 409 | domain_not_active | The domain isn't active on DNA's nameservers | Finish the nameserver change |
| 409 | record_conflict | The record clashes with one on the same name | Change or delete the other record first |
| 409 | record_exists | An identical record already exists | On create, nothing: it's there. On update, delete one of them |
| 413 | body_too_large | The body is over 64 KB | Send a smaller body |
| 422 | invalid_record | The record isn't valid; param names the field when it can | Fix the value |
| 429 | rate_limited | Too many requests | Wait Retry-After seconds |
| 500 | internal_error | A failure on our side during a read | Retry |
| 500 | outcome_unknown | A failure on our side during a write | Read the record before retrying |
| 502 | upstream_unavailable | A temporary failure; nothing changed | Retry shortly |
| 504 | outcome_unknown | No answer in time; the write may have saved | Read the record before retrying |