Change a member's role, or hand the account's ownership to them; a change that lowers it ends its sessions
PATCH
/v1/memberships/{id}
const url = 'https://example.com/v1/memberships/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"owner":true,"role":"admin"}'};
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://example.com/v1/memberships/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "owner": true, "role": "admin" }'Who: a signed-in user, not an API key. Not for API keys.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
owner
boolean | null
role
string | null
Responses
Section titled “Responses”OK
Media typeapplication/json
object
account
required
object
id
integer format: int64
kind
required
string | null
account_name
required
string
created_at
required
string | null format: date-time
created_by
required
id
string
owner
required
boolean
role
required
string | null
status
required
string | null
updated_at
required
string | null format: date-time
user
Any of:
object
created_at
required
string format: date-time
created_by
required
email
required
string
email_verified_at
required
string | null format: date-time
id
required
string
last_signed_in_at
required
string | null format: date-time
name
required
string
status
required
string | null
time_zone
required
string
updated_at
required
string format: date-time
null
user_id
required
string
Example
{ "account": { "kind": "network" }, "created_by": { "kind": "user" }, "role": "admin", "status": "invited", "user": { "created_by": { "kind": "user" }, "status": "invited" }}default
Section titled “default”An error, as go-commons apperr maps it
Media typeapplication/json
object
error
required
object
code
required
string
fields
object
key
additional properties
string
message
required
string
Example generated
{ "error": { "code": "example", "fields": { "additionalProperty": "example" }, "message": "example" }}