Change a person's roles
PUT
/api/settings/people/{id}/roles
const url = 'https://forge.example.com/api/settings/people/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/roles';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"roles":["example"],"version":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string format: uuid
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
roles
required
Array<string>
version
required
null | integer | string format: int32
Example generated
{ "roles": [ "example" ], "version": 1}Responses
Section titled “Responses”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
isYou
required
boolean
deactivatedAt
null | string format: date-time
singleSignOn
boolean
version
integer | string format: int32
provisioned
boolean
Example
{ "singleSignOn": false}default
Section titled “default”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"}