BlueForge Docs

client.org.create

Create an organisation (tenant).

Signature

class Client {
  org: {
    create(params: CreateOrgParams): Promise<{ org: OrgResponse; created: boolean }>
  }
}

Parameters

NameTypeRequiredNotes
name
stringyesOrganisation display name
slug
stringnoURL-friendly identifier (auto-derived)

Throws

ErrorCondition
ValidationError
Invalid organisation name
ConflictError
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
    created
    indicates whether a new organisation was created or an existing one was returned

See also

{auto-injected}

Tested against

{auto-injected}