Skip to content

Update organization membership metadata

PATCH
/api/server/v1/organizations/{organizationId}/members/{memberUserId}/metadata
curl --request PATCH \
--url https://api.toriiauth.eu/api/server/v1/organizations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/members/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/metadata \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "publicMetadata": { "plan": "enterprise" }, "privateMetadata": { "crmAccountId": "acct_123" } }'

Deep-merges into either bag on one membership, with the same tri-state contract as the organization endpoint. Each bag on the membership has its own 8 KB budget, separate from the organization’s bags.

organizationId
required
string format: uuid
memberUserId
required
string format: uuid
Media typeapplication/json
object
publicMetadata

Public metadata bag. An organization’s bag is readable over the client API by any member; a MEMBERSHIP’s bags are server-plane only and are never returned on a client-facing read. Capped at 8 KB on its own.

object
key
additional properties
any
Example
{
"plan": "enterprise"
}
privateMetadata

Private metadata bag: server-only. Never exposed to the SDK, never in a JWT. Capped at 8 KB on its own.

object
key
additional properties
any
Example
{
"crmAccountId": "acct_123"
}

The updated membership.

Media typeapplication/json
object
organizationId
required
string format: uuid
userId
required
string format: uuid
role
required
string
roleName
string | null
publicMetadata
required
object
key
additional properties
any
privateMetadata
required
object
key
additional properties
any
joinedAt
required
string format: date-time
Examplegenerated
{
"organizationId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"userId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"role": "example",
"roleName": "example",
"publicMetadata": {},
"privateMetadata": {},
"joinedAt": "2026-04-15T12:00:00Z"
}

The merged metadata exceeds the size limit.

Media typeapplication/problem+json
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
Examplegenerated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com",
"properties": {
"additionalProperty": "example"
}
}

Missing or invalid secret key.

Media typeapplication/problem+json
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
Examplegenerated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com",
"properties": {
"additionalProperty": "example"
}
}

No such organization in the key’s environment, or the user is not a member of it.

Media typeapplication/problem+json
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
Examplegenerated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "https://example.com",
"properties": {
"additionalProperty": "example"
}
}