Account and organization
Account resources are the organization-level controls around your BCTRL project. Use them to identify the authenticated actor, issue API keys, isolate customers, configure notification destinations, and inspect usage.
The SDK exposes these resources both directly and under bctrl.account:
Choose whichever style reads best for your application. The methods and response shapes are the same.
Check the authenticated actor
whoami() tells you which API key made the request and which scope the request is using.
The response also includes the account plan, email, defaultSpaceId, and effectiveScope. effectiveScope describes the scope after a request is narrowed with BCTRL-Subaccount-Id or bctrl.withSubaccount().
whoami() fields
AuthEffectiveScope has the same scope identifiers plus the effective default
Space:
API keys
Create a key for the organization, or pass subaccountId to create a key scoped to a subaccount.
The create response is { data, secret }. BCTRL never returns the plaintext secret again. Store it in your secret manager and rotate a key by creating the replacement before deleting the old key.
API key fields
Subaccounts
Use a subaccount when one organization needs isolated customers, spaces, API keys, limits, and usage. Create the subaccount once, then use its ID when creating or scoping resources.
withSubaccount() returns a client whose requests carry that subaccount context. An organization-scoped key can also select a subaccount per request where the API supports it; a subaccount-scoped key cannot escape its own subaccount.
Subaccount fields
SubaccountLimits contains maxSpaces, maxActiveRuns, and monthlyCreditLimit. A null limit means unlimited when updating limits.
Notification recipients
Notification recipients are destinations for human-in-the-loop requests. Create an email, SMS, or WhatsApp destination, then enable or disable it without deleting the resource.
Use E.164 phone numbers for sms and whatsapp, such as +15551234567.
Usage
Read organization usage from bctrl.usage. Read usage for every subaccount from bctrl.subaccounts.usage.
Organization usage includes the current credit balance, monthly cycle, blocking state, and a breakdown across browser, proxy, AI, challenge solver, files, and notification credits.
Subaccount usage is a facts-only snapshot: credits.used/limit, runs.active/limit, and spaces.used/limit, plus the billing period and computation timestamp. A null limit means unlimited. Clients can derive remaining credits or a resource-specific limit notice from these values; the response does not include a subaccount-wide blocked state.
Account settings
Use account settings for organization-level branding. get() returns both the values you configured and the resolved values currently used by BCTRL.
Branding updates use a merge-patch shape: omitted fields stay unchanged, and null restores a field’s BCTRL default. Set dryRun: true in the second argument to validate and resolve a change without saving it.
Next
- Spaces — create isolated automation environments
- Runtimes — run automation inside a durable resource
- Tools — configure automation capabilities and human input
- Conversations — connect an agent to a Runtime

