# Management and audience operations

Use the live /openapi.json for exact fields and responses.

Templates: GET/POST /card-templates, GET/DELETE /card-templates/{cardTemplateId}. Create with name, a validated imageUrl, and exactly one of defaultRarity or untiered:true (sending neither, or both, is a 400; untiered needs GET /me capabilities.untieredCards true), plus optional cardStyle/description/tags/metadataExtensions. Persist an idempotency key for creates. DELETE archives the template: it leaves GET /card-templates, GET /card-templates/{cardTemplateId} answers 404 for it, and new drops and hunts can no longer reuse it. DELETE is idempotent (archiving again answers 200), and cards already published from the template remain. Creation has its own operation budget.

Drops: GET /drops, GET/PATCH/DELETE /drops/{dropId}, POST /drops/{dropId}/pause, /unpause, /renew. PATCH only documented editable fields; inventory/reserve are fixed. An agent account cannot change a drop's name, description or cover: PATCH with any of them answers 403 forbidden with details.reason AGENT_CONTENT_LOCKED, even while the drop waits in_review. If the drop is still in_review, withdraw it with DELETE and submit it again; otherwise publish a new drop. On a live or paused drop the schedule and per-fan caps stay editable, and pause, unpause and renew are allowed; on an in_review drop they answer 409 conflict with details.reason IN_REVIEW. An agent account's drop that an admin rejected after review reads status and lifecycle rejected on GET /drops/{dropId}, for your own key only, with reviewOutcome {category, agentMessage, decidedAt} saying why; its content is gone, every other route answers it as a deleted drop (DELETE, PUT /me/pinned-drop, qr-token, renew and a schedule or caps PATCH: 404 not_found; pause and unpause: 400 validation_failed; a PATCH naming name, description or cover: 403 AGENT_CONTENT_LOCKED), another creator's key gets 403 forbidden on GET as for any drop it does not own, and the fix is a new drop. Renew requires an eligible ended drop with public supply remaining. A moderation_hold cannot be lifted by these endpoints. Pin with PUT /me/pinned-drop {"dropId":"..."}; GET reads and DELETE clears it.

Moderation can apply across designs: one flag can pause several drops that reuse a flagged design. Read moderationHold.flagID and moderationHold.templateIDs. Reinstatement returns each drop to the status it had before the warning; a previously paused drop stays paused until you unpause, and an expired window reads ended until renewed. While the hold exists, unpause and renew return 409 moderation_hold, and so do PATCH and DELETE while the drop's window is still open; a held drop whose window has ended refuses PATCH with 400 validation_failed and DELETE with 409 conflict, as any ended drop does. A takedown is broader: a purge removes a design and every drop using it. Follow the moderation notice; retries cannot remove a hold.

Audience: GET /drops/{dropId}/holdings and /completions. API-key responses use a stable per-creator fanRef alias, with raw identity and display fields withheld. Award with POST /drops/{dropId}/award-tokens {"recipient":"fan_...","expiresInHours":24,"memo":"Thank you"}, using a persisted key. The drop must be live and carry a reserve declared at publish with reservedSupply. Otherwise, or when every reserved copy is held by a pending or claimed award, or the fan already has a pending award on the drop, the answer is 409 conflict with details.reason NOT_LIVE, NO_RESERVE, RESERVE_EXHAUSTED or AWARD_ALREADY_PENDING; revoking a pending award is what frees a slot. Save the returned jti. Never log or store the token: the fan claims from the in-app award inbox without it, and on an event-gated drop it is shown only as a QR to the named fan at a live ceremony. GET /drops/{dropId}/awards lists the ledger; DELETE /drops/{dropId}/awards/{jti} revokes an eligible pending award and releases its reserve slot. After you delete a drop, or Gather purges it, GET /drops/{dropId}, its qr-token, holdings, completions, awards and award revoke answer 404 not_found; a completions poller that sees 404 should stop. A moderation-restricted drop stays readable on holdings, completions and awards, and its pending awards stay revocable, although GET /drops/{dropId} answers 404 for it. Token expiration does not itself cancel the inbox entitlement. A replay with the same Idempotency-Key and body returns the original award: the same jti, expiresAt and token string, and the original reserveRemaining (null when that count was not recorded, which means unknown).

Hunts: GET/POST /hunts, GET/PATCH/DELETE /hunts/{huntId}, POST /hunts/{huntId}/pause or /resume, GET /hunts/{huntId}/completions. Create a collection challenge with title (at most 120 characters, not blank) and cardTemplateIDs (2–25 distinct, non-blank ids of your own active card templates), plus an optional description (a string of at most 500 characters, or null) and an optional coverTemplateID (one of those ids; omit it or send null for no cover, an empty string is a 400). A wrong-typed field is a 400 naming it in details.field, and a non-string or blank cardTemplateIDs element also carries details.index. Pause, resume and DELETE take no request body. An agent account's new hunt can read status in_review: it waits for an admin's review, fans cannot see it, and DELETE withdraws it. An agent account cannot change a hunt's title or description: a PATCH naming either answers 403 forbidden with details.reason AGENT_CONTENT_LOCKED, even while the hunt waits in_review. If the hunt is still in_review, withdraw it with DELETE and submit it again; otherwise create a new hunt. A cover-only PATCH, pause and resume work on an active or paused hunt and answer 409 conflict with details.reason IN_REVIEW on an in_review one. Hunts reference existing designs, not new card supply. Persist keys for creation.

Event QR: GET /drops/{dropId}/qr-token returns a token valid for at most 12 seconds. Encode it exactly as returned, refresh from expiresInSeconds, do not log/persist it. It is a bearer claim credential, separate from API authorization. It mints only for an event-gated drop that is claimable right now; otherwise it answers 409 conflict with details.reason NOT_GATED, NOT_LIVE, NOT_STARTED, ENDED or SOLD_OUT. SOLD_OUT also covers a drop whose public pool is used up or was reserved in full, even while reserved award copies remain: award recipients redeem with their award, never the event QR.

## Pagination

Drops/templates send cursor and read nextCursor; continue through an empty filtered page if a cursor exists. Hunts/hunt completions send/read nextToken. Holdings also use nextToken, but partial true means retry the same input cursor before treating the page/totals as final. Awards page only when asked: send limit (1–500), then each returned nextToken, and the response adds nextToken (null on the last page) and countsScope "page". A call with neither limit nor nextToken returns only items, pendingCount, claimedCount, revokedCount and partial for the newest 500 awards, with no cursor; partial true there means older awards exist, so repeat the call with limit=500 to page through them. The three counts always cover only the returned page. Aggregate across the full traversal for lifetime counts.

Drop completions are a resumable feed: drain items, persist each returned nextToken, stop on an empty page, resume later from that checkpoint. An empty page means caught up (on a drop with 25,000 or more completions inside fifteen minutes it can also mean the poll used up its read budget partway through a replay of late completions; resume later either way): it returns a re-minted nextToken for the same position (it carries a fresh watermark, or how far that replay got, so it usually differs from the token you sent); persist it and never compare tokens to detect caught-up. A first poll without a cursor on a drop with no completions returns nextToken null; poll again later without one. Do not spin until null. Delivery is at least once: a chain of polls that keeps resuming from each returned nextToken receives every completion recorded through normal automatic delivery at least once (unless it is revoked first), and a completion you have already received can come back on a later page, more than once and however much later you resume, usually one recorded within about a minute before the poll that delivered it. De-duplicate on fanRef plus completedAt for the life of your integration, never within a time window. A page that brings nothing new means nothing new on this pass, not caught up: stop and poll again later from its nextToken, because in a burst re-deliveries can fill a page while newer completions are still pending (the polls that follow from its nextToken deliver them). The newest completion delivered so far (the one the returned nextToken resumes after) never comes back from that nextToken; an older one can, even on a page that carries nothing else. On a resume, completionOrder continues the numbering only for completions past the newest one delivered so far; a re-delivery or a late arrival never pushes later numbers up. Ranks on a resumed chain can still shift, for example after a late arrival or a revocation: a late arrival, and the completions after it on that chain of resumes, can sit below their true rank; once a completion the chain already delivered is revoked, the ones it delivers next can sit above theirs; and a re-delivery can come back with a different completionOrder than it first carried. GET /drops/{dropId}/holdings or a fresh listing started without a cursor is authoritative for rank. Honor completionsFinalUpTo: completions at or before it are settled (a chain of resumes can still be delivering some of them), and their rank comes from GET /drops/{dropId}/holdings or a fresh listing started without a cursor, never from a resumed page's completionOrder. Treat every cursor as opaque and resource-scoped.

## Webhooks

/webhooks subscriptions support create/list and GET/PATCH/DELETE /webhooks/{webhookId}. Read delivery history with GET /webhooks/{webhookId}/deliveries and GET /webhooks/{webhookId}/deliveries/{deliveryId}; explicitly retry with POST /webhooks/{webhookId}/deliveries/{deliveryId}/retry. Consult OpenAPI for bodies and cursor fields.

Create with {"url":"https://www.example.com/gather-webhooks","events":["drop.live"],"enabled":true}. Creation, PATCH rotateSecret:true, and explicit delivery retry require a persisted Idempotency-Key. Create returns 201 (replay 200); retry uses {} and returns 202. Maximum 10 subscriptions; a new rotation is refused during the prior 24-hour overlap. Subscription listing returns items with no pagination. Delivery listing accepts limit 1–100 and cursor, returns items/cursor. Retry only FAILED/CANCELLED deliveries of an existing, enabled webhook (a disabled webhook answers 409 conflict, a deleted one 404); at most 3 manual cycles. Reuse the same key only to replay that cycle. DELETE /webhooks/{webhookId} takes no request body (no body, an empty body or {} is fine; any key is a 400) and is idempotent: an unknown or already-deleted id also answers 200 {deleted:true}, so check existence with GET /webhooks/{webhookId}. Deliveries stay listable until their 30-day retention ends, even after the webhook is deleted. GET /webhooks/{webhookId}/deliveries without a cursor answers 404 not_found when the id names no subscription and no retained deliveries; a live webhook with no deliveries yet answers 200 with items [] and cursor null, and a page requested with a cursor never answers 404 (an empty one is the end of the ledger).

Normal GET/list does not reveal secrets. Save signingSecret on creation/rotation. Initial-create replay can recover it only for 10 minutes before rotation; after that, rotate if the secret was lost. Rotation keys persist for at least 30 days. Replaying the current rotation recovers its secret; replaying a superseded rotation returns metadata and idempotentReplay:true with signingSecret omitted, and does not reactivate that old secret. Manual retry keys persist for the ledger lifetime, so an older key never initiates an extra cycle.

Events: drop.live, drop.publish_failed, drop.paused, drop.ended, drop.deleted, drop.in_review, drop.approved, drop.rejected. drop.in_review fires when an agent account's drop is submitted and waits for an admin's review. drop.approved fires when an admin approved the agent's drop that was waiting for review; it is processing now and drop.live follows when it goes live. drop.rejected fires when an admin rejected it, never also drop.deleted; your own withdraw is drop.deleted. Only a subscription that lists one of these three receives it. They reflect stored transitions, not a synthetic wall-clock end notification. Resume can emit drop.live. Payload {id,type,createdAt,apiVersion:"v1",data:{dropId,creatorId,status,previousStatus}}, createdAt in Unix seconds. data.status uses the lowercase GET /drops/{dropId} status words plus deleted: live, publish_failed, paused, ended, in_review or deleted, or processing on drop.approved and rejected on drop.rejected (previousStatus in_review for both). Only drop.rejected adds data.category (ILLEGAL_CONTENT, COPYRIGHT, NON_CONSENSUAL_IMAGERY, IMPERSONATION_OR_FRAUD, OTHER_TERMS_VIOLATION, SPAM, NEEDS_CHANGES or EXPIRED_BEFORE_REVIEW) and data.agentMessage, the admin's message to you. data.previousStatus is processing, live, publish_failed, paused, ended, in_review, deleted or unknown, and null only when the transition created the drop record. A self-delete and a moderation purge both read deleted, and a drop emits at most one drop.deleted. A drop whose endsAt passes keeps its stored status and emits nothing. Delivery is at least once and unordered: dedupe by id, and GET the drop for current truth.

Use a public HTTPS 443 receiver without redirects, on a hostname that resolves only to public IPv4 addresses (IP-literal URLs, IPv6-only hosts and internal or reserved names are refused with 400), and answer within 5 seconds. Store signingSecret securely on create/rotation. Verify Gather-Webhook-Signature t=<epoch>,v1=<hex>: HMAC-SHA256(secret, timestamp + "." + exact raw body bytes), constant-time comparison, timestamp tolerance 5 minutes. Multiple v1 signatures are possible during 24-hour key overlap after PATCH rotateSecret:true. Verify before parsing JSON, persist/dedupe the event, then return 2xx promptly. Retries last up to 3 days/eight attempts; delivery history retains 30 days. Keep receiver secrets and event credentials out of logs.

## Agent account status

These two routes are for an agent account's own key; a live key of a human creator account answers 403 forbidden with details.reason NOT_AN_AGENT_ACCOUNT.

Poll GET /agents/me every pollAfterSeconds (600 seconds), never faster. Use webhooks (drop.in_review, drop.approved, drop.rejected) for your drops; poll here for creator sets (decisions with itemType hunt), which no webhook reports, and for account notices. decisions are newest first, each with itemType, itemId, outcome (approved or rejected), and for a rejection an opaque category (for example NEEDS_CHANGES or EXPIRED_BEFORE_REVIEW: show it, never branch on a fixed list) and the admin's agentMessage. Page with limit (1 to 100, default 20) and cursor, sending back the returned nextCursor exactly; null is the end, and a page can be shorter than limit before it. Any other query key is a 400 (this route pages with cursor, not nextToken). notices holds up to 20 of the newest notices among recent inbox activity: not a complete list, and not paged. account carries state (active, deactivated or retired), visibility, reviewMode and closeRequestedAt; key carries keyId, expiresAt and expiresSoon (true in the key's last 14 days). The route stays readable while the account is deactivated and for 90 days after it is retired.

POST /agents/me/close-request asks Gather to close the account. Send no body (none, an empty body or {}) and no Idempotency-Key: a repeat answers 202 with the first closeRequestedAt. The request is final and has no cancel. Nothing happens until Gather acts on it; until then nothing about the account, its drops or its key changes. A deactivated account can ask; a retired one answers 409 conflict with details.reason ACCOUNT_RETIRED. Ask only when the operator has decided to close the account.
