# Sub-Accounts Overview

> Create isolated messaging accounts for your customers with independent API keys

Sub-accounts let you provision **isolated messaging environments** for each of your customers. Each sub-account gets its own API key, usage tracking, and optional spending cap — while all charges are billed to your team's balance.

## Quick Start

  
#### Create a sub-account

    ```bash
    curl -X POST https://api.zavu.dev/v1/sub-accounts \
      -H "Authorization: Bearer zv_live_xxx" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "Client ABC",
        "externalId": "client_123",
        "creditLimit": 100000
      }'
    ```
  
  
#### Save the API key

    The response includes the sub-account's API key. **The API returns it once
    and has no way to return it again** — store it when you receive it. If you
    lose it, open the sub-account in the dashboard and show the key from its
    **API Keys** screen, or create another key for it.

    ```json
    {
      "subAccount": {
        "id": "jx7abc123def456",
        "name": "Client ABC",
        "status": "active",
        "totalSpent": 0,
        "creditLimit": 100000,
        "apiKey": "zv_live_sub_xxxxxxxxxxxx",
        "createdAt": "2025-01-15T10:00:00Z"
      }
    }
    ```
  
  
#### Your customer sends messages

    Your customer uses their API key to send messages:

    ```bash
    curl -X POST https://api.zavu.dev/v1/messages \
      -H "Authorization: Bearer zv_live_sub_xxxxxxxxxxxx" \
      -d '{"to": "+14155551234", "text": "Hello from Client ABC!"}'
    ```
  

## Guides

  - [Creating Sub-Accounts](https://www.zavu.dev/docs/guides/sub-accounts/creating): Provision sub-accounts with credit limits, external IDs, and metadata
  - [Managing Sub-Accounts](https://www.zavu.dev/docs/guides/sub-accounts/managing): Update settings, rotate API keys, and monitor spending
  - [Deletion & Deactivation](https://www.zavu.dev/docs/guides/sub-accounts/deletion): Deactivate sub-accounts and understand the 14-day deletion grace period

## Important Rules

> **Warning:**
> Each team can have **only one main account**. All additional projects must be created as sub-accounts. If you need a separate main account, create a new team.

- Sub-accounts share the team's **balance** but are fully isolated
- Each sub-account has its own API keys, senders, phone numbers, contacts, and usage tracking
- Credit limits are optional — omit or set to `0` for unlimited spending
- When a credit limit is reached, the sub-account's messages are blocked
- Deactivating a sub-account revokes all its API keys immediately
