Beta — the platform and this API are in beta. The rules on this page are binding; we may add features and tighten validation without notice.

Build with AI agents

These docs are published for AI coding agents as well as for people. Give your agent the right file and the rules below, and it can write a working integration against the sandbox in one go.

What to give your agent

File What it is Use it for
/llms-full.txt The complete documentation as one Markdown file (about 500 KB): every guide page in sidebar order and the full API reference rendered from the contract — every operation with its scopes and account types, every schema, error code, limit and event type. The default. Put it into the agent's context or let it read the file.
/llms.txt A short index (llmstxt.org format) linking the Markdown version of every page. Agents that fetch only the pages they need.
/openapi.yaml The contract, OpenAPI 3.1. Code generators, typed clients, request validation in your tests.
/<page>.md Every page as Markdown, e.g. /quickstart.md. Each page has Copy page for AI, Open in Claude and Open in ChatGPT buttons under its title. One topic at a time.

The SDKs (TypeScript, Python) and the Postman / Bruno collections are generated from the same contract; an agent may use them instead of raw HTTP.

Claude Code, Cursor and other coding agents

  1. Download the full docs into your project, so the agent reads them like any other file: curl -o docs/creator-guard.md https://docs.creator-guard.com/llms-full.txt (and openapi.yaml next to it if you generate code).
  2. Put your test key (cg_test_…) into the environment the agent's code reads (CG_API_KEY), never into the prompt or a file in the repository.
  3. Start the agent with the prompt below, then describe your task.

In Cursor, add the docs as a documentation source (https://docs.creator-guard.com/llms-full.txt) or reference the downloaded file with @. In Claude Code, reference the file (@docs/creator-guard.md) or keep the rules in your project's CLAUDE.md.

ChatGPT, Claude and other chat assistants

Use Open in ChatGPT or Open in Claude on any page: it opens a new chat with a prompt that points to that page's Markdown. For a whole integration, upload llms-full.txt to the chat (or paste its URL if the assistant can read web pages) together with the prompt below.

Prompt for your agent

Copy it as it is; it holds only facts from these docs and no secrets.

text
You are building an integration with the Creator Guard Platform API (Beta).
Documentation: https://docs.creator-guard.com/llms-full.txt (complete) and
https://docs.creator-guard.com/openapi.yaml (OpenAPI 3.1 contract). Follow them; do not guess fields or endpoints.

Basics
- Base URL: https://api.creator-guard.com/v1 — JSON in and out, UTF-8, at most 1 MB per request body.
  The code samples in the docs read CG_API_BASE as the host WITHOUT /v1 (default https://api.creator-guard.com)
  and append /v1/… themselves; keep one convention so you never call /v1/v1/….
- Auth: header "Authorization: Bearer <key>". Read the key from the environment variable CG_API_KEY.
  Never hard-code it, never log it, never send it to a browser or ship it in an app.
- Sandbox: cg_test_ keys use the SAME base URL and paths; they reach a separate sandbox (made-up data only,
  half of every rate limit, test helpers under /v1/test-helpers/). Build and test everything with a cg_test_
  key first. A cg_live_ key creates and changes real data.
- Check the key with GET /v1/me: account type (referral partner or agency), terms state, limits.

Writes
- Every POST gets an Idempotency-Key header (e.g. a UUID). Generate it once per operation, store it, and send
  the same key with the same body bytes on every retry (store key and body until a final answer). A replayed
  answer carries Idempotent-Replayed: true. 409 idempotency_in_progress = wait and retry;
  422 idempotency_key_reused = you changed the request, use a new key.
- POST /v1/leads: send your own external_id — creating the same external_id again returns that lead (200).
- consent_confirmed must be exactly true and means the creator agreed to be referred and to her data being
  sent. Only send it when that is true.
- Duplicates by Instagram handle: 409 duplicate_own_lead (your lead, see error.lead) or
  409 duplicate_other_referrer (another account has her). Do not retry these; report them.
  The duplicate answers are budgeted (20 per rolling 24 hours, then 429 duplicate_limit_reached).
- To avoid lost updates, send the ETag you read as If-Match on PATCH; 412 precondition_failed = read again.
- Writes need accepted terms; otherwise 403 terms_not_accepted with error.agreement_type. With a live key
  that includes the API Terms (api_terms) and the data protection addendum (api_dpa), each accepted once per
  account by an owner or admin. Do not accept
  terms in code on the user's behalf unless they told you to.

Errors, limits, pagination
- Every error is {"error": {"type", "code", "message", "field", "details", "doc_url", "request_id"}}.
  Branch on error.code (stable), never on message. Log error.request_id. A 502 or 504 without a JSON
  body comes from the gateway during a restart: do not assume every answer parses as JSON.
- Limits per key: 100 requests per minute and 10,000 per day, 25 in flight. Read the RateLimit header.
  On 429 wait the Retry-After seconds and pause the whole queue.
- Retry only network errors, timeouts, 409 idempotency_in_progress, 429 and 5xx — with the same
  Idempotency-Key, using Retry-After or exponential backoff. Never retry other 4xx unchanged: fix the request.
- Lists: limit 1-100 (default 25), newest first; pass next_cursor as starting_after until has_more is false.
- Unknown request fields or query parameters are rejected (400 unknown_field / unknown_parameter);
  ignore response fields you do not know.

Webhooks
- Verify every delivery: CG-Signature is "t=<unix time>,v1=<hex>" (one v1 per active secret). Compute
  HMAC-SHA256 of "<t>.<raw body>" with the whole secret (whsec_…) as key, compare in constant time with a
  v1, and accept only if t is at most 5 minutes old. Use the raw body bytes, not re-serialised JSON.
- Store the event and answer 2xx within 10 seconds, process later. Deliveries are at least once and not in
  order: skip a CG-Event-Id you already processed, and per object drop an event whose sequence is not higher
  than the one you applied.

Never
- Never record a creator's consent, 18+ confirmation or terms through an app of the account that referred
  her (403 referrer_app_not_allowed). She gives them only on Creator Guard's own pages — send her the
  consent link (consent.url of the 201, or POST /v1/leads/{id}/consent-link).
- Never put real creator data into the sandbox, and never use made-up data with a live key.
- Never store keys, webhook secrets or creator access tokens in source code, prompts or logs.
- Never work around rate limits, duplicate rules or the review: they are the platform's rules.

Rules behind the prompt

Each line of the prompt comes from a page of these docs:

Check what the agent built

  • Run it against the sandbox with a cg_test_ key and play our part with the test helpers: confirm the lead, then approve-listing.
  • Make it send the same create twice with the same Idempotency-Key: the second answer must be the first one, with Idempotent-Replayed: true.
  • Send a webhook test (POST /v1/webhook-endpoints/{id}/test) and check that the signature check accepts it — and refuses the same body with one byte changed.
  • Search the code and its git history for cg_live_ and cg_test_: a key must never be there (the key pattern works in secret scanners).