# Test mode & sandbox

A `cg_test_` key works on the same host and paths as a live key, but every request reaches the **sandbox**: a separate database with its own leads, photos, events and webhook endpoints. Nothing you do there reaches agencies, our team or your live data — and live keys can never see the sandbox.

## Getting a test key

Create one in the portal (**Settings → API**, mode **Test**) or with `POST /v1/api-keys` and a test key that has `keys:manage` — see [API keys](https://docs.creator-guard.com/api-keys/). On the first request your account appears in the sandbox by itself, with the same name, type and accepted terms. After that its profile is the sandbox's own: what you change with `PATCH /v1/me` or `/v1/me/logo` and a test key stays in the sandbox and is not overwritten by your live profile (type and accepted terms keep following your live account).

## What is different

| | Live | Test |
|---|---|---|
| Data | Real creators | Made up by you; never use real creator data |
| Limits | [Rate limits](https://docs.creator-guard.com/rate-limits/) | **Half** of every limit, rounded up: 50 per minute and 5,000 per day per key, 10 / 100 extractions, 30 / 1,500 uploads |
| `POST /v1/extract` | AI suggestions | Always the same fictitious example, no AI |
| Photo and logo URLs | Signed storage URLs | `https://api.creator-guard.com/v1/test-files/…?token=…`, also valid for one hour |
| Our review, payments | Our team | You, with the test helpers below |
| Events | `"mode": "live"` | `"mode": "test"`, sent to the endpoints you registered with a test key |

The portal shows and manages **live** webhook endpoints only; register test endpoints with a test key that has `webhooks:manage`. If the sandbox is briefly unavailable, a test key answers [`503 not_configured`](https://docs.creator-guard.com/errors/#not_configured).

## Test helpers

They play the parts that Creator Guard or the creator play in live mode. Every helper answers [`404 not_found`](https://docs.creator-guard.com/errors/#not_found) to a live key, before anything happens.

| Request | Plays | Result |
|---|---|---|
| `POST /v1/test-helpers/leads/{id}/confirm` | The creator on her consent page | Consent granted, 18+ confirmed |
| `POST /v1/test-helpers/leads/{id}/approve-listing` | Our review | A listing in review goes live; without consent, 18+ confirmation or fee → [`422 not_ready_for_review`](https://docs.creator-guard.com/errors/#not_ready_for_review) |
| `POST /v1/test-helpers/leads/{id}/reject` | Our review, body `{"outcome_reason": "duplicate"}` | Lead `rejected` |
| `POST /v1/test-helpers/commissions/{id}/mark-paid` | Our payout | A `due` commission becomes `paid` |
| `POST /v1/test-helpers/reset` | — | Deletes your test data (see below) |

The lead and commission helpers need `leads:write`, the reset `keys:manage`. Each helper sends the same events as the real step, so your webhook handling sees exactly what it will see in live mode. A typical run: create a lead → upload three photos → `confirm` → submit for review → `approve-listing`.

Agency keys have their own helpers — a test offer, payment, completion and refund of a reservation, and a test clock: see [Agencies](https://docs.creator-guard.com/agencies/#testing-with-a-test-key).

## Reset

`POST /v1/test-helpers/reset` empties the sandbox for your account: every lead, photo, commission, event, delivery, sandbox file and stored `Idempotency-Key` answer. Your test keys, test webhook endpoints and accepted terms stay; the answer counts what was deleted. **Agencies:** the offers and reservations made with the [agency test helpers](https://docs.creator-guard.com/agencies/#testing-with-a-test-key) belong to a sandbox referrer, so a reset leaves them in place (known limit); let them expire with `POST /v1/test-helpers/clock/advance`.

## Going live

Nothing moves from test to live. Create a live key, point your integration at the same URLs and register your live webhook endpoints.
