Skip to content

Commit 6bfa43c

Browse files
committed
Remove Workspace Members
1 parent 224c2c0 commit 6bfa43c

File tree

2 files changed

+161
-0
lines changed

2 files changed

+161
-0
lines changed

docs/.vitepress/config.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,7 @@ export default withMermaid(
703703
{ text: "Overview", link: "/api-reference/members/overview" },
704704
{ text: "Get Workspace Members", link: "/api-reference/members/get-workspace-members" },
705705
{ text: "Get Project Members", link: "/api-reference/members/get-project-members" },
706+
{ text: "Remove Workspace Members", link: "/api-reference/members/remove-workspace-member" },
706707
],
707708
},
708709
{
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
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(
132+
"https://api.plane.so/api/v1/workspaces/my-workspace/members/remove/",
133+
{
134+
method: "POST",
135+
headers: {
136+
"X-API-Key": "your-api-key",
137+
"Content-Type": "application/json",
138+
},
139+
body: JSON.stringify({
140+
email: "jane@example.com",
141+
remove_seat: true,
142+
}),
143+
}
144+
);
145+
console.log(response.status); // 204 on success
146+
```
147+
148+
</template>
149+
</CodePanel>
150+
151+
<ResponsePanel status="204">
152+
153+
```json
154+
No Content
155+
```
156+
157+
</ResponsePanel>
158+
159+
</div>
160+
</div>

0 commit comments

Comments
 (0)