Organizations are used to group members under a common entity and provide shared access to resources.
This request returns the list of organizations for an instance.
Results can be paginated using the optional limit
and offset
query parameters.
The organizations are ordered by descending creation date.
Most recent organizations will be returned first.
A list of organizations
Request was not successful
Authorization invalid
Invalid request parameters
{- "data": [
- {
- "object": "organization",
- "id": "string",
- "name": "string",
- "slug": "string",
- "members_count": 0,
- "max_allowed_memberships": 0,
- "admin_delete_enabled": true,
- "public_metadata": { },
- "private_metadata": { },
- "created_by": "string",
- "created_at": 0,
- "updated_at": 0
}
], - "total_count": 0
}
Creates a new organization with the given name for an instance.
You can specify an optional slug for the new organization.
If provided, the organization slug can contain only lowercase alphanumeric characters (letters and digits) and the dash "-".
Organization slugs must be unique for the instance.
You can provide additional metadata for the organization and set any custom attribute you want.
Organizations support private and public metadata.
Private metadata can only be accessed from the Backend API.
Public metadata can be accessed from the Backend API, and are read-only from the Frontend API.
The created_by
user will see this as their [active organization] (https://clerk.com/docs/organizations/overview#active-organization)
the next time they create a session, presuming they don't explicitly set a different organization as active before then.
An organization
Request was not successful
Authorization invalid
Invalid request parameters
{- "name": "string",
- "created_by": "string",
- "private_metadata": { },
- "public_metadata": { },
- "slug": "string",
- "max_allowed_memberships": 0,
- "created_at": "string"
}
{- "object": "organization",
- "id": "string",
- "name": "string",
- "slug": "string",
- "members_count": 0,
- "max_allowed_memberships": 0,
- "admin_delete_enabled": true,
- "public_metadata": { },
- "private_metadata": { },
- "created_by": "string",
- "created_at": 0,
- "updated_at": 0
}
Fetches the organization whose ID or slug matches the provided id_or_slug
URL query parameter.
An organization
Authorization invalid
Resource not found
{- "object": "organization",
- "id": "string",
- "name": "string",
- "slug": "string",
- "members_count": 0,
- "max_allowed_memberships": 0,
- "admin_delete_enabled": true,
- "public_metadata": { },
- "private_metadata": { },
- "created_by": "string",
- "created_at": 0,
- "updated_at": 0
}
Updates an existing organization
An organization
Resource not found
Resource not found
Invalid request parameters
{- "public_metadata": { },
- "private_metadata": { },
- "name": "string",
- "slug": "string",
- "max_allowed_memberships": 0,
- "admin_delete_enabled": true,
- "created_at": "string"
}
{- "object": "organization",
- "id": "string",
- "name": "string",
- "slug": "string",
- "members_count": 0,
- "max_allowed_memberships": 0,
- "admin_delete_enabled": true,
- "public_metadata": { },
- "private_metadata": { },
- "created_by": "string",
- "created_at": 0,
- "updated_at": 0
}
Deletes the given organization. Please note that deleting an organization will also delete all memberships and invitations. This is not reversible.
Deleted Object
Resource not found
{- "object": "string",
- "id": "string",
- "slug": "string",
- "deleted": true
}
Update organization metadata attributes by merging existing values with the provided parameters.
Metadata values will be updated via a deep merge.
Deep meaning that any nested JSON objects will be merged as well.
You can remove metadata keys at any level by setting their value to null
.
object Metadata saved on the organization, that is visible to both your frontend and backend. The new object will be merged with the existing value. | |
object Metadata saved on the organization that is only visible to your backend. The new object will be merged with the existing value. |
An organization
Request was not successful
Authentication invalid
Resource not found
Invalid request parameters
{- "public_metadata": { },
- "private_metadata": { }
}
{- "object": "organization",
- "id": "string",
- "name": "string",
- "slug": "string",
- "members_count": 0,
- "max_allowed_memberships": 0,
- "admin_delete_enabled": true,
- "public_metadata": { },
- "private_metadata": { },
- "created_by": "string",
- "created_at": 0,
- "updated_at": 0
}
Set or replace an organization's logo, by uploading an image file.
This endpoint uses the multipart/form-data
request content type and accepts a file of image type.
The file size cannot exceed 10MB.
Only the following file content types are supported: image/jpeg
, image/png
, image/gif
, image/webp
, image/x-icon
, image/vnd.microsoft.icon
.
An organization with a logo URL.
Request was not successful
Authorization invalid
Resource not found
Request was not successful
{- "object": "organization",
- "id": "string",
- "name": "string",
- "slug": "string",
- "members_count": 0,
- "max_allowed_memberships": 0,
- "admin_delete_enabled": true,
- "public_metadata": { },
- "private_metadata": { },
- "created_by": "string",
- "created_at": 0,
- "updated_at": 0,
- "logo_url": "string",
- "image_url": "string",
- "has_image": true
}
Delete the organization's logo.
An organization
Resource not found
{- "object": "organization",
- "id": "string",
- "name": "string",
- "slug": "string",
- "members_count": 0,
- "max_allowed_memberships": 0,
- "admin_delete_enabled": true,
- "public_metadata": { },
- "private_metadata": { },
- "created_by": "string",
- "created_at": 0,
- "updated_at": 0
}