> ## Documentation Index
> Fetch the complete documentation index at: https://docs.yourproducthere.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Verify connectivity and make your first authenticated API request.

## Prerequisites

<Warning>
  **API Access is Locked**\
  programmatic access is locked by default. Before you can make any authenticated calls, **you must contact Michel ([michel@yourproducthere.ai](mailto:michel@yourproducthere.ai)) to enable API access for your organization**.
</Warning>

* API access enabled for your organization (by contacting Michel)
* An API key from **Developer** in the app (`yph_sk_live_…`)
* Your environment base URL (see [Introduction](/introduction))

<Tip>
  **Building with an AI Copilot?** You can copy our [**AI Integration Skills Context (`/llms.txt`)**](/llms.txt) and paste it directly into your AI prompt (or attach it as a file). It is fully optimized to tell LLMs exactly how our video upload, actor creation, and Insta Swap rendering flows operate.
</Tip>

Replace `BASE_URL` and `YOUR_API_KEY` in the examples below.

## 1. Health check (no auth)

```bash theme={null}
curl -s "$BASE_URL/health"
```

Expected response:

```json theme={null}
{
  "ok": true,
  "service": "yph-api",
  "env": "production"
}
```

## 2. Account and credits

```bash theme={null}
curl -s "$BASE_URL/account" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

Expected response:

```json theme={null}
{
  "orgId": "…",
  "creditBalance": 10,
  "apiAccessEnabled": true
}
```

## 3. List actors

```bash theme={null}
curl -s "$BASE_URL/actors" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

## Typical integration flow

<Steps>
  <Step title="Create a Digital Sample">
    `POST /digital-samples` with title and render prompts.
  </Step>

  <Step title="Upload seed video">
    `POST /digital-samples/{id}/seed/upload-url` → PUT file to presigned URL → `POST …/seed/register` (automatically validates, approves, and activates the sample).
  </Step>

  <Step title="Create an Actor">
    Upload face/body/voice assets via your app workflow or presigned URLs, then `POST /actors`.
  </Step>

  <Step title="Queue Insta Swap">
    `POST /digital-samples/{id}/insta-swaps` with `actorId`. Render starts automatically; credits are charged.
  </Step>

  <Step title="Poll or webhook">
    `GET /insta-swaps/{id}` until `status` is terminal, or handle `insta_swap.completed` / `insta_swap.failed` webhooks.
  </Step>
</Steps>

See [End-to-end workflow](/guides/workflow) for detail.

## Errors

| HTTP  | Meaning                              |
| ----- | ------------------------------------ |
| `401` | Missing or invalid API key           |
| `403` | `api_access_disabled` for the org    |
| `402` | `insufficient_credits` on insta-swap |
| `404` | Resource not found or wrong org      |
| `422` | Webhook URL failed verification      |
