agentleFS
bolna-aibolna-ai/skills/manage-subaccounts/SKILL.md

manage-subaccounts

Skill4 starsChanged 36 days agoMITView on GitHub

Create, list, patch, delete, and inspect usage for Bolna enterprise sub-accounts. Sub-accounts provide isolated workspaces with auto-provisioned API keys (prefixed `sa-`), per-tenant agents/calls/phone-numbers/batches, and per-sub-account usage reporting for billing. Use for agencies, multi-tenant platforms, departments, regions, or regulated data boundaries. **Enterprise feature** — requires org admin access.

  • Reads credentials
  • Sends data out

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Centralised billing: all sub-account spend rolls into the parent wallet.

    line 34
  2. Distinctive:

    All agents in the sub-account.

    line 143
  3. Distinctive:

    All batches, executions, recordings.

    line 144
  4. Distinctive:

    All phone numbers owned by the sub-account (releases the DIDs.

    line 145
  5. Very specific:

    All configurations and the sa- API key.

    line 146
  6. Distinctive:

    Always confirm with the user: before deletion. Offer to back up:

    line 148
  7. Very specific:

    Create three sub-accounts: acme-dev, acme-staging, acme-production.

    line 169
  8. Distinctive:

    Sub-accounts can't create their own sub-accounts: Only the parent org admin can.

    line 177

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Bolna Sub-Accounts

Enterprise feature: split a parent organisation into isolated sub-account workspaces. Each sub-account gets its own auto-provisioned API key (prefixed sa-), its own agents, phone numbers, batches, executions, and a separate usage stream that rolls up to the parent for billing.

Enterprise only. If POST /sub-accounts/create returns 403, the account isn't on the enterprise tier. Contact enterprise@bolna.ai.

When to use

ReasonExample
Multi-tenancy (agency / reseller)One Bolna org per agency; one sub-account per client.
Department isolationSales / Support / Marketing share an org but want separate workspaces.
Region / compliance boundariesEU customer data lives in an EU-tagged sub-account.
EnvironmentsDev / Staging / Prod sub-accounts under one billing umbrella.

What sub-accounts give you

  • Isolated data: agents, calls, phone numbers, batches, executions don't bleed across sub-accounts.
  • Auto-provisioned API key: created at the same time as the sub-account, prefixed sa-.
  • Per-sub-account usage: separate /usage endpoint for billing reconciliation.
  • Centralised billing: all sub-account spend rolls into the parent wallet.
  • Parent-only control: a sub-account cannot create or destroy its own sub-accounts or modify other sub-accounts.

Endpoints

MethodPathPurpose
POST/sub-accounts/createCreate a new sub-account
GET/sub-accounts/allList all sub-accounts
PATCH/sub-accounts/{sub_account_id}Update name / metadata
DELETE/sub-accounts/{sub_account_id}Delete (cascades to all sub-account data)
GET/sub-accounts/{sub_account_id}/usageUsage for one sub-account
GET/sub-accounts/all/usageUsage rollup across all sub-accounts

Auth: parent-account Authorization: Bearer $BOLNA_API_KEY (an admin key on the parent org).

Create

curl -X POST https://api.bolna.ai/sub-accounts/create \
  -H "Authorization: Bearer $BOLNA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Client - Customer A",
    "description": "Customer A workspace under Acme agency",
    "metadata": {
      "customer_id": "cust_abc123",
      "region": "in",
      "environment": "production"
    }
  }'

Response includes:

{
  "id": "subacct_01HQXYZ123",
  "name": "Acme Client - Customer A",
  "api_key": "sa-bna_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "created_at": "2026-05-19T10:00:00Z"
}

The api_key is shown only once. Save it immediately. Sub-accounts cannot regenerate their own keys — only the parent can.

Use the sub-account key

The sub-account API key works exactly like a top-level key, but only operates on the sub-account's resources:

export SA_KEY="sa-bna_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

# Creates an agent inside the sub-account
curl -X POST https://api.bolna.ai/v2/agent \
  -H "Authorization: Bearer $SA_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "agent_config": {...}, "agent_prompts": {...} }'

Any code that distinguishes parent vs sub-account behaviour can key on the sa- prefix.

List sub-accounts

curl https://api.bolna.ai/sub-accounts/all \
  -H "Authorization: Bearer $BOLNA_API_KEY"

Paginated. Use page_number / page_size query params (see https://raw.githubusercontent.com/bolna-ai/skills/main/references/bolna-core.md).

Inspect usage

Per sub-account:

curl "https://api.bolna.ai/sub-accounts/$SUB_ACCOUNT_ID/usage" \
  -H "Authorization: Bearer $BOLNA_API_KEY"

Across all sub-accounts:

curl https://api.bolna.ai/sub-accounts/all/usage \
  -H "Authorization: Bearer $BOLNA_API_KEY"

Usage payloads typically include call minutes, executions count, phone-number rentals, and cost — useful for billing reconciliation. Pull weekly or daily and store in your own data warehouse.

Patch

curl -X PATCH "https://api.bolna.ai/sub-accounts/$SUB_ACCOUNT_ID" \
  -H "Authorization: Bearer $BOLNA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Acme Client - Customer A (Renamed)" }'

The API key isn't regenerated on patch. To rotate, delete and recreate the sub-account.

Delete — be careful

curl -X DELETE "https://api.bolna.ai/sub-accounts/$SUB_ACCOUNT_ID" \
  -H "Authorization: Bearer $BOLNA_API_KEY"

Deletion cascades:

  • All agents in the sub-account.
  • All batches, executions, recordings.
  • All phone numbers owned by the sub-account (releases the DIDs; you lose them).
  • All configurations and the sa- API key.

Always confirm with the user before deletion. Offer to back up:

  • Agent configs: GET /v2/agent/{id} for each agent.
  • Execution data: paginate GET /v2/agent/{id}/executions.
  • Disposition definitions: GET /dispositions/?agent_id=....

For audit-required organisations, archive these to your own storage before issuing the DELETE.

Common patterns

Per-customer workspaces (agency model)

def onboard_new_client(client_name, client_id):
    sub = create_sub_account(name=f"Client - {client_name}", metadata={"client_id": client_id})
    store_in_db(client_id=client_id, sub_account_id=sub["id"], api_key=sub["api_key"])
    bootstrap_agents_for_client(sub["api_key"])

Environment isolation

Create three sub-accounts: acme-dev, acme-staging, acme-production. Use the matching sa- key from each environment. Logs, calls, and phone numbers stay tagged correctly without manual filtering.

Tenant billing reconciliation

Cron job pulls GET /sub-accounts/all/usage weekly, joins per-sub-account usage with your clients table, generates invoices.

Quirks

  • Sub-accounts can't create their own sub-accounts. Only the parent org admin can.
  • sa- keys can't access other sub-accounts. Strict isolation.
  • Wallet is parent-level. Sub-accounts don't have separate wallets — top up the parent.
  • Concurrency may be shared or per-sub-account depending on tier; check GET /sub-accounts/{id}/usage for limit info.
  • Phone numbers bought via a sub-account belong to that sub-account. Released on sub-account delete.

Going deeper

FileContents
scripts/create_sub_account.pyWraps POST /sub-accounts/create with name/metadata flags.
scripts/list_sub_accounts.pyWraps GET /sub-accounts/all with pagination.
scripts/sub_account_usage.pyWraps GET /sub-accounts/{id}/usage and the all-usage rollup.

See also

  • setup-api-key — keys and the sa- prefix distinction.
  • https://raw.githubusercontent.com/bolna-ai/skills/main/references/bolna-core.md — auth, pagination.
  • Bolna Enterprise: https://www.bolna.ai/meet for tier upgrades.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.