Update a subaccount

Rename a subaccount or change its status.

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

ParameterTypeRequiredDescription
namestringOptionalNew display name (1–255 chars). Omit to leave unchanged.
statusstringOptionalSwitch the tenant between active and suspended.

Responses

StatusDescription
200OK. The updated subaccount.
400Validation error.
401Missing or invalid API key.
404No 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()