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
In this repository20 other files it gives its agents.
- add-providerSkill
- bolna-extraction-designerSkill
- bolna-graph-agentsSkill
- create-agentSkill
- create-batchSkill
- create-dispositionSkill
- create-knowledgebaseSkill
- debug-bolna-callsSkill
- get-executionsSkill
- make-callSkill
- manage-agentsSkill
- manage-phone-numbersSkill
- manage-violationsSkill
- migrate-call-to-workflowSkill
- prompt-writingSkill
- setup-api-keySkill
- setup-inboundSkill
- setup-sip-trunkSkill
- setup-toolsSkill
- setup-webhookSkill
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
- Distinctive: line 34
Centralised billing: all sub-account spend rolls into the parent wallet.
- Distinctive: line 143
All agents in the sub-account.
- Distinctive: line 144
All batches, executions, recordings.
- Distinctive: line 145
All phone numbers owned by the sub-account (releases the DIDs.
- Very specific: line 146
All configurations and the sa- API key.
- Distinctive: line 148
Always confirm with the user: before deletion. Offer to back up:
- Very specific: line 169
Create three sub-accounts: acme-dev, acme-staging, acme-production.
- Distinctive: line 177
Sub-accounts can't create their own sub-accounts: Only the parent org admin can.
≈ “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.
Files
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/createreturns 403, the account isn't on the enterprise tier. Contactenterprise@bolna.ai.
When to use
| Reason | Example |
| Multi-tenancy (agency / reseller) | One Bolna org per agency; one sub-account per client. |
| Department isolation | Sales / Support / Marketing share an org but want separate workspaces. |
| Region / compliance boundaries | EU customer data lives in an EU-tagged sub-account. |
| Environments | Dev / 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
/usageendpoint 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
| Method | Path | Purpose |
POST | /sub-accounts/create | Create a new sub-account |
GET | /sub-accounts/all | List 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}/usage | Usage for one sub-account |
GET | /sub-accounts/all/usage | Usage 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}/usagefor limit info. - Phone numbers bought via a sub-account belong to that sub-account. Released on sub-account delete.
Going deeper
| File | Contents |
scripts/create_sub_account.py | Wraps POST /sub-accounts/create with name/metadata flags. |
scripts/list_sub_accounts.py | Wraps GET /sub-accounts/all with pagination. |
scripts/sub_account_usage.py | Wraps GET /sub-accounts/{id}/usage and the all-usage rollup. |
See also
setup-api-key— keys and thesa-prefix distinction.https://raw.githubusercontent.com/bolna-ai/skills/main/references/bolna-core.md— auth, pagination.- Bolna Enterprise:
https://www.bolna.ai/meetfor tier upgrades.
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
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.

