foliot docs

API reference / Platform / Change a person's platform role

Change a person's platform role

PATCH/platform/operators/{userId}

Authenticate with a signed-in Foliot Console session.

Sets the platform role of someone already on the platform; it never adds anyone (404 if they hold none). A signed-in person who holds a platform role (Tin Bee’s staff), read from Foliot’s own table on every request. Everyone else, an operator token and an app key included, is answered 404, the same bytes for all of them. A platform owner; a platform operator is 403. Setting the role they already hold changes nothing and answers 200. 409 if it would demote the platform’s only owner: make someone else a platform owner first. A request naming platform_owner asks Clerk, as adding does, that the person has a verified @tinbee.com address (409 if not, 503 if Clerk cannot be asked), even when they already are one; a demotion asks nothing. The caller’s own platform role is read again at the moment of the change. Applies to the person’s very next request, and is recorded in the platform’s history.

Path parameters

userId
string (uuid)
REQUIRED

Foliot's id for the person (userId in the operators list), not their Clerk id.

Request body

role
"platform_owner" | "platform_operator"
REQUIRED

The platform role they are to have.

Responses

200 object OK
400 Error Invalid request.
401 Error Missing, malformed or unknown bearer token.
403 Error The token is valid but not permitted on this route.
404 Error No such resource.
409 Error Conflicts with existing state.
503 Error A dependency this route needs is unreachable.