v2.4.2

Error codes

HTTP handlers return JSON for service-level errors. API Gateway can still emit its own small error bodies before Lambda runs.

The only cross-service invariant is that callers must handle a JSON object with a message or error field. New or edited handlers should include requestId and success: false for Lambda-originated errors, but older handlers are not fully uniform.

Status codes

StatusMeaning
200Success, warmup acknowledgement, or an intentional accepted/rejected webhook acknowledgement
400Missing or invalid input, malformed JSON, schema validation failure
401Handler-level token check failed, for example POST /leads/bot/queue
403API Gateway rejected a missing/invalid X-Api-Key, WAF blocked the request, or a handler rejected an allowed-host check
404Resource not configured or lookup target not found
409Duplicate/conflicting write, for example an existing Cloudflare redirect
429Leads token bucket, API Gateway usage-plan throttle, or WAF rate rule
500Upstream failure, unhandled exception, or integration failure

purge has a deliberate exception: POST /post/transition can return 200 with result: "rejected" for validation-style rejects because WordPress webhook delivery treats non-2xx responses as transport failures.

Error shape

json
{
  "message": "BadRequest - Missing Request Attributes",
  "requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "code": "InvalidInput",
  "errors": [
    { "field": "phone_number", "message": "is required" }
  ],
  "success": false
}
FieldPresentNotes
messagecommonHuman-readable summary. API Gateway errors usually contain only this field.
errorcommon in leads/rate-limit pathsMachine-readable or short error token.
requestIdrecommended for Lambda errorsInclude it in support requests when present.
codeservice-specificMachine-readable code, for example InvalidInput.
errorsvalidation failuresField-level detail or schema errors.
successcommon in newer handlersfalse on error.

Do not build clients that require every field in the example. Treat message, error, and requestId as optional unless the per-operation OpenAPI schema states otherwise.

API Gateway errors

Emitted before Lambda, fixed shape:

json
{ "message": "Forbidden" }
json
{ "message": "Missing Authentication Token" }

These responses are not controlled by the Lambda handler.

Rate-limit (429)

The in-handler token bucket used by leads inbound includes rate-limit headers:

http
HTTP/1.1 429 Too Many Requests
x-ratelimit-limit: 100
x-ratelimit-remaining: 0
x-ratelimit-reset: 1710000000000
x-ratelimit-resource: customer@example.com

WAF and API Gateway usage-plan throttles can return 429 or 403 without these in-handler headers because the request never reaches the service code.

Esc