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

# Quick Start

> Get your first sub-account embedded in 3 steps.

## Step 1: Create a Sub-Account

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.recoverbiz.com/v1/accounts \
    -H "X-Partner-Key: pk_live_abc123def456..." \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Acme Lending",
      "company_name": "Acme Lending Corp",
      "phone_number": "+14155551234"
    }'
  ```

  ```typescript JavaScript theme={null}
  const res = await fetch('https://api.recoverbiz.com/v1/accounts', {
    method: 'POST',
    headers: {
      'X-Partner-Key': 'pk_live_abc123def456...',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      name: 'Acme Lending',
      company_name: 'Acme Lending Corp',
      phone_number: '+14155551234',
    }),
  });
  const account = await res.json();
  ```

  ```python Python theme={null}
  account = requests.post(f'{BASE_URL}/accounts', headers=headers, json={
      'name': 'Acme Lending',
      'company_name': 'Acme Lending Corp',
      'phone_number': '+14155551234'
  }).json()
  ```
</CodeGroup>

**Response:**

```json theme={null}
{
  "id": "acc_8f3a1b2c",
  "name": "Acme Lending",
  "slug": "acme-lending",
  "status": "active",
  "phone_number": "+14155551234",
  "company_name": "Acme Lending Corp",
  "created_at": "2026-02-15T10:30:00Z"
}
```

## Step 2: Generate an Embed Token

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.recoverbiz.com/v1/accounts/acc_8f3a1b2c/embed-token \
    -H "X-Partner-Key: pk_live_abc123def456..." \
    -H "Content-Type: application/json" \
    -d '{
      "expires_in": 28800
    }'
  ```

  ```typescript JavaScript theme={null}
  const tokenRes = await fetch(`https://api.recoverbiz.com/v1/accounts/${account.id}/embed-token`, {
    method: 'POST',
    headers: {
      'X-Partner-Key': 'pk_live_abc123def456...',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ expires_in: 28800 }),
  });
  const { embed_url } = await tokenRes.json();
  ```

  ```python Python theme={null}
  token = requests.post(
      f'{BASE_URL}/accounts/{account["id"]}/embed-token',
      headers=headers,
      json={'expires_in': 28800}
  ).json()
  ```
</CodeGroup>

**Response:**

```json theme={null}
{
  "token": "eyJhbGciOiJIUzI1NiIs...",
  "expires_at": "2026-02-15T18:30:00Z",
  "embed_url": "https://app.recoverbiz.com/embed?token=eyJhbGciOiJIUzI1NiIs..."
}
```

## Step 3: Embed the Dashboard

```html theme={null}
<iframe
  src="https://app.recoverbiz.com/embed?token=eyJhbGciOiJIUzI1NiIs..."
  style="width: 100%; height: 700px; border: none;"
  allow="clipboard-write"
></iframe>
```

<Check>
  That's it. Your customer now has a full AI SMS dashboard embedded in your platform.
</Check>

## Full Workflow Example

Here's the complete setup end-to-end — account creation, checklist configuration, sequence setup, lead import, and embed:

```bash theme={null}
# 1. Create account
ACCOUNT_ID=$(curl -s -X POST https://api.recoverbiz.com/v1/accounts \
  -H "X-Partner-Key: $PARTNER_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Acme Lending"}' | jq -r '.id')

# 2. Configure checklist
curl -X POST https://api.recoverbiz.com/v1/accounts/$ACCOUNT_ID/requirements \
  -H "X-Partner-Key: $PARTNER_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Government ID", "type": "document", "required": true}'

curl -X POST https://api.recoverbiz.com/v1/accounts/$ACCOUNT_ID/requirements \
  -H "X-Partner-Key: $PARTNER_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Bank Statements (3 months)", "type": "document", "required": true}'

# 3. Create a follow-up sequence
curl -X POST https://api.recoverbiz.com/v1/accounts/$ACCOUNT_ID/sequences \
  -H "X-Partner-Key: $PARTNER_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Application Recovery",
    "is_active": true,
    "is_default": true,
    "steps": [
      {"type": "fixed", "message": "Hi {{first_name}}, your application with {{company}} is almost complete. Need help with the last steps?", "delay_hours": 0},
      {"type": "ai", "instructions": "Follow up on missing documents", "delay_hours": 24, "skip_if_replied": true}
    ]
  }'

# 4. Import a lead (auto-enrolls in default sequence)
curl -X POST https://api.recoverbiz.com/v1/accounts/$ACCOUNT_ID/leads \
  -H "X-Partner-Key: $PARTNER_KEY" \
  -H "Content-Type: application/json" \
  -d '{"phone": "+14155551234", "name": "John Doe", "auto_sequence": true}'

# 5. Generate embed token
EMBED_URL=$(curl -s -X POST https://api.recoverbiz.com/v1/accounts/$ACCOUNT_ID/embed-token \
  -H "X-Partner-Key: $PARTNER_KEY" \
  -H "Content-Type: application/json" \
  -d '{"expires_in": 28800}' | jq -r '.embed_url')

echo "Embed this in your app: $EMBED_URL"
```
