Give or take the application owner role
const url = 'https://beta-api.plune.ai/v1/admin/roles';const options = { method: 'POST', headers: { cookie: 'plune_session=<plune_session>', 'Content-Type': 'application/json' },};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://beta-api.plune.ai/v1/admin/roles \ --header 'Content-Type: application/json' \ --cookie plune_session=<plune_session> \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.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
Example
{ "role": "owner"}Responses
Section titled “ Responses ”Done, or the account already had the role
object
Only when changed is true
False when the account already had that role: nothing is written and nobody is told
Example
{ "role": "owner", "previousRole": "owner"}The body is not valid
object
Example generated
{ "error": "example"}An admin token was used (code: session_required)
object
Example generated
{ "error": "example"}Not found, or no such account
object
Example generated
{ "error": "example"}The last owner cannot be taken (code: last_owner)
object
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.
object
Example generated
{ "error": "example"}Headers
Section titled “Headers ”Seconds until the window rolls over