Change a teammate's role — owner only
const url = 'http://localhost:3000/operator/team/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"role":"owner"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url http://localhost:3000/operator/team/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "role": "owner" }'The id must name an operator on the caller’s own tenant; anything else is 403, never a 404 that would confirm the id exists somewhere else. An operator may not change their own role — self-demotion is self-lockout one step removed.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Responses
Section titled “Responses”The updated teammate.
An operator on the caller’s own tenant. invite_pending is true until they accept their invite and set a password. No password material is ever returned.
object
Example
{ "role": "owner", "status": "active"}Invalid body
object
object
Present only for VALIDATION_FAILED.
object
Example
{ "error": { "code": "VALIDATION_FAILED" }}Invalid, expired, revoked, or absent token.
object
object
Present only for VALIDATION_FAILED.
object
Example
{ "error": { "code": "VALIDATION_FAILED" }}Caller is not an owner, the id belongs to another tenant, or the caller is acting on their own row.
object
object
Present only for VALIDATION_FAILED.
object
Example
{ "error": { "code": "VALIDATION_FAILED" }}The change would leave the tenant with no active owner, so nobody could ever invite or promote anyone again. The message names that reason in words the operator can act on — a deliberate exception to the terse-error rule, because it leaks nothing they cannot already see on the page.
object
object
Present only for VALIDATION_FAILED.
object
Example
{ "error": { "code": "VALIDATION_FAILED" }}