Manage member roles in an organization.
Adds a user as a member to the given organization. Only users in the same instance as the organization can be added as members.
This organization will be the user's [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.
Success
Request was not successful
Authorization invalid
Resource not found
Invalid request parameters
{- "user_id": "string",
- "role": "string"
}
{- "id": "string",
- "object": "organization_membership",
- "role": "string",
- "role_name": "string",
- "permissions": [
- "string"
], - "public_metadata": { },
- "private_metadata": { },
- "organization": {
- "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
}, - "public_user_data": {
- "user_id": "string",
- "first_name": "string",
- "last_name": "string",
- "profile_image_url": "string",
- "image_url": "string",
- "has_image": true,
- "identifier": "string"
}, - "created_at": 0,
- "updated_at": 0
}
Retrieves all user memberships for the given organization
A list of organization memberships
Authentication invalid
Invalid request parameters
{- "data": [
- {
- "id": "string",
- "object": "organization_membership",
- "role": "string",
- "role_name": "string",
- "permissions": [
- "string"
], - "public_metadata": { },
- "private_metadata": { },
- "organization": {
- "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
}, - "public_user_data": {
- "user_id": "string",
- "first_name": "string",
- "last_name": "string",
- "profile_image_url": "string",
- "image_url": "string",
- "has_image": true,
- "identifier": "string"
}, - "created_at": 0,
- "updated_at": 0
}
], - "total_count": 0
}
Updates the properties of an existing organization membership
Success
Request was not successful
Resource not found
Invalid request parameters
{- "role": "string"
}
{- "id": "string",
- "object": "organization_membership",
- "role": "string",
- "role_name": "string",
- "permissions": [
- "string"
], - "public_metadata": { },
- "private_metadata": { },
- "organization": {
- "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
}, - "public_user_data": {
- "user_id": "string",
- "first_name": "string",
- "last_name": "string",
- "profile_image_url": "string",
- "image_url": "string",
- "has_image": true,
- "identifier": "string"
}, - "created_at": 0,
- "updated_at": 0
}
Removes the given membership from the organization
Success
Request was not successful
Authentication invalid
Resource not found
{- "id": "string",
- "object": "organization_membership",
- "role": "string",
- "role_name": "string",
- "permissions": [
- "string"
], - "public_metadata": { },
- "private_metadata": { },
- "organization": {
- "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
}, - "public_user_data": {
- "user_id": "string",
- "first_name": "string",
- "last_name": "string",
- "profile_image_url": "string",
- "image_url": "string",
- "has_image": true,
- "identifier": "string"
}, - "created_at": 0,
- "updated_at": 0
}
Update an organization membership's metadata attributes by merging existing values with the provided parameters.
Metadata values will be updated via a deep merge. Deep means 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 membership, 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 membership that is only visible to your backend. The new object will be merged with the existing value. |
Success
Request was not successful
Resource not found
Invalid request parameters
{- "public_metadata": { },
- "private_metadata": { }
}
{- "id": "string",
- "object": "organization_membership",
- "role": "string",
- "role_name": "string",
- "permissions": [
- "string"
], - "public_metadata": { },
- "private_metadata": { },
- "organization": {
- "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
}, - "public_user_data": {
- "user_id": "string",
- "first_name": "string",
- "last_name": "string",
- "profile_image_url": "string",
- "image_url": "string",
- "has_image": true,
- "identifier": "string"
}, - "created_at": 0,
- "updated_at": 0
}
Retrieves all organization user memberships for the given instance.
A list of organization memberships
Request was not successful
Authentication invalid
Invalid request parameters
Request was not successful
{- "data": [
- {
- "id": "string",
- "object": "organization_membership",
- "role": "string",
- "role_name": "string",
- "permissions": [
- "string"
], - "public_metadata": { },
- "private_metadata": { },
- "organization": {
- "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
}, - "public_user_data": {
- "user_id": "string",
- "first_name": "string",
- "last_name": "string",
- "profile_image_url": "string",
- "image_url": "string",
- "has_image": true,
- "identifier": "string"
}, - "created_at": 0,
- "updated_at": 0
}
], - "total_count": 0
}