Skip to main content

Errors

Errors use RFC 9457 problem details with Content-Type: application/problem+json:

{
"type": "https://docs.glitchmug.com/errors/validation_failed",
"title": "Validation failed",
"status": 422,
"code": "validation_failed",
"detail": "Request validation failed",
"errors": [{ "field": "title", "code": "isLength" }],
"requestId": "2b5a2d89-3a9f-47b4-9f80-a3b6cc7b7934"
}
  • Branch on status and code. title and detail are for people and follow Accept-Language (en, ru).
  • errors lists field problems for 422: field is the JSON path (credits.0.name), code the rule that failed. Schema rules use validator names (isLength, isIn, isNotEmpty, whitelistValidation for unknown fields); checks done by the endpoint use short names (required, invalid, https_required).
  • Include requestId when you report a bug.

Default codes​

When an endpoint has nothing more specific, code follows the status:

Statuscode
400bad_request
401unauthenticated
403forbidden
404not_found
405method_not_allowed
409conflict
413too_large
415unsupported_type
422validation_failed
429rate_limited
451unavailable_legal (taken down on a copyright notice)
500internal
503service_unavailable

Specific codes​

Endpoints document their own codes in the reference. The common ones:

codeWhen
invalid_api_key, scope_missing, bannedSee Authentication
invalid_cursorA cursor that didn't come from page.nextCursor
invalid_idempotency_keyIdempotency-Key isn't 8–128 chars of A-Z a-z 0-9 _ -
idempotency_mismatchSame Idempotency-Key with a different body
idempotency_in_progressThe first request with this key is still running; retry shortly
search_unavailableFull-text search (q) is down; filters without q still work
quota_exceeded, file_too_largeUpload over your storage quota or the size limit