-
Notifications
You must be signed in to change notification settings - Fork 8
Remove Workspace Members #242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,157 @@ | ||
| --- | ||
| title: Remove workspace member | ||
| description: Remove a member from a workspace via Plane API. HTTP POST request to deactivate users across projects and teamspaces. | ||
| keywords: plane api, remove member, delete member, workspace members, user management, rest api, api integration | ||
| --- | ||
|
|
||
| # Remove workspace member | ||
|
|
||
| <div class="api-endpoint-badge"> | ||
| <span class="method post">POST</span> | ||
| <span class="path">/api/v1/workspaces/{slug}/members/remove/</span> | ||
| </div> | ||
|
|
||
| <div class="api-two-column"> | ||
| <div class="api-left"> | ||
|
|
||
| Removes a member from a workspace. This deactivates them across all projects, removes them from teamspaces and pages, and optionally reduces seat count. | ||
|
|
||
| <div class="params-section"> | ||
|
|
||
| ### Path parameters | ||
|
|
||
| <div class="params-list"> | ||
|
|
||
| <ApiParam name="slug" type="string" :required="true"> | ||
|
|
||
| The unique identifier (slug) for the workspace. | ||
|
|
||
| </ApiParam> | ||
|
|
||
| </div> | ||
| </div> | ||
|
|
||
| <div class="params-section"> | ||
|
|
||
| ### Body Parameters | ||
|
|
||
| <div class="params-list"> | ||
|
|
||
| <ApiParam name="email" type="string" :required="true"> | ||
|
|
||
| Email address of the member to remove. | ||
|
|
||
| </ApiParam> | ||
|
|
||
| <ApiParam name="remove_seat" type="boolean" :required="false"> | ||
|
|
||
| Reduce purchased seat count by 1. Defaults to `false`. | ||
|
|
||
| </ApiParam> | ||
|
|
||
| </div> | ||
| </div> | ||
|
|
||
| <div class="params-section"> | ||
|
|
||
| ### Scopes | ||
|
|
||
| `write` or `workspaces:members:write` | ||
|
|
||
| </div> | ||
|
|
||
| <div class="params-section"> | ||
|
|
||
| ### Responses | ||
|
|
||
| | Status | Description | | ||
| | ------ | -------------------------------------- | | ||
| | 204 | Member removed successfully (no body) | | ||
| | 400 | Validation error (see below) | | ||
| | 403 | You are not a member of this workspace | | ||
| | 404 | Workspace or member not found | | ||
|
|
||
| **400 Validation Errors:** | ||
|
|
||
| - `email` field is required. | ||
| - Cannot remove yourself. You'll need leave the workspace from the application. | ||
| - Cannot remove a member with a higher role than yours. | ||
| - Member is the sole admin of one or more projects — promote another admin first. | ||
|
|
||
| </div> | ||
|
|
||
| <div class="params-section"> | ||
|
|
||
| ### What happens | ||
|
|
||
| - Member is deactivated in all projects. | ||
| - Member is removed from all teamspaces and shared pages | ||
| - If `remove_seat` is `true` and unused seats exist, one seat is removed from your plan. | ||
| </div> | ||
|
|
||
| </div> | ||
| <div class="api-right"> | ||
|
|
||
| <CodePanel title="Remove workspace member" :languages="['cURL', 'Python', 'JavaScript']"> | ||
| <template #curl> | ||
|
|
||
| ```bash | ||
| curl -X POST \ | ||
| "https://api.plane.so/api/v1/workspaces/my-workspace/members/remove/" \ | ||
| -H "X-API-Key: $PLANE_API_KEY" \ | ||
| # Or use -H "Authorization: Bearer $PLANE_OAUTH_TOKEN" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{ | ||
| "email": "jane@example.com", | ||
| "remove_seat": true | ||
| }' | ||
|
Comment on lines
+99
to
+107
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The cURL example breaks when copied into a shell. The inline Suggested fix curl -X POST \
"https://api.plane.so/api/v1/workspaces/my-workspace/members/remove/" \
-H "X-API-Key: $PLANE_API_KEY" \
- # Or use -H "Authorization: Bearer $PLANE_OAUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "jane@example.com",
"remove_seat": true
}'
+
+# Or replace the API key header with:
+# -H "Authorization: Bearer $PLANE_OAUTH_TOKEN"🤖 Prompt for AI Agents |
||
| ``` | ||
|
|
||
| </template> | ||
| <template #python> | ||
|
|
||
| ```python | ||
| import requests | ||
|
|
||
| response = requests.post( | ||
| "https://api.plane.so/api/v1/workspaces/my-workspace/members/remove/", | ||
| headers={"X-API-Key": "your-api-key"}, | ||
| json={ | ||
| "email": "jane@example.com", | ||
| "remove_seat": True | ||
| } | ||
| ) | ||
| print(response.status_code) # 204 on success | ||
| ``` | ||
|
|
||
| </template> | ||
| <template #javascript> | ||
|
|
||
| ```javascript | ||
| const response = await fetch("https://api.plane.so/api/v1/workspaces/my-workspace/members/remove/", { | ||
| method: "POST", | ||
| headers: { | ||
| "X-API-Key": "your-api-key", | ||
| "Content-Type": "application/json", | ||
| }, | ||
| body: JSON.stringify({ | ||
| email: "jane@example.com", | ||
| remove_seat: true, | ||
| }), | ||
| }); | ||
| console.log(response.status); // 204 on success | ||
| ``` | ||
|
|
||
| </template> | ||
| </CodePanel> | ||
|
|
||
| <ResponsePanel status="204"> | ||
|
|
||
| ```json | ||
| No Content | ||
| ``` | ||
|
Comment on lines
+148
to
+152
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don’t present a 204 response as JSON.
🤖 Prompt for AI Agents |
||
|
|
||
| </ResponsePanel> | ||
|
|
||
| </div> | ||
| </div> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heading level skips from h1 to h3.
Per the markdownlint MD001 rule, heading levels should increment by one. The document jumps from
# Remove workspace member(h1) directly to### Path parameters(h3), skipping h2.Consider wrapping the parameters sections under an h2 heading for proper document structure:
Proposed fix
📝 Committable suggestion
🧰 Tools
🪛 markdownlint-cli2 (0.21.0)
[warning] 21-21: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3
(MD001, heading-increment)
🤖 Prompt for AI Agents