Remove a workspace member

Remove a member from a workspace with an organisation key. Guests lose this workspace only; the workspace owner cannot be removed.

A guest loses this workspace only; a home member of the workspace is removed from it. The workspace owner cannot be removed (403).

DELETE /v3/organisation/workspaces/{id}/members/{user_id}

Response (200)

json
{
  "message": "Member removed"
}

Responses

StatusDescription
200OK. { "message": "Member removed" }.
401Missing or invalid organisation key — workspace keys (afn_live_ / afn_test_) are refused here by design.
403insufficient_scope — the key lacks members:write — or ip_not_allowed. Or the member is the workspace owner.
404No such workspace or member.

Code examples

cURL
curl -X DELETE https://api.wemail.io/v3/organisation/workspaces/9d2f6c1e-4b3a-4e7d-8a1f-0c5b7e9d2a64/members/c1d2e3f4-5a6b-4c7d-8e9f-0a1b2c3d4e5f \
  -H "Authorization: Bearer afn_org_…"
Node.js
const res = await fetch("https://api.wemail.io/v3/organisation/workspaces/9d2f6c1e-4b3a-4e7d-8a1f-0c5b7e9d2a64/members/c1d2e3f4-5a6b-4c7d-8e9f-0a1b2c3d4e5f", {
  method: "DELETE",
  headers: { Authorization: "Bearer " + process.env.WEMAIL_ORG_KEY },
});
console.log(await res.json());
Python
import os, requests

res = requests.delete(
    "https://api.wemail.io/v3/organisation/workspaces/9d2f6c1e-4b3a-4e7d-8a1f-0c5b7e9d2a64/members/c1d2e3f4-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
    headers={"Authorization": "Bearer " + os.environ["WEMAIL_ORG_KEY"]},
)
print(res.json())
ResponseExample response
{
  "message": "Member removed"
}