|
| 1 | +--- |
| 2 | +title: Remove workspace member |
| 3 | +description: Remove a member from a workspace via Plane API. HTTP POST request to deactivate users across projects and teamspaces. |
| 4 | +keywords: plane api, remove member, delete member, workspace members, user management, rest api, api integration |
| 5 | +--- |
| 6 | + |
| 7 | +# Remove workspace member |
| 8 | + |
| 9 | +<div class="api-endpoint-badge"> |
| 10 | + <span class="method post">POST</span> |
| 11 | + <span class="path">/api/v1/workspaces/{slug}/members/remove/</span> |
| 12 | +</div> |
| 13 | + |
| 14 | +<div class="api-two-column"> |
| 15 | +<div class="api-left"> |
| 16 | + |
| 17 | +Removes a member from a workspace. This deactivates them across all projects, removes them from teamspaces and pages, and optionally reduces seat count. |
| 18 | + |
| 19 | +<div class="params-section"> |
| 20 | + |
| 21 | +### Path parameters |
| 22 | + |
| 23 | +<div class="params-list"> |
| 24 | + |
| 25 | +<ApiParam name="slug" type="string" :required="true"> |
| 26 | + |
| 27 | +The unique identifier (slug) for the workspace. |
| 28 | + |
| 29 | +</ApiParam> |
| 30 | + |
| 31 | +</div> |
| 32 | +</div> |
| 33 | + |
| 34 | +<div class="params-section"> |
| 35 | + |
| 36 | +### Body Parameters |
| 37 | + |
| 38 | +<div class="params-list"> |
| 39 | + |
| 40 | +<ApiParam name="email" type="string" :required="true"> |
| 41 | + |
| 42 | +Email address of the member to remove. |
| 43 | + |
| 44 | +</ApiParam> |
| 45 | + |
| 46 | +<ApiParam name="remove_seat" type="boolean" :required="false"> |
| 47 | + |
| 48 | +Reduce purchased seat count by 1. Defaults to `false`. |
| 49 | + |
| 50 | +</ApiParam> |
| 51 | + |
| 52 | +</div> |
| 53 | +</div> |
| 54 | + |
| 55 | +<div class="params-section"> |
| 56 | + |
| 57 | +### Scopes |
| 58 | + |
| 59 | +`write` or `workspaces:members:write` |
| 60 | + |
| 61 | +</div> |
| 62 | + |
| 63 | +<div class="params-section"> |
| 64 | + |
| 65 | +### Responses |
| 66 | + |
| 67 | +| Status | Description | |
| 68 | +| ------ | -------------------------------------- | |
| 69 | +| 204 | Member removed successfully (no body) | |
| 70 | +| 400 | Validation error (see below) | |
| 71 | +| 403 | You are not a member of this workspace | |
| 72 | +| 404 | Workspace or member not found | |
| 73 | + |
| 74 | +**400 Validation Errors:** |
| 75 | + |
| 76 | +- `email` field is required. |
| 77 | +- Cannot remove yourself. You'll need leave the workspace from the application. |
| 78 | +- Cannot remove a member with a higher role than yours. |
| 79 | +- Member is the sole admin of one or more projects — promote another admin first. |
| 80 | + |
| 81 | +</div> |
| 82 | + |
| 83 | +<div class="params-section"> |
| 84 | + |
| 85 | +### What happens |
| 86 | + |
| 87 | +- Member is deactivated in all projects. |
| 88 | +- Member is removed from all teamspaces and shared pages |
| 89 | +- If `remove_seat` is `true` and unused seats exist, one seat is removed from your plan. |
| 90 | +</div> |
| 91 | + |
| 92 | +</div> |
| 93 | +<div class="api-right"> |
| 94 | + |
| 95 | +<CodePanel title="Remove workspace member" :languages="['cURL', 'Python', 'JavaScript']"> |
| 96 | +<template #curl> |
| 97 | + |
| 98 | +```bash |
| 99 | +curl -X POST \ |
| 100 | + "https://api.plane.so/api/v1/workspaces/my-workspace/members/remove/" \ |
| 101 | + -H "X-API-Key: $PLANE_API_KEY" \ |
| 102 | + # Or use -H "Authorization: Bearer $PLANE_OAUTH_TOKEN" \ |
| 103 | + -H "Content-Type: application/json" \ |
| 104 | + -d '{ |
| 105 | + "email": "jane@example.com", |
| 106 | + "remove_seat": true |
| 107 | +}' |
| 108 | +``` |
| 109 | + |
| 110 | +</template> |
| 111 | +<template #python> |
| 112 | + |
| 113 | +```python |
| 114 | +import requests |
| 115 | + |
| 116 | +response = requests.post( |
| 117 | + "https://api.plane.so/api/v1/workspaces/my-workspace/members/remove/", |
| 118 | + headers={"X-API-Key": "your-api-key"}, |
| 119 | + json={ |
| 120 | + "email": "jane@example.com", |
| 121 | + "remove_seat": True |
| 122 | + } |
| 123 | +) |
| 124 | +print(response.status_code) # 204 on success |
| 125 | +``` |
| 126 | + |
| 127 | +</template> |
| 128 | +<template #javascript> |
| 129 | + |
| 130 | +```javascript |
| 131 | +const response = await fetch("https://api.plane.so/api/v1/workspaces/my-workspace/members/remove/", { |
| 132 | + method: "POST", |
| 133 | + headers: { |
| 134 | + "X-API-Key": "your-api-key", |
| 135 | + "Content-Type": "application/json", |
| 136 | + }, |
| 137 | + body: JSON.stringify({ |
| 138 | + email: "jane@example.com", |
| 139 | + remove_seat: true, |
| 140 | + }), |
| 141 | +}); |
| 142 | +console.log(response.status); // 204 on success |
| 143 | +``` |
| 144 | + |
| 145 | +</template> |
| 146 | +</CodePanel> |
| 147 | + |
| 148 | +<ResponsePanel status="204"> |
| 149 | + |
| 150 | +```json |
| 151 | +No Content |
| 152 | +``` |
| 153 | + |
| 154 | +</ResponsePanel> |
| 155 | + |
| 156 | +</div> |
| 157 | +</div> |
0 commit comments