# Public HTTP contract and recovery

API base: `https://843nov3j7f.execute-api.us-east-1.amazonaws.com/v1`.
Read the live `/openapi.json` for exact schemas and confirm `GET /me` creatorId, scopes, capabilities, and limits before writing.

Authenticate with `Authorization: Bearer <gth_ key>` and send JSON using `Content-Type: application/json`. `/openapi.json` is public. Unknown request-body fields are rejected with 400 invalid_request; details.field names the key and details.allowed lists the accepted ones. A route that takes no body accepts no body, an empty body or {}, and refuses any key the same way. A JSON body over 256KB is refused with 413 invalid_request. A path or method the API does not define answers 404 not_found, with or without a key; branch on error.code, not on the message. Preserve casing exactly. Keys never authorize access to other creators' resources. Role, scopes, ownership, and moderation all constrain access.

Allow up to 60 seconds for key revocation or a shortened expiration time to take effect across all endpoints.

Persist a UUID and exact request body before each logical creation. POST /drops accepts 16–128 letters/digits/underscore/hyphen; UUIDs work; any other non-empty value is 400 invalid_request. The key value is case-sensitive. Resend it byte for byte, because a key that differs only in letter case is a different key: it publishes a second drop and consumes another daily slot. Its idempotency is per creator, with a content-derived fallback when omitted. Prefer an explicit key. Terminal results are retained for 24 hours; unresolved attempts keep evidence without automatic expiry. Same key/body replays the original drop when known: 202 with the header Idempotent-Replayed: true. If that drop has since been deleted, the replay answers 404 not_found with details.dropId and publishes nothing; publish again under a new key. Same key with a different body is 409 conflict. After the safe 23-hour backend replay horizon, unresolved requests require reconciliation from existing evidence or support review; they cannot blindly republish. Save successful drop IDs permanently and do not blindly replay a completed publish after its retention window.

POST /card-templates, POST /hunts, and POST /drops/{id}/award-tokens optionally accept keys of 1–128 letters/digits/dot/underscore/colon/hyphen. On these three routes, a key that is empty, blank or outside that pattern counts as absent and is never a 400. The request runs as an ordinary create with no idempotency protection, so check the key against the pattern before relying on it for retries. Those operation records have no automatic expiry. The same key and body replay the original result, not a new entitlement. For a template or hunt, that is the resource as it was created; GET it for its current state. For an award, it is the same JTI, the byte-identical token and the original expiration, with reserveRemaining set to the count the original returned, or null when that count was not recorded. The same key with a different body is 409 conflict. Use new keys for genuinely new operations.

A timeout or 5xx after sending a publish is an unknown outcome, not a rollback. Keep the original key/body, retry with backoff, and GET any known drop ID. The server preserves resolved publish input and quota while reconciling. Do not change templates, media, or body under the existing key. A conflict saying the operation is in progress means retry the same key after Retry-After; a conflict saying reconciliation is required means preserve evidence and seek support. Never bypass an unresolved publish with a new key. Definitive publish_failed is terminal for the old attempt; a desired replacement is a separate operation. A same-key retry whose drop failed answers 503 temporarily_unavailable with details.dropId and a message to resubmit with a new key. GET that drop, and if it reads publish_failed, stop retrying the old key.

Honor Retry-After when present and use bounded exponential backoff with jitter for 429 or retryable failures; the gateway's own request-rate 429 carries no Retry-After. Retry reads safely. Retry creation only with its persisted supported key. Do not retry every POST indiscriminately. Read error.code/message/details; 401/403 require credential/permission correction, 400 requires input correction, and 422 feature_unavailable requires capability-aware input. One 400 is an exception: invalid_request with details.reason REQUEST_FILTERED. The platform request filter refused the call before it ran. Either a field holds text that looks like a file path or markup (for example "../" or "<script"), so rephrase it and retry, or the platform request rate was exceeded, so pause and retry later. It carries no Retry-After and never means a key or permission problem; 403 is not used for it. On POST /drops it leaves no daily slot charged, and a rephrased body is a changed body that needs a new Idempotency-Key. For read_back_unavailable (HTTP 503) with details.mutationApplied true, GET the resource because the mutation committed.

Keep X-Request-Id and resource IDs for diagnosis. Redact credentials, signed URLs, and tokens. Report a polling timeout as the last observed state, not a confirmed failed or successful operation.

Scopes include drops:read/write/publish, uploads:write, templates:read/write, audience:read, awards:write, hunts:read/write, profile:write, webhooks:read/write. `*` retains all API-key capabilities within the role; an explicitly empty list allows /me discovery only. Consult the public schema when a route requires an alternate scope.
