Change a member's role
Change a workspace member's role with an organisation key. The owner role is transferred from the console only.
PUT /v3/organisation/workspaces/{id}/members/{user_id}
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
role | string | Required | admin, developer, marketer, billing or viewer. |
Response (200)
json
{
"member": {
"id": "c1d2e3f4-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
"name": "Dana Developer",
"email": "dev@acme-eu.example",
"role": "admin",
"initials": "DD",
"color": "#5b8def",
"status": "active",
"external": false,
"created_at": "2026-10-29T10:10:00Z",
"invitation_expires_at": "2026-11-05T10:10:00Z"
}
}Responses
| Status | Description |
|---|---|
200 | OK. { member } after the change. |
400 | Validation error. |
401 | Missing or invalid organisation key — workspace keys (afn_live_ / afn_test_) are refused here by design. |
403 | insufficient_scope — the key lacks members:write — or ip_not_allowed. Or an attempt to change the owner. |
404 | No such workspace or member. |
Code examples
cURL
curl -X PUT https://api.wemail.io/v3/organisation/workspaces/9d2f6c1e-4b3a-4e7d-8a1f-0c5b7e9d2a64/members/c1d2e3f4-5a6b-4c7d-8e9f-0a1b2c3d4e5f \
-H "Authorization: Bearer afn_org_…" \
-H "Content-Type: application/json" \
-d '{
"role": "admin"
}'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: "PUT",
headers: { Authorization: "Bearer " + process.env.WEMAIL_ORG_KEY, "Content-Type": "application/json" },
body: JSON.stringify({"role": "admin"}),
});
console.log(await res.json());Python
import os, requests
res = requests.put(
"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"]},
json={"role": "admin"},
)
print(res.json())ResponseExample response
{
"member": {
"id": "c1d2e3f4-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
"name": "Dana Developer",
"email": "dev@acme-eu.example",
"role": "admin",
"initials": "DD",
"color": "#5b8def",
"status": "active",
"external": false,
"created_at": "2026-10-29T10:10:00Z",
"invitation_expires_at": "2026-11-05T10:10:00Z"
}
}