Skip to content

Remove somebody from a company, or leave it

DELETE
/v1/companies/{id}/members/{userId}
curl --request DELETE \
--url https://beta-api.plune.ai/v1/companies/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/members/example \
--header 'Authorization: Bearer <token>'

The owner removes a manager, a member or a reader; a manager removes members and readers, not another manager (403 manager_cannot_touch_manager); anybody but the owner removes themself — that is “Leave”. Nobody removes the owner (409 owner_protected) and the owner does not leave (409 owner_must_hand_over) — ADR 0050 §4. They go out of every project of the company in the same transaction, and off the cases they held there; their own projects are not the company’s business. Refused whole (409) when they own one of its projects — the answer names that project, whose ownership is handed over first.

id
required
string format: uuid
userId
required
string

The member’s userId — your own to leave

Removed — from the company and from its projects

No / invalid token or session

A member or a reader asked about somebody else — or a manager about another manager (code: manager_cannot_touch_manager)

Media type application/json
object
error
required
string
Example
{
"error": "company owner or manager only"
}

No such company among yours, or no such member in it

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

The owner of the company, or of one of its projects — projectId names which project

Media type application/json
object
error
required
string
code
string
Allowed values: owner_protected owner_must_hand_over
projectId
string
Example
{
"error": "owner@example.com is the owner of «Mobile app» — its ownership is handed over first",
"code": "owner_protected",
"projectId": "9c4e7d10-0000-4000-8000-0000000000a4"
}

Rate-limited: the per-route throttle, or the per-minute request limit of the plan an API token counts by (#1442; the body names the plan, #2092). Retry-After carries the seconds until the window rolls over.

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}
Retry-After
integer

Seconds until the window rolls over