Skip to content

Update organization member roles

PATCH
/api/v1/organizations/{organizationId}/members/{userId}
curl --request PATCH \
--url https://localhost:8080/api/v1/organizations/example/members/example \
--header 'Authorization: <Authorization>' \
--header 'Content-Type: application/json' \
--data '{ "roles": [ "organization_owner" ] }'

Replace the roles assigned to an existing organization member

organizationId
required
string

Organization ID or UUID (bare or urn:uuid)

userId
required
string

User UUID (bare or urn:uuid) or did:key

Updated roles

Media type application/json
object
roles
required

Replaces the member’s roles

Array<string>
>= 1 items
Example
[
"organization_owner"
]

Member roles updated successfully

Media type application/json

The roles a member holds after the update, replacing whatever they held before

object
organizationId
integer
roles
Array<string>
userId
string
Example generated
{
"organizationId": 1,
"roles": [
"example"
],
"userId": "example"
}

Invalid request

Media type application/json

Error body returned across the auth endpoints; the message is human-readable and not a stable identifier

object
error
string
error_description
string
Example
{
"error": "Unauthorized",
"error_description": "Invalid token"
}

Unauthorized

Media type application/json

Error body returned across the auth endpoints; the message is human-readable and not a stable identifier

object
error
string
error_description
string
Example
{
"error": "Unauthorized",
"error_description": "Invalid token"
}

Forbidden - requires Organization Owner role

Media type application/json

Error body returned across the auth endpoints; the message is human-readable and not a stable identifier

object
error
string
error_description
string
Example
{
"error": "Unauthorized",
"error_description": "Invalid token"
}

Organization, user, or membership not found

Media type application/json

Error body returned across the auth endpoints; the message is human-readable and not a stable identifier

object
error
string
error_description
string
Example
{
"error": "Unauthorized",
"error_description": "Invalid token"
}

Internal server error

Media type application/json

Error body returned across the auth endpoints; the message is human-readable and not a stable identifier

object
error
string
error_description
string
Example
{
"error": "Unauthorized",
"error_description": "Invalid token"
}