# Sandbox

Build and test your integration in the **partner test environment** (`partner_test`) before going live.
Test data is kept separate from production, so you can create jobs, apply as candidates and reset as often as
you like.

## Using the test environment

Use a test client secret (prefix `aiv_test_`) against the same base URL, `https://api.aiviue.com`. The token
you get is bound to `partner_test`, and every call made with it reads and writes test data only. Switch to an
`aiv_live_` secret to go live — no other change to your code is needed.

## Applying as a candidate

Each partner gets a test job board listing its published test jobs. Open it, apply to your own job as a
candidate, and watch the screening events arrive at your webhook endpoint. Ask us for your board's link.

## Resetting test data

`POST /v1/admin/reset` (scope `partner_test:reset`) deletes the jobs, applications and related data of one test
tenant so you can start fresh. Your OAuth client and the tenant itself are kept.

- Send the tenant in both `X-Tenant-ID` and the body (`tenant_id`); they must match, otherwise `400`.
- It only works with a test token. In production it returns `409 CONFLICT`.

## Going live checklist

- Credentials: request an `aiv_live_` secret and store it in your secret manager.
- Tenants: map each customer to its production Aiviue tenant ID.
- Webhooks: subscribe your production endpoint and verify signatures.
- Retries: idempotency keys on every write and backoff on `429`/`5xx`.
- Monitoring: log `meta.requestId` from every response.

Email [partners@aiviue.com](mailto:partners@aiviue.com) when you are ready to go live.
