The Organizations API allows you to create, manage, and organize hierarchical structures for your Cloudflare resources. Organizations are currently in Closed Beta.
Create organization
Create a new organization for a user.
const organization = await client . organizations . create ({
name: 'Acme Corporation' ,
profile: {
business_name: 'Acme Corp' ,
business_email: '[email protected] ' ,
business_address: '123 Main St' ,
business_phone: '+1-555-0100' ,
external_metadata: '{}'
}
});
The name of the organization
Parent organization reference Parent organization identifier
Organization profile information External metadata for the organization
ISO 8601 timestamp when the organization was created
Organization metadata Feature flags for the organization
Entity managing the organization
Parent organization details
Organization profile information
Update organization
Modify an existing organization.
const organization = await client . organizations . update (
'f1234567890abcdef1234567890abcde' ,
{
name: 'Acme Corporation Updated' ,
profile: {
business_name: 'Acme Corp' ,
business_email: '[email protected] ' ,
business_address: '456 Market St' ,
business_phone: '+1-555-0200' ,
external_metadata: '{}'
}
}
);
List organizations
Retrieve a list of organizations a particular user has access to.
for await ( const organization of client . organizations . list ()) {
console . log ( organization . name );
}
Filter by organization IDs
Filter by organization name Name contains this string (case-insensitive)
Name starts with this string (case-insensitive)
Name ends with this string (case-insensitive)
Filter by contained resources Filter to organizations containing this account
Filter to organizations containing this sub-organization
Filter to organizations containing this user
Filter by parent organization Parent organization ID (use “null” for root organizations)
Number of items to return (default: 10)
Pagination token from previous response
Get organization
Retrieve the details of a specific organization.
const organization = await client . organizations . get (
'f1234567890abcdef1234567890abcde'
);
Delete organization
Delete an organization. The organization must be empty (no sub-organizations, accounts, members, or users).
const result = await client . organizations . delete (
'f1234567890abcdef1234567890abcde'
);
ID of the deleted organization