Skip to content

Organization

Source: src/Cloudflare/Organization/Organization.ts

A Cloudflare Organization — the hierarchical container above accounts.

Organizations group accounts (and sub-organizations) under a single management umbrella; an account’s managedBy.parentOrgId points at its owning organization. The feature is entitlement-gated: only tenant / organizations-enabled customers can create organizations — on a standard account every /organizations call fails with the typed Forbidden error.

name and profile are mutable in place; changing parent triggers a replacement.

Safety: organizations carry no ownership markers. When there is no prior state, read scans for an existing organization with the same name (and parent) and reports it as Unowned, so the engine refuses to take it over unless --adopt (or adopt(true)) is set.

Basic organization

const org = yield* Cloudflare.Organization("Platform", {
name: "acme-platform",
});

Organization with a business profile

const org = yield* Cloudflare.Organization("Platform", {
name: "acme-platform",
profile: {
businessName: "Acme Corp",
businessEmail: "ops@acme.com",
businessPhone: "+1-555-0100",
businessAddress: "1 Acme Way, Springfield",
externalMetadata: "crm:acct-42",
},
});
const parent = yield* Cloudflare.Organization("Root", {
name: "acme-root",
});
// Changing `parent` later replaces the sub-organization.
const sub = yield* Cloudflare.Organization("Emea", {
name: "acme-emea",
parent: parent.organizationId,
});