clerk.replace_user_metadata
Replace the entire contents of one metadata namespace for a Clerk user.
Call clerk.get_connected_accounts first. Pass clerk_instance_id to target a specific connection, or omit it to use the default account.
The metadata body fully replaces the chosen namespace. Returns the updated user summary.
Cost = 8 tokens.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user_id | Yes | Clerk user id (user_...) whose metadata to replace. | |
| metadata | Yes | New metadata dict that fully replaces the chosen namespace. Pass an empty object to clear all keys. | |
| metadata_type | Yes | Metadata namespace to replace. | |
| clerk_instance_id | No | Clerk instance id (ins_...) from clerk.get_connected_accounts. Omit to use the default connected account. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user | No | Updated Clerk user object after the metadata replacement. |