Skip to content

Give or take the application owner role

POST
/v1/admin/roles
curl --request POST \
--url https://beta-api.plune.ai/v1/admin/roles \
--header 'Content-Type: application/json' \
--cookie plune_session=<plune_session> \
--data '{ "email": "[email protected]", "role": "owner" }'

In place of an UPDATE users SET role on the host (ADR 0055, C). The change and its row in the admin journal are one transaction, and the Slack channel is told when a webhook is set (a Slack that is down does not stop it; the failure is a journal row). The last owner cannot be taken (409). The first owner is still made outside the API. The owner’s session alone: an admin token is told 403, anyone else 404. Ten a minute.

Media type application/json
object
email
required
string
role
required
string
Allowed values: owner user
Example
{
"email": "[email protected]",
"role": "owner"
}

Done, or the account already had the role

Media type application/json
object
userId
required
string
email
required
string
role
required
string
Allowed values: owner user
previousRole

Only when changed is true

string
Allowed values: owner user
changed
required

False when the account already had that role: nothing is written and nobody is told

boolean
Example
{
"role": "owner",
"previousRole": "owner"
}

The body is not valid

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

An admin token was used (code: session_required)

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

Not found, or no such account

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

The last owner cannot be taken (code: last_owner)

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

Rate-limited: the per-route throttle, or the per-minute request limit of the plan an API token counts by (#1442; the body names the plan, #2092). Retry-After carries the seconds until the window rolls over.

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}
Retry-After
integer

Seconds until the window rolls over