# Creator dashboards

Every creator you submit has steps only she can take: consent to be introduced to agencies, confirm she is 18 or older, check her profile and follow her placement. You choose where she takes them:

| | Hosted pages | Your own dashboard |
|---|---|---|
| You build | nothing: you send her links | an OAuth app and your own screens |
| She signs in | on `app.creator-guard.com` | on our sign-in page with her own login, to approve your app |
| She uses | the consent page and the creator portal | your screens, backed by the creator API |
| The consent text | we show it | you show the exact versioned text we give you |

Both ways record the same evidence for every decision in her [consent ledger](https://docs.creator-guard.com/consent-ledger/), and she can always use the creator portal as well.

## Hosted pages

1. **Consent link.** `POST /v1/leads/{id}/consent-link` returns her personal consent page. She reads the text, confirms she is 18 or older and agrees or declines.

curl:

```bash
BASE="${CG_API_BASE:-https://api.creator-guard.com}"
auth() { printf 'Authorization: Bearer %s\n' "$CG_API_KEY"; }   # read through a file descriptor: the key never shows in `ps`
api() {  # api METHOD PATH [JSON] [HEADER] → body on stdout; HTTP >= 400 → status + body on stderr, return 1
  local out
  out="$(curl -sS -X "$1" -H @<(auth) -H "Content-Type: application/json" ${4:+-H "$4"} ${3:+--data "$3"} \
    -w "\n%{http_code}" "$BASE$2")"
  [[ "${out##*$'\n'}" -lt 400 ]] || { echo "${out##*$'\n'} ${out%$'\n'*}" >&2; return 1; }
  printf "%s\n" "${out%$'\n'*}"
}
lead='{"external_id": "docs-sample-consent-link", "creator_name": "Docs Sample",
  "other_contact": "Telegram: @docs_sample", "platforms": ["OnlyFans"], "consent_confirmed": true}'
id="$(api POST /v1/leads "$lead" "Idempotency-Key: $(uuidgen)" | jq -r .id)"
link="$(api POST "/v1/leads/$id/consent-link" "" "Idempotency-Key: $(uuidgen)")"
# Send .url to her (it is personal: do not log it). She confirms consent and 18+ herself.
echo "consent link valid until $(jq -r .expires_at <<<"$link")"
```

JavaScript:

```js
const BASE = process.env.CG_API_BASE ?? 'https://api.creator-guard.com';
const headers = { Authorization: `Bearer ${process.env.CG_API_KEY}`, 'Content-Type': 'application/json' };
const post = (path, body) => fetch(`${BASE}${path}`, { method: 'POST', body: body && JSON.stringify(body),
  headers: { ...headers, 'Idempotency-Key': crypto.randomUUID() } });
const created = await post('/v1/leads', { external_id: 'docs-sample-consent-link', creator_name: 'Docs Sample',
  other_contact: 'Telegram: @docs_sample', platforms: ['OnlyFans'], consent_confirmed: true });
const lead = await created.json();
if (!created.ok) throw new Error(`${created.status} ${lead.error.code}: ${lead.error.message}`);
const res = await post(`/v1/leads/${lead.id}/consent-link`);
const link = await res.json();
if (!res.ok) throw new Error(`${res.status} ${link.error.code}: ${link.error.message}`);
// Send link.url to her (it is personal: do not log it). She confirms consent and 18+ herself.
console.log('consent link valid until', link.expires_at);
```

Python:

```python
import json
import os
import urllib.error
import urllib.request
import uuid

BASE = os.environ.get("CG_API_BASE", "https://api.creator-guard.com")

def call(method, path, body=None, headers=None):
    """(status, headers, JSON body); 4xx/5xx are returned, not raised: they carry error.code."""
    req = urllib.request.Request(BASE + path, method=method, data=None if body is None else json.dumps(body).encode(),
                                 headers={"Authorization": "Bearer " + os.environ["CG_API_KEY"],
                                          "Content-Type": "application/json", **(headers or {})})
    try:
        with urllib.request.urlopen(req, timeout=30) as res:
            return res.status, res.headers, json.load(res)
    except urllib.error.HTTPError as err:
        return err.code, err.headers, json.load(err)

def fail(status, data):
    raise SystemExit(f"{status} {data['error']['code']}: {data['error']['message']}")

LEAD = {"external_id": "docs-sample-consent-link", "creator_name": "Docs Sample",
        "other_contact": "Telegram: @docs_sample", "platforms": ["OnlyFans"], "consent_confirmed": True}
status, _, lead = call("POST", "/v1/leads", LEAD, {"Idempotency-Key": str(uuid.uuid4())})
if status not in (200, 201):
    fail(status, lead)
status, _, link = call("POST", f"/v1/leads/{lead['id']}/consent-link", None, {"Idempotency-Key": str(uuid.uuid4())})
if status != 200:
    fail(status, link)
# Send link["url"] to her (it is personal: do not log it). She confirms consent and 18+ herself.
print("consent link valid until", link["expires_at"])
```

2. **Claim link.** `POST /v1/leads/{id}/claim-link` returns a link, valid for 7 days and usable once, where she chooses her own email address and password for the creator portal. Nobody else ever sets or learns her password.
3. She signs in to the creator portal to see her status, edit her profile, manage her photos, give or withdraw her consent and contact support.

Follow the result with `GET /v1/leads/{id}/confirmations` or the `consent.granted`, `consent.revoked` and `age_confirmation.confirmed` [webhook events](https://docs.creator-guard.com/webhooks/). Details: [Hosted pages](https://docs.creator-guard.com/hosted-pages/).

## Your own dashboard

1. Register an OAuth app with `POST /v1/oauth-apps` and ask only for the scopes your screens need.
2. Send her through the authorization flow (PKCE `S256`) described in [OAuth](https://docs.creator-guard.com/oauth/). She can connect your app only if your account referred her or holds a paid reservation for her.
3. Call the [creator API](https://docs.creator-guard.com/creator-api/) with her access token — for example her current status:

curl:

```bash
BASE="${CG_API_BASE:-https://api.creator-guard.com}"
auth() { printf 'Authorization: Bearer %s\n' "$CG_API_KEY"; }   # read through a file descriptor: the token never shows in `ps`
api() {  # api METHOD PATH [JSON] [HEADER] → body on stdout; HTTP >= 400 → status + body on stderr, return 1
  local out
  out="$(curl -sS -X "$1" -H @<(auth) -H "Content-Type: application/json" ${4:+-H "$4"} ${3:+--data "$3"} \
    -w "\n%{http_code}" "$BASE$2")"
  [[ "${out##*$'\n'}" -lt 400 ]] || { echo "${out##*$'\n'} ${out%$'\n'*}" >&2; return 1; }
  printf "%s\n" "${out%$'\n'*}"
}
# CG_API_KEY here is the creator's access token from the OAuth flow (1 hour); 401 → refresh it at /oauth/token.
me="$(api GET /v1/creator/me)"
echo "stage: $(jq -r .stage <<<"$me"), blockers: $(jq -r '.next_actions.blockers // [] | join(", ")' <<<"$me")"
```

JavaScript:

```js
const BASE = process.env.CG_API_BASE ?? 'https://api.creator-guard.com';
// The creator's access token from the OAuth flow (1 hour); refresh it with her refresh token at /oauth/token.
const res = await fetch(`${BASE}/v1/creator/me`, { headers: { Authorization: `Bearer ${process.env.CG_API_KEY}` } });
const me = await res.json();
if (res.status === 401) throw new Error(`token ${me.error.code}: refresh it, or ask her to connect again`);
if (!res.ok) throw new Error(`${res.status} ${me.error.code}: ${me.error.message}`);
console.log('stage:', me.stage, 'blockers:', (me.next_actions.blockers ?? []).join(', ') || 'none');
```

Python:

```python
import json
import os
import urllib.error
import urllib.request

BASE = os.environ.get("CG_API_BASE", "https://api.creator-guard.com")

def call(method, path, body=None, headers=None):
    """(status, headers, JSON body); 4xx/5xx are returned, not raised: they carry error.code."""
    req = urllib.request.Request(BASE + path, method=method, data=None if body is None else json.dumps(body).encode(),
                                 headers={"Authorization": "Bearer " + os.environ["CG_API_KEY"],
                                          "Content-Type": "application/json", **(headers or {})})
    try:
        with urllib.request.urlopen(req, timeout=30) as res:
            return res.status, res.headers, json.load(res)
    except urllib.error.HTTPError as err:
        return err.code, err.headers, json.load(err)

def fail(status, data):
    raise SystemExit(f"{status} {data['error']['code']}: {data['error']['message']}")

# CG_API_KEY here is the creator's access token from the OAuth flow (1 hour); refresh it at /oauth/token.
status, _, me = call("GET", "/v1/creator/me")
if status == 401:
    raise SystemExit(f"token {me['error']['code']}: refresh it, or ask her to connect again")
if status != 200:
    fail(status, me)
print("stage:", me["stage"], "blockers:", ", ".join(me["next_actions"].get("blockers", [])) or "none")
```

Her password, email address and sign-in stay on our hosted pages; no app can change them.

## Her consent stays hers

- `consent_confirmed: true` on a new lead is **your** statement that she agreed to be submitted. It does not release her photos to agencies; only her own consent does.
- **Only she grants or withdraws consent**, on the consent page, in the creator portal or through her own action in your app. Never call the consent endpoints without her doing so.
- **Show the current text, unchanged.** Fetch it with `GET /v1/creator/consent-text`, show it in full and send its `version` with her decision. An outdated version answers [`409 consent_text_outdated`](https://docs.creator-guard.com/errors/#consent_text_outdated) and records nothing: show her the new text and ask again.
- **She can withdraw at any time**, and a withdrawal is never refused because of the text version. She can also disconnect your app in the creator portal; your tokens then stop working.
