POST route that accepts a discriminated action body. Every mutating operation on organizations — creating one, updating its settings or branding, managing locations, roles, members, billing, and even deleting the org — is dispatched through this one endpoint. The action field in the request body determines which operation runs and which additional fields are required.
All requests require a valid Bearer token. Most actions that target an existing organization also require your role to have the corresponding permission. See Org permission model below.
Workspace actions endpoint
Request headers
string
required
Bearer token from your Clerk session. Example:
Bearer eyJhbGc...string
required
Must be
application/json.Request body
string
required
The action to perform. Must be one of the action type strings listed in the sections below.
action value. Each action is documented in its own section below.
Response
On success, returns{ "ok": true } plus any action-specific fields (e.g., createdOrgId).
On failure, returns HTTP 400 with an error body:
issues field:
Create organization
action:createOrganization
Creates a new organization and sets it as the caller’s active organization. The caller is automatically assigned the built-in owner role and a free-tier billing account is provisioned.
Body fields
string
required
"createOrganization"string
required
Organization display name. 1–120 characters.
string
URL-safe slug for the organization. Lowercase alphanumeric with hyphens; 2–48 characters; must start and end with an alphanumeric character. If omitted, a slug is auto-generated from
name. Must be unique across all organizations.Response fields
boolean
required
true on success.string
required
ID of the newly created organization.
Example
Set active organization
action:setActiveOrganization
Sets the active organization for your user session. You must already be an active member of the target organization. The touchActiveOrganizationFromNavigation action is an alias with identical behavior, used internally by the navigation shell.
Body fields
string
required
"setActiveOrganization" or "touchActiveOrganizationFromNavigation"string
required
ID of the organization to set as active. Must be an org you are an active member of.
Example
Update organization settings
action:updateOrganizationSettings
Updates the display name and slug for an existing organization. Requires the orgSettings permission.
Body fields
string
required
"updateOrganizationSettings"string
required
ID of the organization to update.
string
required
New display name. 1–120 characters.
string
required
New slug. Lowercase alphanumeric with hyphens; 2–48 characters; must start and end with an alphanumeric character. Must be unique across all organizations.
Update organization branding
action:updateOrganizationBrand
Updates the custom brand name, logo URL, and primary color for an organization. Requires the brand permission. All fields are optional; pass null to clear a value.
Body fields
string
required
"updateOrganizationBrand"string
required
ID of the organization to update.
string or null
Custom brand display name. Maximum 120 characters. Pass
null to clear.string or null
URL to the organization logo. Maximum 2000 characters. Pass
null to clear.string or null
Primary brand color as a
#RRGGBB hex string (e.g. "#1A56DB"). Maximum 7 characters. Pass null to clear.Create location
action:createOrgLocation
Adds a new location to the organization. Locations are appended at the end of the existing sort order. Requires the locations permission.
Body fields
string
required
"createOrgLocation"string
required
ID of the organization.
string
required
Location display name. 1–120 characters.
string or null
Street address. Maximum 200 characters.
string or null
City. Maximum 80 characters.
string or null
State, province, or region. Maximum 80 characters.
string or null
Postal code. Maximum 20 characters.
string or null
ISO 3166-1 alpha-2 country code (e.g.
"US"). Stored in uppercase. Maximum 2 characters.string or null
Phone number. Maximum 40 characters.
Update location
action:updateOrgLocation
Updates an existing location. Requires the locations permission.
Body fields
string
required
"updateOrgLocation"string
required
ID of the organization.
string
required
ID of the location to update. Must belong to the specified organization.
string
required
Updated location name. 1–120 characters.
string or null
Updated street address. Maximum 200 characters.
string or null
Updated city. Maximum 80 characters.
string or null
Updated region. Maximum 80 characters.
string or null
Updated postal code. Maximum 20 characters.
string or null
Updated country code. Stored in uppercase. Maximum 2 characters.
string or null
Updated phone number. Maximum 40 characters.
Delete location
action:deleteOrgLocation
Permanently removes a location from the organization. Requires the locations permission.
Body fields
string
required
"deleteOrgLocation"string
required
ID of the organization.
string
required
ID of the location to delete. Must belong to the specified organization.
Create role
action:createOrgRole
Creates a new custom role for the organization with a defined permission set. Requires the roles permission. The slug "owner" is reserved and cannot be used for custom roles.
Body fields
string
required
"createOrgRole"string
required
ID of the organization.
string
required
Role display name. 1–80 characters.
string
URL-safe slug for the role. Lowercase alphanumeric with hyphens; 2–32 characters; must start and end with alphanumeric. If omitted, auto-generated from
name. Cannot be "owner".object
required
An object mapping permission keys to boolean values. Any key not included defaults to
false. See Org permission model for the full list of keys.Example
Update role permissions
action:updateOrgRolePermissions
Updates the permission set for an existing custom role. Requires the roles permission. The built-in owner role cannot be modified through this action.
Body fields
string
required
"updateOrgRolePermissions"string
required
ID of the organization.
string
required
ID of the role to update. Must belong to the specified organization. Cannot be the
owner role.object
required
Updated permission map. Any key not included defaults to
false.Delete role
action:deleteOrgRole
Permanently removes a custom role from the organization. The built-in owner role cannot be deleted. Roles with active members must have all members reassigned before deletion. Requires the roles permission.
Body fields
string
required
"deleteOrgRole"string
required
ID of the organization.
string
required
ID of the role to delete. Must have zero assigned members.
Invite member by email
action:inviteOrgMember
Creates a pending invitation for an email address. The invited user appears in the member list with status: "INVITED" and a synthetic userId of "invite:<email>". Requires the members permission.
Body fields
string
required
"inviteOrgMember"string
required
ID of the organization.
string
required
Email address to invite. Must be a valid email; maximum 254 characters.
string
Slug of the role to assign to the invited member. Defaults to
"owner" if omitted. The role must already exist in the organization.Add member by user ID
action:addOrgMemberByUserId
Directly adds an existing Clerk user to the organization as an active member. Use this when you already know the user’s Clerk ID rather than their email address. Requires the members permission.
Body fields
string
required
"addOrgMemberByUserId"string
required
ID of the organization.
string
required
Clerk user ID of the user to add. Must start with
"user_".string
Slug of the role to assign. Defaults to
"owner" if omitted.Update member role
action:updateOrgMemberRole
Changes the role assigned to an existing member. Requires the members permission.
Body fields
string
required
"updateOrgMemberRole"string
required
ID of the organization.
string
required
ID of the membership record to update.
string
required
Slug of the new role to assign. 1–40 characters. The role must exist in the organization.
Remove member
action:removeOrgMember
Removes a member from the organization. The organization owner cannot be removed. Requires the members permission.
Body fields
string
required
"removeOrgMember"string
required
ID of the organization.
string
required
ID of the membership record to remove.
Update billing account
action:updateBillingAccount
Updates the billing account for an organization. Requires the billing permission.
This action updates billing records directly. For Stripe-managed subscriptions, use the Stripe integration to initiate checkout or portal sessions rather than writing Stripe IDs directly.
Body fields
string
required
"updateBillingAccount"string
required
ID of the organization.
string
required
Subscription tier. One of
"FREE", "STARTER", "PRO", "ENTERPRISE".string
required
Billing status. One of
"NONE", "ACTIVE", "PAST_DUE", "CANCELED".string or null
Stripe customer ID. Maximum 120 characters. Pass
null to clear.string or null
Stripe subscription ID. Maximum 120 characters. Pass
null to clear.Delete organization
action:deleteOrganization
Permanently deletes the organization and all associated data. Only the organization owner can perform this action. It also requires the orgSettings permission.
Body fields
string
required
"deleteOrganization"string
required
ID of the organization to delete.
Response fields
boolean
required
true on success.string
required
Always
"/orgs". Clients should redirect the user here after a successful deletion.Upsert user profile
action:upsertUserProfile
Creates or updates your own user profile. All fields are optional; omitted fields are set to null. The publicSlug, if provided, must be unique across all users and follow the same format rules as org slugs (lowercase alphanumeric with hyphens, 2–48 characters).
Body fields
string
required
"upsertUserProfile"string or null
Preferred display name. Maximum 120 characters.
string or null
Job title or role description. Maximum 120 characters.
string or null
Short biography. Maximum 2000 characters.
string or null
URL to your avatar image. Maximum 2000 characters.
string or null
Accent color or style token for profile tile display. Maximum 32 characters.
string or null
Public profile slug. Lowercase alphanumeric with hyphens; 2–48 characters; must start and end with alphanumeric. Must be globally unique.
Example
Org permission model
Every organization member is assigned a role. Each role carries apermissions object with six boolean keys. Permissions default to false for custom roles; the built-in owner role always has all permissions set to true.
Organization owners always have all six permissions regardless of what is stored in the role’s
permissions field. The owner role is a built-in role (isBuiltIn: true) with slug "owner" and cannot be deleted or have its permissions modified through the API.GET /v1/workspace/org-bundle/:orgId. The response includes your assigned role object with its full permissions map, as well as the complete list of roles defined for the organization.
