Skip to navigation

Change a person's role

Sets the person’s role. The last owner cannot be given a lower role (409 last_owner): give another person owner first.

A lower role revokes, in the same transaction, the keys the person minted that the new role could not mint: every key with the admin scope when they drop below admin, and every key when they become a viewer. Keys minted from a revoked key are revoked with it. A drop to member or viewer also revokes the keys they minted in restricted projects they were not added to. Each revoked key gets an api_key.deleted audit entry with reason member.updated.

People: owner.

curl -sS -X PATCH "$MEADOW_BASE_URL/v1/members/$USER_ID" \
-H "Authorization: Bearer $SESSION_TOKEN" -H "Content-Type: application/json" \
-d '{"role": "admin"}'

Authentication

AuthorizationBearer

A Meadow API key, sent as Authorization: Bearer mdw_.... The header x-api-key: mdw_... is accepted in its place.

Path parameters

user_idstringRequired
The person's user id.

Request

This endpoint expects an object.
roleenumRequired

A person’s role in the account. owner: everything, and people. admin: everything except people. member: keys without the admin scope that they minted, stopping sandboxes, deleting images, and every read. viewer (shown as Read-only): every read. The dashboard labels viewer “Read-only”.

Allowed values:

Response headers

x-request-idstringOptional

Meadow’s id for this request, req_ and 24 hex characters. Every response carries it, including errors, streams and unknown routes. Every error in the Error schema repeats it as request_id. Quote it when you report a problem.

Response

The member with the new role.
user_idstring
emailstring
roleenum

A person’s role in the account. owner: everything, and people. admin: everything except people. member: keys without the admin scope that they minted, stopping sandboxes, deleting images, and every read. viewer (shown as Read-only): every read. The dashboard labels viewer “Read-only”.

Allowed values:
created_atdatetime
When the person joined the account.
invited_bystring or null
The user id of the person who sent the invite. Null for the first owner.
last_seen_atdatetime
The person's last request

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
500
Internal Server Error