Skip to content

Update organization metadata

PATCH
/api/server/v1/organizations/{organizationId}/metadata
curl --request PATCH \
--url https://api.toriiauth.eu/api/server/v1/organizations/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 metadata bag. Each bag is tri-state: omit the key to leave the bag unchanged, or send an object to deep-merge into it (a key set to null removes it). Each bag is capped at 8 KB on its own, measured on the merged result rather than on the patch you send. A request naming neither bag is a 400.

organizationId
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 organization.

Media typeapplication/json
object
id
required
string format: uuid
name
required
string
slug
string | null
roleSetId
string | null format: uuid
publicMetadata
required
object
key
additional properties
any
privateMetadata
required
object
key
additional properties
any
createdAt
required
string format: date-time
Examplegenerated
{
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"name": "example",
"slug": "example",
"roleSetId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"publicMetadata": {},
"privateMetadata": {},
"createdAt": "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 organization with this id in the key’s environment.

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"
}
}