# Gather Creator API: full documentation This file contains the complete guide and portable skill references. Inspect the live contract before writing. Source links are relative to this file. Full request/response schemas are available in [openapi.json](openapi.json). --- Source: [README.md](README.md) # Gather Creator API Publish and manage Gather drops from any HTTPS client or AI agent using a creator's `gth_` API key. No Gather repository, AWS account, GraphQL client, or installed skill is required. Every operation documented here is released. The live [OpenAPI document](https://843nov3j7f.execute-api.us-east-1.amazonaws.com/v1/openapi.json) and `GET /me` are authoritative for available operations, capabilities, and limits. API base URL: `https://843nov3j7f.execute-api.us-east-1.amazonaws.com/v1`. A human must create a Gather account, generate a creator API key in **Settings → AI access**, and securely provide it to the agent. Follow [Obtain an API key](quickstart.md#obtain-an-api-key) before making authenticated requests. The agent then acts on behalf of that human's account. Verify the creator identity, granted scopes, and current capabilities with `GET /me` before writing. - [Quickstart](quickstart.md): authenticate, upload, preview, publish, and verify. - [API reference](api-reference.md): routes, scopes, supply rules, pagination, and webhooks. - [Troubleshooting](troubleshooting.md): retries, errors, asynchronous publishing, and reconciliation. - [Portable agent skill](skill/SKILL.md): copy the entire `skill/` folder into your agent's skill directory, or give the agent this file and its references as ordinary documentation. It uses public HTTP endpoints only. The API supports DIRECT random claims, PACK drops, CHOICE card selection, schedules, event QR gates, reusable card templates, card styling, reserved creator awards, audience summaries, creator hunts, profile pinning, scoped keys, template lookup/archive, durable idempotency for template/hunt/award creation, and drop-status webhooks. Availability and account limits come from `GET /me`; ownership, creator role, and moderation rules still apply. The optional [JavaScript client](sdk/README.md) is available as source with TypeScript declarations; it is not a published npm package. HTTP examples work without it. Persist an idempotency key for retries across process restarts. This API does not issue API keys, mint a fan's claim on their behalf, modify minted on-chain metadata, create app-only collaborations, or upload fresh video/audio. It can reuse an eligible existing template whose media was created through another supported Gather surface. Publishing a drop creates inventory; it does not mean every card has already been minted on chain. --- Source: [quickstart.md](quickstart.md) # Quickstart The examples use `curl`; any HTTPS client or AI agent can make the same requests. ## Obtain an API key A human must create a Gather account, generate a creator API key, and provide it to the agent: 1. Create a Gather account and sign in. Complete any creator eligibility or verification required for API access. 2. In the Gather app, open **Settings → AI access** and select **Generate key**. 3. Copy the full `gth_` key when it is shown; the full key is displayed only once. 4. Securely provide the key to the agent through its credential or secret store, or set `GATHER_API_KEY` in the agent's runtime. The agent acts on behalf of the human's account, within the key's permissions and Gather's limits. Account signup and key generation are completed by the human. If no key is configured, the agent should ask the human to complete these steps before making authenticated requests. Keep the key out of prompts, screenshots, logs, source files, and browser frontends. If **AI access** is unavailable, check the account's creator eligibility and whether API access is available for that account. ## 1. Discover the account and contract ```sh export GATHER_BASE_URL='https://843nov3j7f.execute-api.us-east-1.amazonaws.com/v1' # Set GATHER_API_KEY securely in your environment. curl --fail-with-body "$GATHER_BASE_URL/me" \ -H "Authorization: Bearer $GATHER_API_KEY" curl --fail-with-body "$GATHER_BASE_URL/openapi.json" ``` Check `creatorId`, `scopes`, `capabilities`, and `limits`. `limits.publish.dailyRemaining` is the effective remaining daily headroom; the underlying budgets can differ. Use the current supply limits from this response. A key's scopes cannot grant permissions above its role or access another creator's resources. ## 2. Upload and validate art ```sh curl --fail-with-body "$GATHER_BASE_URL/uploads" \ -H "Authorization: Bearer $GATHER_API_KEY" \ -H 'Content-Type: application/json' \ --data '{"files":[{"filename":"card.png","purpose":"card"}],"createOnly":true}' ``` The response has `uploads[]`, each with `uploadId`, `uploadUrl`, `publicUrl`, `method`, `headers`, and `expiresInSeconds`. `headers` always carries `Content-Type`, `Cache-Control` and `Content-Disposition`; because this request sent `createOnly: true`, it also carries `If-None-Match: *` whenever the URL was signed create-only. PUT the raw image bytes to `uploadUrl` using **every returned header exactly**. Do not send your Gather Authorization header to that URL. The URL normally expires after 900 seconds. For example, substitute the returned values: ```sh curl --fail-with-body -X PUT 'RETURNED_UPLOAD_URL' \ -H 'Content-Type: RETURNED_CONTENT_TYPE' \ -H 'Cache-Control: RETURNED_CACHE_CONTROL' \ -H 'Content-Disposition: RETURNED_CONTENT_DISPOSITION' \ -H 'If-None-Match: *' \ --data-binary @card.png ``` Include the `If-None-Match: *` line only when `headers` returned it. `Content-Type`, `Content-Disposition` and a returned `If-None-Match: *` are signed: omitting or changing one makes the PUT fail with HTTP 403. `Cache-Control` is not signature-checked, but send it as returned so the stored art keeps its caching directive. A create-only URL creates its object once; replaying a successful PUT returns HTTP 412. Without `createOnly: true` the URL carries only the three headers and is not create-only. After an uncertain PUT, poll the same upload ID to check whether it succeeded. If a new upload is needed, request a new upload URL. Never remove or weaken the returned condition. Poll the validation result with a short delay between requests: ```sh curl --fail-with-body "$GATHER_BASE_URL/uploads/RETURNED_UPLOAD_ID" \ -H "Authorization: Bearer $GATHER_API_KEY" ``` Continue only after `status: "valid"`. `pending` means wait; `rejected` is terminal and includes a reason; `error` requires re-uploading. A successful PUT alone is insufficient. For multiple uploads use `GET /uploads?ids=ID1,ID2`; it returns `items[]`. Up to 12 files can be presigned together. Card art accepts JPEG, PNG, WebP, and GIF; cover art excludes GIF. Card art must be exactly 2:3 portrait and at least 1080x1620; cover art must be exactly 2.5:1 landscape and at least 1500x600. Files are limited to 10 MB and 8192 px per side. Other sizes are `rejected`, and the reason states the size to use. Use a fresh raw upload within its 24-hour validation-evidence window. For later reuse, save/reuse a card template or upload again. Do not overwrite an already validated object: publication checks the actual validated bytes. If an older GIF is refused because its validation evidence is no longer sufficient, upload a new copy and wait for `valid`. ## 3. Prepare and preview one immutable publish request Generate a UUID once and persist it with the request body before submitting. Use this same key and body for every retry of this logical publish, including after a timeout or process restart. Resend the key byte for byte: the value is case-sensitive, so a key that differs only in letter case is a different key and can publish a second drop. ```sh export GATHER_PUBLISH_KEY='REPLACE_WITH_ONE_PERSISTED_UUID' ``` Create `drop.json` with the validated `publicUrl`. This sample uses a supply of 100; adjust it to the current `GET /me.limits.direct` window before submitting. ```json { "name": "First collection", "type": "direct", "perFanLimit": 1, "rarityMode": "tiered", "totalSupply": 100, "cards": [ {"name": "First card", "rarity": "COMMON", "imageUrl": "RETURNED_PUBLIC_URL"} ] } ``` Preview the computed supplies and validation results: ```sh curl --fail-with-body "$GATHER_BASE_URL/drops" \ -H "Authorization: Bearer $GATHER_API_KEY" \ -H 'Content-Type: application/json' \ -H "Idempotency-Key: $GATHER_PUBLISH_KEY" \ -H 'X-Dry-Run: true' --data-binary @drop.json ``` A successful preview returns HTTP 200 with `dryRun`, `wouldPublish`, and `checks`. Inspect `wouldPublish.cards`, `printedSupply`, `reservedSupply`, `claimableSupply`, and `totalCardCopies`. Read `checks.notValidated`: a preview does not reserve capacity or test the idempotency record's current state. It consumes no daily publish slot. ## 4. Publish and verify Once the request matches your intent, repeat it without the dry-run header: ```sh curl --fail-with-body -D publish-headers.txt "$GATHER_BASE_URL/drops" \ -H "Authorization: Bearer $GATHER_API_KEY" \ -H 'Content-Type: application/json' \ -H "Idempotency-Key: $GATHER_PUBLISH_KEY" \ --data-binary @drop.json ``` HTTP 202 returns an accepted receipt containing `dropId` and `pollAfterSeconds`. Save the ID immediately. After that delay, GET the canonical resource: ```sh curl --fail-with-body "$GATHER_BASE_URL/drops/RETURNED_DROP_ID" \ -H "Authorization: Bearer $GATHER_API_KEY" ``` Poll with bounded backoff until `status` is `live` or `publish_failed`. While `processing`, use `slotGeneration` when present for progress. A scheduled drop can already be `live` while `lifecycle` is `upcoming`; check `claimable`, `claimBlockedReason`, and `claimRequiresEventToken` before telling fans they can claim. Return the server's `shareUrl`, not a hand-built link. On timeout, connection failure, or 5xx, the publish may already exist. Retry the exact persisted key and body; never switch keys merely to get past an uncertain result. One 503 is not uncertain: when its message says the publish failed and `details.dropId` names a drop, that drop is `publish_failed` and the same key will keep returning this 503. GET the drop; a replacement publish is a new operation with a new key. Follow [Troubleshooting](troubleshooting.md) for terminal failure or reconciliation messages. --- Source: [api-reference.md](api-reference.md) # Creator API reference All paths below are relative to the API base URL. Consult the live public `GET /openapi.json` for complete schemas. Send `Authorization: Bearer gth_...` except when reading that public document. JSON bodies use `Content-Type: application/json`. Unknown request fields are rejected, and a route that takes no body accepts no body, an empty body or `{}` and refuses any key; do not send app/GraphQL fields that are absent from the REST contract. A request body over 256 KB answers 413 `invalid_request` on every route that reads a body. Allow up to 60 seconds for key revocation or a shortened expiration time to take effect across all endpoints. A human creates the Gather account and generates the creator API key, then securely provides that key to the agent. See [Obtain an API key](quickstart.md#obtain-an-api-key) for the account setup and key-generation steps. ## Routes and permissions `*` allows all API-key scopes subject to role, ownership, and moderation. Legacy keys without a scopes field retain that behavior. An explicitly empty scope list allows discovery via `/me` only. A `|` below means either scope is sufficient. Some reads still require the creator role. | Routes | Purpose | Scope | | --- | --- | --- | | `GET /me` | Identity, capabilities, limits, scopes | Any valid key | | `POST /uploads`; `GET /uploads`; `GET /uploads/{uploadId}` | Presign art; check validation | `uploads:write` | | `GET /card-templates` and `GET /card-templates/{cardTemplateId}` | Browse or retrieve reusable cards | `templates:read` \| `templates:write` | | `POST /card-templates`; `DELETE /card-templates/{cardTemplateId}` | Create or archive a template | `templates:write` | | `POST /drops` | Preview or publish | `drops:publish` | | `GET /drops` | List owned drops | `drops:read` | | `GET /drops/{dropId}` | Canonical drop, progress, claimability | `drops:read` \| `drops:write` \| `drops:publish` \| `profile:write` | | `PATCH /drops/{dropId}`; `DELETE /drops/{dropId}` | Edit supported fields or delete | `drops:write` | | `POST /drops/{dropId}/pause`, `/unpause`, `/renew` | Change availability | `drops:write` | | `GET /drops/{dropId}/qr-token` | Short-lived event claim token | `drops:write` | | `GET /drops/{dropId}/holdings`, `/completions`, `/awards` | Creator's audience/award records | `audience:read` | | `POST /drops/{dropId}/award-tokens`; `DELETE /drops/{dropId}/awards/{jti}` | Issue or revoke an award | `awards:write` | | `GET /me/pinned-drop` | Read profile pin | `drops:read` \| `profile:write` | | `PUT /me/pinned-drop`; `DELETE /me/pinned-drop` | Set or clear profile pin | `profile:write` | | `GET /hunts`; `GET /hunts/{huntId}` | List or retrieve hunts | `hunts:read` \| `hunts:write` | | `POST /hunts`; `PATCH /hunts/{huntId}`; `DELETE /hunts/{huntId}` | Create, edit, archive | `hunts:write` | | `POST /hunts/{huntId}/pause`, `/resume` | Pause or resume hunt | `hunts:write` | | `GET /hunts/{huntId}/completions` | Hunt completion records | `audience:read` | | `GET /webhooks` and subscription/delivery GET routes | Read subscriptions and deliveries | `webhooks:read` \| `webhooks:write` | | Webhook POST/PATCH/DELETE routes | Manage subscriptions and retry deliveries | `webhooks:write` | ## Upload integrity PUT raw bytes using every returned upload header exactly, including `Content-Type`, `Content-Disposition`, `Cache-Control`, and `If-None-Match: *` whenever it is returned. Do not send the Gather Authorization header to the upload destination. `Content-Type`, `Content-Disposition`, and the create-only condition are signed; changing or removing any of them makes storage refuse the PUT with HTTP 403. `Cache-Control` is not signature-enforced, but omitting or changing it stores the art without its caching directive. `If-None-Match: *` is returned only when the `POST /uploads` body sets `createOnly: true`; such a URL creates its object once, and a repeat PUT after a successful one returns HTTP 412. After an uncertain response, poll the same upload ID; obtain a new presign for a new upload if necessary, keeping any returned condition intact. Proceed only after validation reports `valid`. Validation also enforces geometry: card art must be exactly 2:3 and at least 1080x1620, cover art exactly 2.5:1 and at least 1500x600 (covers cannot be GIF), within 10 MB and 8192 px per side; art outside the geometry is `rejected`, and its `reason` names the nearest accepted size. An older GIF refused for insufficient validation evidence needs a fresh upload and validation; an accessible image URL alone is not admission evidence. ## Publishing and supply Use lowercase `type` and explicit `rarityMode` whenever reusing templates. A drop has 1–50 cards, each using exactly one of `imageUrl` or `cardTemplateID`. A fresh card requires `name` (at most 25 UTF-8 bytes after trimming). Template response IDs are spelled `cardTemplateId`; the publish input field is `cardTemplateID`. A reused template supplies its saved name, art, media, and styling. Omit those overrides; neither art nor styling can be replaced on a reused card, and an explicit name must match its stored name. | Type | Supply expression | Fan limits and behavior | | --- | --- | --- | | `direct` | Tiered: `totalSupply`; untiered: `totalSupply` or every `cards[].supply` | Required `perFanLimit`; fans claim supply-weighted random cards | | `pack` | `packCount` and `cardsPerPack`, plus `totalSupply` equal to their product; untiered may instead give every `cards[].supply`, summing to that product | Required `perFanLimit` counts packs; at least 4 designs; 3–5 cards per pack, never more than the number of designs; one standard pack | | `choice` | Required explicit `supply` on every card; no `totalSupply` | Fans select a card; omit `perFanLimit`; optional `perFanPerCardCap` and `perFanTotalCap` | Tiered DIRECT/PACK cards use `COMMON`, `UNCOMMON`, `RARE`, `EPIC`, or `LEGENDARY`; the service computes the per-card split from the aggregate. Explicit per-card supply is refused for tiered DIRECT/PACK. Untiered cards omit rarity and require the capability. CHOICE supports explicit supply with or without rarity. Never mix aggregate and per-card supply. Read account-specific ceilings from `/me` and inspect the preview's actual distribution; rarity names alone are not exact odds. `reservedSupply` withholds DIRECT editions or whole PACK packs for awards. It is immutable after publication and forbidden for CHOICE. Public supply is printed supply minus reserve. A fully reserved DIRECT with `totalSupply: 1`, `reservedSupply: 1`, `perFanLimit: 1`, and one tiered card is an award-only 1-of-1; its public supply is zero. A CHOICE card with `supply: 1` is a publicly selectable 1-of-1. A partly reserved ungated drop still allows public claims from its public pool. Use `startsAt` and `endsAt` as ISO-8601 strings with an explicit offset. Omit start to start immediately; omit end for an open-ended drop. Do not send `duration` or null schedules. A configured duration ceiling applies; the default ceiling is 365 days. Omit cover art to use a card mosaic. Explicit `gate: {"type":"event","eventName":"My event"}` requires an event token for claims. Omit the gate for ordinary claims; plural `gates` is not a REST field. Optional `cardStyle` requires all four axes: `skin`, `foil`, `motif`, `finishStyle`; `layout` is optional. Consult OpenAPI for enum values. For example `{"skin":"STAGE","foil":"NONE","motif":"NONE","finishStyle":"OVERLAY"}`. `CLEAN` is not writable. Fresh upload authoring supports images/GIF, not video/audio. Descriptions, tags, and metadata extensions are off-chain display data, not an edit to minted metadata. `status` is publication state, while `lifecycle` combines state, schedule, and supply. `live` alone does not guarantee public claims are open. An agent account's drop can read `in_review` in both: it waits for an admin's review, fans cannot see it, it cannot be changed, and DELETE withdraws it. An agent account's drop keeps its name, description and cover, and its creator set keeps its title and description: a PATCH that includes any of them answers 403 `forbidden` with `details.reason` `AGENT_CONTENT_LOCKED`, even while the item waits `in_review`. If it is still `in_review`, withdraw it with DELETE and submit it again; otherwise publish a new one. On a live or paused item the schedule, the per-fan caps and a set's cover stay editable, and pause, unpause and renew are allowed; on an `in_review` item they answer 409 `conflict` with `details.reason` `IN_REVIEW`. If an admin rejects it, `GET /drops/{dropId}` with the agent's own key reads `rejected` in both, with `reviewOutcome` (`category`, `agentMessage`, `decidedAt` in Unix seconds) saying why; the drop's name, description, cover, cards and packs are gone, and every other route answers it as a deleted drop: `DELETE`, `PUT /me/pinned-drop`, `qr-token`, `renew` and a `PATCH` of the schedule or caps answer 404 `not_found`; `pause` and `unpause` answer 400 `validation_failed`; a `PATCH` that names `name`, `description` or `coverImageUrl` answers 403 `forbidden` with `details.reason` `AGENT_CONTENT_LOCKED`; `holdings`, `completions`, `awards` and an award revoke answer 404 `not_found`; and `award-tokens` answers 409 `conflict` with `details.reason` `NOT_LIVE`. Another creator's key gets 403 `forbidden` on `GET`, as for any drop it does not own. The fix is a new drop. `reviewOutcome` is null on every other drop. `claimUnit` distinguishes editions from packs. `totalCardCopies` in a preview and `totalSupply` in a canonical drop count cards; `printedSupply`, `reservedSupply`, and `claimableSupply` count claim units. `publicClaimedSupply` excludes reserve redemptions. `claimable` and `claimBlockedReason` reflect status, schedule, and the whole printed run, reserve included, so on a drop with a reserve they can read claimable after the public pool is used up: public claims are open only while `claimable` is true and `publicClaimedSupply` is below `claimableSupply`. ## Idempotency and retries Persist a UUID with each logical create request before sending it. Keep both the key and the exact payload across retries. | Operation | Key support | Retention and replay | | --- | --- | --- | | `POST /drops` | Recommended `Idempotency-Key`, 16–128 letters/digits/underscore/hyphen, matched exactly (case-sensitive); content-derived fallback if omitted; a malformed key is a 400 | Per creator; terminal results retained for 24 hours. Unresolved attempts retain evidence without automatic expiry; same body returns the original drop (202, `Idempotent-Replayed: true`) when known, or 404 `not_found` with `details.dropId` if that drop has since been deleted, and a publish that failed answers 503 (publish again under a new key); different body conflicts | | `POST /card-templates`, `POST /hunts`, `POST /drops/{dropId}/award-tokens` | Optional key, 1–128 letters/digits/dot/underscore/colon/hyphen; an empty value, or one outside that form, is ignored and the request runs as an unkeyed create with no replay protection | Durable per-creator operation record without automatic expiry; same payload replays the original result, different payload conflicts | | Webhook creation, secret rotation, and explicit delivery retry | Required key in the same 1–128-character form | Persist the key for that operation; reuse it after a lost response, not for a later distinct rotation or retry | A replayed award returns the original token string, JTI, and expiration, and the `reserveRemaining` the original answer carried (`null` when that count was not recorded; treat `null` as unknown). It does not create another entitlement or renew the token, and it returns that same original result even after the award was claimed or revoked; read the award ledger for its current status. A token's expiration does not by itself revoke the corresponding inbox award. Use a new key only for an intentionally new operation. Publish timeouts and 5xx are uncertain outcomes: a backend commit may have succeeded. The server retains the charged attempt and its resolved input without a TTL while reconciling it. Retry the same key and original body; do not rehydrate templates or upload new art into that retry. A definitive failure can release the quota according to its error category. A 400 with `details.reason: "REQUEST_FILTERED"` means the platform request filter refused the request before it ran, and no publish slot is kept: if a field carries text that looks like a file path or markup (for example `../` or `,v1=`, against HMAC-SHA256 of `.` using the secret, with a five-minute timestamp tolerance and a constant-time comparison. Verify bytes before JSON parsing or reserializing. `Gather-Webhook-Id` identifies the event. Rotation with `rotateSecret: true` overlaps the previous signing key for 24 hours, and the header can contain multiple `v1` signatures; accept a valid signature from a currently trusted key. Authentication does not replace event-ID deduplication. Normal GET/list responses do not expose signing secrets. An initial create replay can recover the original secret only during its first ten minutes and before rotation. If that opportunity has passed and the secret was not saved, perform an authorized rotation and save its result. Rotation keys are retained for at least 30 days: replaying the current rotation can recover its secret; replaying a superseded rotation returns metadata and `idempotentReplay: true` without revealing or reactivating the old secret. Manual retry keys are retained for the delivery ledger's lifetime, so revisiting an older retry key cannot start another cycle. --- Source: [troubleshooting.md](troubleshooting.md) # Troubleshooting Read the HTTP status, `error.code`, `error.message`, and `error.details` together. Save `X-Request-Id`, operation key, and resource ID for support. Redact API keys, upload URLs, award/QR tokens, and webhook secrets. | Symptom | Action | | --- | --- | | 401 | Check key validity and expiry. Do not loop retries with an invalid key. | | 403 | Check creator role, scopes, resource ownership, and account restrictions. A broader scope cannot override ownership. | | 404 `not_found` | Branch on the code, then read the message. A path or method the API does not define answers 404 whether or not a key is sent (the message reads `no such route`); check the live `/openapi.json`. On a drop route it means the drop does not exist, was deleted or purged, is moderation-restricted, or (on `PATCH`, `pause`, `unpause` and `renew`) belongs to another creator (`GET /drops/{dropId}` and the routes that read the drop first answer 404 for a restricted drop, while its holdings, completions and awards stay readable). After a deletion its holdings, completions and awards routes answer 404 too, so stop polling them. A keyed `POST /drops` retry answers 404 with `details.dropId` when the drop that key created has since been deleted: nothing is created and no slot is used; publish again only as a new operation with a new key. | | 400 `invalid_request` | Correct the named field. Use REST names and casing; omit unsupported/unknown fields. | | 400 `invalid_request` with `details.reason` `REQUEST_FILTERED` | The platform request filter refused the request before it ran. Either a field carries text that looks like a file path or markup (for example `../` or `