PATCH/organizations/{organization_id}/metadata

Merge and update metadata for an organization

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.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 2 body fields
organization_idstringrequired
The ID of the organization for which metadata will be merged or updated
public_metadataobjectoptional
Metadata saved on the organization, that is visible to both your frontend and backend. The new object will be merged with the existing value.
private_metadataobjectoptional
Metadata saved on the organization that is only visible to your backend. The new object will be merged with the existing value.

5 status codes
200An organization
objectstringrequired
Allowed:organization
idstringrequired
namestringrequired
slugstringrequired
image_urlstringoptional
has_imagebooleanrequired
members_countintegeroptional
missing_member_with_elevated_permissionsbooleanoptional
pending_invitations_countintegeroptional
max_allowed_membershipsintegerrequired
admin_delete_enabledbooleanrequired
self_serve_sso_enabledbooleanoptional
Whether this organization can configure self-serve enterprise SSO.
self_serve_directory_sync_enabledbooleanoptional
Whether this organization can configure self-serve Directory Sync (SCIM).
public_metadataobjectrequired
private_metadataobjectoptional
created_bystringoptional
created_atintegerrequired
Unix timestamp of creation.
updated_atintegerrequired
Unix timestamp of last update.
last_active_atintegeroptional
Unix timestamp of last activity.
role_set_keystringoptional
The key of the [role set](https://clerk.com/docs/guides/organizations/control-access/role-sets) assigned to this organization.
400Request was not successful
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional
401Authentication invalid
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional
404Resource not found
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional
422Invalid request parameters
errorsarray<object>required
metaobjectoptional
clerk_trace_idstringoptional

Error handling

A 400 is returned: Request was not successful. A 401 is returned: Authentication invalid. A 404 is returned: Resource not found. A 422 is returned: Invalid request parameters.