Errors
The error body, HTTP status codes and the codes Mendloop returns.
Every error from the REST API, ingest and the per-connection webhook receiver has the same JSON body. code is
stable and meant for programs; message is for people; hint says how to fix it. (The one exception is the
GitHub App receiver, /hooks/github/app, which answers {"detail": "…"}.)
Error body#
{
"error": {
"code": "invalid_input",
"message": "Some fields are invalid.",
"hint": "Fix the fields listed in `fields` and try again.",
"request_id": "req_0193c8e5a1b27c3d9e4f5a6b7c8d9e01",
"fields": {
"status": "Input should be 'open', 'resolved' or 'ignored'"
}
}
}| Field | Type | Description |
|---|---|---|
code |
string | Machine-readable code, e.g. issue_not_found |
message |
string | Human-readable message |
hint |
string or null | How to fix it |
request_id |
string or null | The request id, also in the X-Request-ID header. Include it when you report a problem. |
fields |
object | Only for validation errors: field name → message. Nested fields use dots, e.g. params.target_id. |
Status codes#
| Status | Meaning | Common codes |
|---|---|---|
| 400 | The request can't be read | bad_request, invalid_mode, invalid_payload, project_required |
| 401 | No valid credentials | unauthenticated, invalid_authorization, invalid_api_key, publishable_key, missing_key, invalid_key, invalid_signature |
| 403 | Authenticated, but not allowed | permission_denied, missing_scope, api_key_not_allowed, api_key_owner_removed, test_mode_not_allowed, origin_not_allowed, key_project_mismatch, org_inactive, mode_mismatch |
| 404 | Not found, or in the other mode, or outside the projects you can see | not_found, org_not_found, issue_not_found, project_not_found, … |
| 405 | Wrong method for this path | method_not_allowed |
| 409 | Conflicts with the current state | conflict, last_admin, already_member, approval_decided, fix_not_approved, fix_running, … |
| 413 | Body too large | too_large, payload_too_large |
| 415 | Wrong content type | unsupported_media_type |
| 422 | A field is invalid | invalid_input (with fields), invalid_state |
| 423 | A safety switch (read-only or a kill switch) blocks the write | the switch's own code |
| 429 | Too many requests | rate_limited (with Retry-After) |
| 500 | Something failed on Mendloop's side | internal_error |
| 502 | A connected tool returned an error | integration_error |
| 503 | Ingest can't queue events right now | ingest_unavailable (with Retry-After: 5) |
Authentication and permission codes#
| Code | Status | What happened |
|---|---|---|
unauthenticated |
401 | No session and no key was sent |
invalid_authorization |
401 | The Authorization header isn't Bearer <key> |
invalid_api_key |
401 | The secret key is unknown or revoked |
publishable_key |
401 | A pk_ key was sent to the REST API |
org_not_found |
404 | The org doesn't exist, you aren't a member, or the key belongs to another org |
missing_scope |
403 | The key lacks the scope; the message names it |
api_key_not_allowed |
403 | The endpoint needs a signed-in session |
api_key_owner_removed |
403 | The account of the person who created the key is disabled |
permission_denied |
403 | Your role can't do this; the message names the action |
session_required |
403 | The endpoint needs a user, not a key |
test_mode_not_allowed |
403 | Your role can't use test mode |
origin_not_allowed |
403 | A cookie-authenticated write came from another site |
invalid_mode |
400 | Mendloop-Mode was not live or test |
Tip:
Branch on code, not on message. Messages may be reworded; codes don't change within v1.
Note:
A 404 for something you know exists usually means it belongs to the other mode (live or test), or to a
project your membership doesn't include.