Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.reflecto.dev/llms.txt

Use this file to discover all available pages before exploring further.

Most Reflecto errors return JSON with a stable error.code you can switch on in client code; authentication failures (401) use a flat shape instead — see the auth shape below. The human-readable message may evolve; the codes will not.

Error shape

Most endpoints return:
{
  "error": {
    "code": "payload_too_large",
    "message": "Payload exceeds 2048 byte limit",
    "details": { "size": 3104, "max": 2048 }
  }
}
details is currently populated only for payload_too_large (413). The byte-length 400 errors (message_too_long, invalid_title, invalid_url, invalid_url_title, invalid_action) returned details: { bytes, max } in earlier API revisions but no longer do — the field is missing entirely on those responses. A future revision will restore it.

Message-text changes from earlier API revisions

The error code values are stable wire contracts and have not changed. The human-readable error.message strings, however, were rewritten when validation moved to Zod schemas. Clients that match on .code are unaffected; clients that display .message verbatim will see new wording:
.codeWhenPrevious .messageCurrent .message
invalid_actioninvalid action URLmust be a valid URLis not a valid URL
invalid_titleempty titletitle must be 1–100 bytes (shared with the over-limit branch)title must not be empty (now distinct)
invalid_titleover-limit titletitle must be 1–100 bytes (shared with the empty branch)title must be ≤ 100 bytes (now distinct)
invalid_messagemessage key omittedmessage is requiredInvalid input: expected string, received undefined
invalid_actionaction url missingeach action requires label + urlSchema default for the missing required field

Auth failure shape

Auth failures use a flat shape so token problems don’t get masked behind nested structure. The full shape — both fields — is shown below:
{
  "error": "missing_token",
  "message": "Authorization: Bearer rfk_live_… required"
}
message is optional. The invalid_token variant omits it (the code alone is actionable):
{
  "error": "invalid_token"
}

Status codes

StatusWhen
200Accepted and enqueued. Check warnings in the body for non-fatal notes.
400Body malformed or a field failed validation.
401Missing, invalid, or revoked bearer token.
403Token exists but lacks scope (e.g. priority above priority_cap).
413Serialized envelope > 2048 bytes.
429Rate limit hit on one of the layers; Retry-After is set.
5xxServer error. Retry with exponential backoff.

Codes

Validation (400)

CodeMeaning
invalid_bodyBody wasn’t JSON, form-encoded, or text.
invalid_messagemessage missing or not a string.
message_too_longmessage exceeds 1500 bytes (UTF-8).
invalid_titletitle is 0 bytes or > 100 bytes (UTF-8).
invalid_priorityNot one of min, low, default, high, urgent.
invalid_urlNot http(s), invalid URL, or > 512 bytes.
invalid_url_titleurl_title > 32 bytes.
invalid_actionMissing label/url, oversized, or non-http(s) scheme.
invalid_devicedevice parameter > 256 chars.

Auth (401)

CodeMeaning
missing_tokenNo Authorization: Bearer … header sent.
invalid_tokenToken format invalid, unknown, or revoked.

Scope (403)

CodeMeaning
priority_cappedToken’s priority_cap is below the requested priority.

Size (413)

CodeMeaning
payload_too_largeSerialized envelope > 2048 bytes.

Rate limit (429)

CodeMeaning
rate_limit_exceededOne of the rate-limit layers tripped. See X-RateLimit-Resource for which one.

Server errors (5xx)

CodeMeaning
internal_errorCatch-all for unhandled exceptions on the server (Redis unavailable, FCM dispatch failure, etc.). Retry with exponential backoff.

Warnings vs errors

Some conditions are surfaced as warnings on a 200 response rather than errors, to keep long-running automations alive:
  • unknown device label: '…' — one of the names in device didn’t match any paired device.
  • device fallback: all entries unknown, delivering to every paired device — every entry was unknown; the send fell back to broadcast.
  • tags truncated to first 5 (got 7) — excess tags dropped.
  • tag #N truncated to 32 bytes — a tag exceeded the per-tag byte cap.
  • actions truncated to first 3 (got 5) — excess action buttons dropped.
  • no paired devices for this token's owner — the request succeeded but produced no enqueues. Useful for cron jobs run during transient unpairing.
  • token scope '…' dropped out-of-scope device(s): … — caller’s device parameter referenced devices outside the token’s scopeDevices.