Skip to main content
PATCH
https://api.bunship.com
/
api
/
v1
/
organizations
/
{orgId}
/
members
/
{memberId}
Update Member Role
curl --request PATCH \
  --url https://api.bunship.com/api/v1/organizations/{orgId}/members/{memberId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "role": "<string>"
}
'
{
  "id": "mbr_def456",
  "userId": "usr_xyz789ghi012345",
  "organizationId": "org_cld2abc123def456",
  "role": "admin",
  "user": {
    "id": "usr_xyz789ghi012345",
    "email": "[email protected]",
    "fullName": "Jane Smith",
    "avatarUrl": null
  },
  "joinedAt": "2024-02-01T14:30:00Z"
}
Updates a member’s role. You cannot change the owner’s role (transfer ownership first) or your own role. Requires the members:update permission.

Auth

Requires a valid Bearer token with members:update permission.

Path Parameters

orgId
string
required
Organization identifier.
memberId
string
required
Membership identifier of the member to update.

Request Body

role
string
required
New role for the member. One of "admin", "member", or "viewer". Cannot assign "owner" — use ownership transfer instead.

Response

Returns the updated member object with embedded user profile.
{
  "id": "mbr_def456",
  "userId": "usr_xyz789ghi012345",
  "organizationId": "org_cld2abc123def456",
  "role": "admin",
  "user": {
    "id": "usr_xyz789ghi012345",
    "email": "[email protected]",
    "fullName": "Jane Smith",
    "avatarUrl": null
  },
  "joinedAt": "2024-02-01T14:30:00Z"
}

Errors

StatusCodeDescription
400VALIDATION_ERRORCannot change owner role or your own role
401AUTHENTICATION_ERRORMissing or invalid Bearer token
403AUTHORIZATION_ERRORInsufficient permissions (members:update required)
404NOT_FOUNDMember not found in this organization

Example

curl -X PATCH https://api.bunship.com/api/v1/organizations/org_cld2abc123def456/members/mbr_def456 \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
  -H "Content-Type: application/json" \
  -d '{"role": "admin"}'