Skip to content

Change a Member's role

PATCH
/v1/organizations/{id}/members/{account}
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.

id
required
integer

The Organization’s id, from GET /v1/organizations.

Example

4
account
required
integer

The Member’s account_id, from the list.

Example

12
Media typeapplication/json
object
role
required
string
Allowed values: owner member

Example

{
"role": "owner"
}

The Member, with the new role.

Media typeapplication/json

An Account that belongs to an Organization.

object
account_id
required

Identifies the Member in routes.

integer
email
required
string
role
required

Every Member manages everything the Organization owns. An Owner can also manage its Members and Invitations.

string
Allowed values: owner member
joined_at
required

When the Account became a Member.

integer

Example

{
"account_id": 12,
"email": "alice@acme.example",
"role": "owner"
}

The request is malformed or a field is invalid. The message says which.

Media typeapplication/json
object
error
required
string

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.

Media typeapplication/json
object
error
required
string

Example

{
"error": "the requested grants exceed the key's scope"
}
WWW-Authenticate
string
Example
Bearer realm="switchboard"

You aren’t an Owner, or you sent an API key.

Media typeapplication/json
object
error
required
string

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.

Media typeapplication/json
object
error
required
string

Example

{
"error": "the requested grants exceed the key's scope"
}

This would leave the Organization without an Owner.

Media typeapplication/json
object
error
required
string

Example

{
"error": "an Organization must always have an Owner; make someone else an Owner first"
}