Change a Member's role
const url = 'https://app.caprid.com/v1/organizations/4/members/12';const options = { method: 'PATCH', headers: { cookie: '__Host-switchboard_session=<__Host-switchboard_session>', '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 https://app.caprid.com/v1/organizations/4/members/12 \ --header 'Content-Type: application/json' \ --cookie __Host-switchboard_session=<__Host-switchboard_session> \ --data '{ "role": "owner" }'Owners only, signed in with a session. An API key can never manage Members, so a leaked one can’t be used to let its holder in.
An Organization always has an Owner. To step down as the last one, make someone else an Owner first.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The Organization’s id, from GET /v1/organizations.
Example
4The Member’s account_id, from the list.
Example
12Request Bodyrequired
Section titled “Request Bodyrequired”object
Example
{ "role": "owner"}Responses
Section titled “Responses”The Member, with the new role.
An Account that belongs to an Organization.
object
Identifies the Member in routes.
Every Member manages everything the Organization owns. An Owner can also manage its Members and Invitations.
When the Account became a Member.
Example
{ "account_id": 12, "email": "alice@acme.example", "role": "owner"}The request is malformed or a field is invalid. The message says which.
object
Example
{ "error": "the requested grants exceed the key's scope"}No valid credential. Missing, expired and revoked credentials all get the same response, and so does an API key whose trial has lapsed. An Agent token from before a claim gets a 401 too, once the claim has made the trial a person’s, with a message saying to get a new token.
object
Example
{ "error": "the requested grants exceed the key's scope"}Headers
Section titled “Headers”Example
Bearer realm="switchboard"You aren’t an Owner, or you sent an API key.
object
Example
{ "error": "only an Owner can manage this Organization's Members"}No such thing, or not yours. Another customer’s Organization or Namespace is a 404 too, so nobody can tell which ones exist.
object
Example
{ "error": "the requested grants exceed the key's scope"}This would leave the Organization without an Owner.
object
Example
{ "error": "an Organization must always have an Owner; make someone else an Owner first"}