# Creator Guard Platform API

Everything the partner portal does with a creator, from your own system: submit her, complete her listing, send her the consent link, submit her for review and follow her stage and your earnings.

Base URL: `https://api.creator-guard.com/v1`

- [Quickstart — Your first lead in five minutes, in curl, JavaScript or Python.](https://docs.creator-guard.com/quickstart/)
- [Leads — Create, list, read, change and withdraw leads.](https://docs.creator-guard.com/leads/)
- [Listing & review — Complete her profile, get her confirmations, submit for review.](https://docs.creator-guard.com/listing/)
- [API reference — Every endpoint, generated from the OpenAPI 3.1 spec.](https://docs.creator-guard.com/reference/)

## What you need

- A **partner account** with Creator Guard. Access is by invitation: [how to become a partner](https://creator-guard.com/for-partners).
- Accepted **partner terms** (in the portal, or with [`POST /v1/agreements/{type}/accept`](https://docs.creator-guard.com/reference/#op-acceptAgreement)).
- An **API key** (`cg_live_…`, or `cg_test_…` for the [sandbox](https://docs.creator-guard.com/test-mode/)), created in the portal under **Settings → API**. See [API keys](https://docs.creator-guard.com/api-keys/).
- A server-side process that sends HTTPS requests. The key must never reach a browser or an app you ship.

## How it works

1. You create a lead with `POST /v1/leads`; we check whether we already know her and answer with her lead (`lead_…`) and creator number (`CR-1047`).
2. You complete her listing, send her the consent link and submit her for review once `next_actions.can_submit_for_review` is `true`.
3. You follow her `stage`, timeline and earnings with `GET` requests, or let [webhooks](https://docs.creator-guard.com/webhooks/) tell you about every change. See [Lead lifecycle](https://docs.creator-guard.com/lead-lifecycle/).

The rules are the portal's rules, enforced by Creator Guard for every caller: the API and the portal can never disagree about what is allowed. Every lead tells you in `next_actions` what you can do with it right now.

## Conventions

- JSON in and out, UTF-8, at most 1 MB per request body. Times are RFC 3339 in UTC. Money is `{"amount_minor": 150000, "currency": "USD"}`.
- Ids are prefixed (`lead_…`, `acct_…`, `req_…`). Treat them as opaque strings.
- Unknown request fields are rejected with [`400 unknown_field`](https://docs.creator-guard.com/errors/#unknown_field), unknown query parameters with [`400 unknown_parameter`](https://docs.creator-guard.com/errors/#unknown_parameter). Ignore response fields you do not know.
- Every response carries `X-Request-Id` and `X-API-Version`. Quote the request id when you contact [support](https://docs.creator-guard.com/support/).
- Retries are safe with [`Idempotency-Key`](https://docs.creator-guard.com/idempotency/); changes are race-safe with [`If-Match`](https://docs.creator-guard.com/leads/#concurrent-changes).

## Machine-readable spec

The full contract is published as OpenAPI 3.1 at [`/openapi.yaml`](https://docs.creator-guard.com/openapi.yaml). Import it into Postman, Insomnia or a code generator.
