Skip to content

Workspace API

Update a Member

Change a workspace member's role with PATCH /workspace/members/{userId}.

Endpoint
PATCH https://api.parcelengineering.com/api/v1/workspace/members/{userId}

Changes the role of a workspace member. The caller must be an owner or admin (for user-token requests). API key callers are admin-equivalent.

The workspace must always have at least one owner. Demoting the last owner returns 409 last_owner.

Update a member costs 0 credits.

Path parameters

ParameterDescription
userIdUUID of the member whose role you want to change. Returned as id in the List Members response.

Request body

FieldTypeRequiredDescription
rolestringYesThe new role for the member: owner, admin, or member.

Errors

CodeStatusDescription
forbidden403The caller is not an owner or admin in this workspace.
not_found404The user is not a member of this workspace.
last_owner409Cannot demote the only remaining owner. Transfer ownership to another member first.

Example

Promote a member to admin
curl -X PATCH \
"https://api.parcelengineering.com/api/v1/workspace/members/d1e2f3a4-0002-4b7c-9e5d-000000000002" \
-H "Authorization: Bearer pcl_your_api_key" \
-H "Content-Type: application/json" \
-d '{ "role": "admin" }'

Response

Response
{
"data": {
"user_id": "d1e2f3a4-0002-4b7c-9e5d-000000000002",
"role": "admin"
},
"metadata": { "credits": 0 }
}

Response fields

FieldTypeDescription
data.user_idstring (UUID)The updated member’s user id.
data.rolestringThe member’s new role: owner, admin, or member.
metadata.creditsintegerAlways 0.