VocalDocscontracts 1.65.0

Change the role or status of a Member

PATCH /v1/members/{member_id}

PropertyValue
Operationupdate_member
GroupMembers
Scopemembers:write
Route classcontrol
IdempotencyNo Idempotency-Key
AuditAudited identity.member.update (mutation)
Released in1.12.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Applies the named fields at the revision If-Match names; disabled stops the Member signing in. From 1.51.0 a write that would leave the Organization without an owner (removing the only owner, demoting it to another role or disabling it) is refused with last_owner and one detail whose reason is a LastOwnerChange, and changes nothing. That rule is checked first; then a caller that is not an owner and removes, demotes or disables an owner is refused with forbidden and the detail owner_required, because only an owner changes an owner. From 1.34.0 a write that gives the operator role is refused with forbidden and the one detail operator_role_not_grantable, at path /role, in any Organization but the operator Organization, whoever asks, and there to any caller that does not hold the operator role; a write that keeps the role or takes it away is not a grant. Phase 0 accepts a Member ID token for this route, so an operator signed in to the cockpit makes the write.

Request

Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the members:write scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.

curl -X PATCH "$VOCAL_API/v1/members/mem_..." \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H 'If-Match: "1"' \
  -H "Content-Type: application/json" \
  -d '{}'

Parameters

NameInTypeRequiredDescription
member_idpathMemberIdyesThe id of a Member: mem_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
if-matchheaderstringyesThe revision the change was made against, quoted as the ETag returns it, or * to overwrite.

Request body

Content type application/json, required: MemberUpdateRequest.

FieldTypeRequiredDescription
roleMemberRoleno
statusone of "active", "disabled"nodisabled stops the Member signing in; active allows it again.

Responses

StatusContent typeShapeError codes
200application/jsonMember
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopelast_owner
412application/jsonErrorEnveloperevision_mismatch
422application/jsonErrorEnvelopevalidation_failed
428application/jsonErrorEnvelopeprecondition_required
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 200 answer

The shape is Member.

FieldTypeRequiredDescription
created_atTimestampyes
display_namestring or nullyesA display name.
emailstringyesAn email address, compared ignoring case.
idMemberIdyes
invitation_expires_atTimestamp or nullnoWhen the invitation of an invited Member lapses (1.51.0): 72 hours after the invitation or the approval that created it. Null once the Member is active or disabled, and for a Member the seed created; absent from an api before 1.51.0. After it a sign-in with the email is refused with invitation_expired.
invited_byMemberId or nullnoThe Member who invited or approved this Member (1.51.0), or null when the seed or an operator command created it; absent from an api before 1.51.0.
last_sign_in_atTimestamp or nullyesThe last sign-in, or null before the first.
object"member"yes
revisionintegeryesCounts writes to the Member; returned as the ETag and required in If-Match.
roleMemberRoleyes
statusMemberStatusyes
updated_atTimestampyes