Update a subaccount
Rename a subaccount or change its status with the wemail API. Status changes take effect immediately for the tenant record under your parent account.
Update the display name or switch the tenant between active and suspended. The slug is immutable, and there is no delete endpoint — suspend tenants you no longer use.
PUT /v3/subaccounts/{id}
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Optional | New display name (1–255 chars). Omit to leave unchanged. |
status | string | Optional | Switch the tenant between active and suspended. |
Responses
| Status | Description |
|---|---|
200 | OK. The updated subaccount. |
400 | Validation error. |
401 | Missing or invalid API key. |
404 | No subaccount with this id on your account. |
Code examples
cURL
curl -X PUT https://api.wemail.io/v3/subaccounts/{id} \
-H "Authorization: Bearer afn_live_…" \
-H "Content-Type: application/json" \
-d '{ "name": "Acme Corp (updated)", "status": "active" }'Node.js
const res = await fetch("https://api.wemail.io/v3/subaccounts/{id}", {
method: "PUT",
headers: {
Authorization: `Bearer ${process.env.WEMAIL_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ "name": "Acme Corp (updated)", "status": "active" }),
});
const data = await res.json();Python
import os, requests
r = requests.put(
"https://api.wemail.io/v3/subaccounts/{id}",
headers={"Authorization": f"Bearer {os.environ['WEMAIL_API_KEY']}"},
json={ "name": "Acme Corp (updated)", "status": "active" },
)
data = r.json()