Change a member's role

Move a member to a different role. This is the only thing about a membership that can be changed. You can only give a role you hold yourself, so an admin cannot promote anybody to owner. And an organization always needs at least one owner who has accepted: demoting the last one is refused. The change takes effect on new authorization checks within about 30 seconds, after the gateway's short permission cache expires. Requires the `organizations.members.update` permission.

PATCH
/organizations/{organizationId}/members/{memberId}
AuthorizationBearer <token>

The access token returned after a successful sign-in, sent as Authorization: Bearer <access_token>.

It identifies the person and the organization they are working in, and it lasts about fifteen minutes. When it runs out, use their refresh token at POST /auth/refresh-token instead of asking them to sign in again.

In: header

Path Parameters

organizationId*string

Identifier of the organization. Each endpoint states whether it must be the caller's active organization or may be used without authentication.

memberId*string

Identifier of the membership record, not of the member's wallet.

Request Body

application/json

The role to move them to.

TypeScript Definitions

Use the request body type in TypeScript.

role_name*string

The role they should hold from now on. It must be one your own role allows you to hand out.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://api.dual.network/organizations/665f1c2d4b1a2c3d4e5f6aa0/members/665f1c2d4b1a2c3d4e5f6a70" \  -H "Content-Type: application/json" \  -d '{    "role_name": "admin"  }'
{}
{
  "code": 3,
  "message": "Key: 'limit' Error:Field validation for 'limit' failed on the 'lte' tag"
}

{
  "code": 16,
  "message": "no auth provided"
}

{
  "code": 5,
  "message": "object not found"
}
{
  "code": 13,
  "message": "internal error"
}