Skip to content

Change a person's roles

PUT
/api/settings/people/{id}/roles
curl --request PUT \
--url https://forge.example.com/api/settings/people/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/roles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "roles": [ "example" ], "version": 1 }'

Gives exactly the roles named. A role taken away ends their sessions; one added reaches them within ten minutes. Never your own, and never the last active administrator’s. Only an administrator on the central team gives or takes away central, but any administrator names its first member. Send the person’s version as you read it: it counts changes to their roles, by anyone or by their identity provider’s groups, and to whether they are active. A stale one answers 409 with currentVersion, the version it has now. For administrators.

id
required
string format: uuid
Media typeapplication/json
object
roles
required
Array<string>
version
required
null | integer | string format: int32
/^-?(?:0|[1-9]\d*)$/

Example generated

{
"roles": [
"example"
],
"version": 1
}

OK

Media typeapplication/json
object
id
required
string format: uuid
email
required
string
displayName
required
string
roles
required
Array<string>
isActive
required
boolean
authenticatorApp
required
boolean
passkeys
required
integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
isYou
required
boolean
deactivatedAt
null | string format: date-time
singleSignOn
boolean
version
integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
provisioned
boolean

Example

{
"singleSignOn": false
}

A refusal or an error, as a problem document. A model or draft you may not see answers 404, as one that does not exist.

Media typeapplication/problem+json
object
type
string
title
string
status
integer
detail
string
instance
string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}