client.org.create
Create an organisation (tenant).
Signature
class Client {
org: {
create(params: CreateOrgParams): Promise<{ org: OrgResponse; created: boolean }>
}
}
Parameters
| Name | Type | Required | Notes |
|---|---|---|---|
| string | yes | Organisation display name |
| string | no | URL-friendly identifier (auto-derived) |
Throws
| Error | Condition |
|---|---|
| Invalid organisation name |
| Organisation slug already exists |
Examples
const { org, created } = await bf.org.create({ name: 'Acme Corp' })
console.log(`Created ${org.name} (${org.id})`)
Pitfalls
- Slug uniqueness — organisation slugs must be globally unique
- Idempotent check —
indicates whether a new organisation was created or an existing one was returnedcreated
See also
{auto-injected}
Tested against
{auto-injected}