Errors
Every refusal has the same shape, with the HTTP status:
{ "error": "This key was revoked. Ask Mayotte Hub for a new one.", "code": "revoked" }Your program should read code. The error text is written for people and may change.
| Status | code |
Meaning | What to do |
|---|---|---|---|
| 400 | bad_json |
The body is not a JSON object. | Send one JSON object. |
| 400 | bad_event |
The event has no valid id or type. |
See the body. |
| 401 | no_key |
No Authorization: Bearer … header. |
Send your key. |
| 401 | bad_key |
The key is not valid. | Check you copied it whole. |
| 401 | revoked |
The key was revoked. | Ask for a new key. |
| 401 | expired |
The key has ended. | Ask for a new key. |
| 401 | no_timestamp |
No X-Mayotte-Timestamp header. |
Send the time in Unix seconds. |
| 401 | old_timestamp |
The time is more than 5 minutes from ours. | Sign when you send; check your server’s clock. |
| 401 | no_signature |
No X-Mayotte-Signature header. |
Sign the event. |
| 401 | bad_signature |
The signature does not match. | Sign <timestamp>.<body> exactly as sent, with your signing secret. |
| 403 | scope |
The key may not do this. | Ask for a key with this scope. |
| 403 | ip |
The call came from an address the key does not allow. | Call from an allowed address, or tell us your new one. |
| 404 | not_found |
No such path. | See the API reference. |
| 405 | method |
Wrong method. | Use the method in the allow header. |
| 413 | too_large |
The body is over 1 MB. | Send smaller events. |
| 429 | rate |
Too many calls. | Wait for retry-after seconds. |
| 500 | server |
Something failed on our side. | Try again later with the same event id. |
| 502 | unreachable |
We could not be reached. | Try again later. |
| 503 | not_ready |
The API is not ready. | Try again later. |