Workspace API
Remove a Member
Remove a member from the workspace with DELETE /workspace/members/{userId}.
DELETE https://api.parcelengineering.com/api/v1/workspace/members/{userId}Removes a user from the workspace. The caller must be an owner or admin (for user-token requests). API key callers are admin-equivalent.
This operation is idempotent. If the user is not a member of the workspace, the response returns { "deleted": false } with status 200 rather than an error.
The workspace must always have at least one owner. Removing the last owner returns 409 last_owner.
Remove a member costs 0 credits.
The Workspace API requires the Pro plan. A request from a non-Pro workspace receives 403 forbidden.
Path parameters
| Parameter | Description |
|---|---|
userId | UUID of the member to remove. Returned as id in the List Members response. |
Errors
| Code | Status | Description |
|---|---|---|
cannot_self_remove | 400 | The caller tried to remove their own membership (user-token requests). Use a different owner or admin to remove yourself. |
forbidden | 403 | The caller is not an owner or admin in this workspace. |
last_owner | 409 | Cannot remove the only remaining owner. Transfer ownership to another member first. |
Example
curl -X DELETE \ "https://api.parcelengineering.com/api/v1/workspace/members/d1e2f3a4-0002-4b7c-9e5d-000000000002" \ -H "Authorization: Bearer pcl_your_api_key"const response = await fetch( 'https://api.parcelengineering.com/api/v1/workspace/members/d1e2f3a4-0002-4b7c-9e5d-000000000002', { method: 'DELETE', headers: { 'Authorization': 'Bearer pcl_your_api_key', }, });
const { data, metadata } = await response.json();Response
{ "data": { "deleted": true }, "metadata": { "credits": 0 }}When the user was not a member of the workspace:
{ "data": { "deleted": false }, "metadata": { "credits": 0 }}Response fields
| Field | Type | Description |
|---|---|---|
data.deleted | boolean | true if the member was removed; false if the user was not in the workspace. |
metadata.credits | integer | Always 0. |