Update workspace limits
Set a workspace's monthly allocation from the organisation pool and pause or resume its sending with an organisation key — enforceable limits per customer.
PUT /v3/organisation/workspaces/{id}/limits
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
monthly_allocation | integer | Optional | Shared-pool organisations only. The sum of all workspace allocations may not exceed the pool (400 pool_exceeded; the message says how much is still free). |
sending_paused | boolean | Optional | true pauses the workspace's sending immediately; false resumes it. A pause set by wemail staff cannot be lifted (403 sending_locked). |
Response (200)
json
{
"quota_model": "shared_pool",
"plan": "professional",
"monthly_allocation": 50000,
"monthly_limit": 50000,
"daily_limit": null,
"sending_paused": false,
"sending_paused_by": null
}Responses
| Status | Description |
|---|---|
200 | OK. The workspace's limits after the change. |
400 | Validation error, pool_exceeded, or an allocation on a separate-workspace organisation. |
401 | Missing or invalid organisation key — workspace keys (afn_live_ / afn_test_) are refused here by design. |
403 | insufficient_scope — the key lacks limits:write — or ip_not_allowed. Or sending_locked. |
404 | No workspace with this id in your organisation (ids of other organisations are never revealed). |
409 | The workspace is archived or suspended. |
Code examples
cURL
curl -X PUT https://api.wemail.io/v3/organisation/workspaces/9d2f6c1e-4b3a-4e7d-8a1f-0c5b7e9d2a64/limits \
-H "Authorization: Bearer afn_org_…" \
-H "Content-Type: application/json" \
-d '{
"monthly_allocation": 50000,
"sending_paused": false
}'Node.js
const res = await fetch("https://api.wemail.io/v3/organisation/workspaces/9d2f6c1e-4b3a-4e7d-8a1f-0c5b7e9d2a64/limits", {
method: "PUT",
headers: { Authorization: "Bearer " + process.env.WEMAIL_ORG_KEY, "Content-Type": "application/json" },
body: JSON.stringify({"monthly_allocation": 50000, "sending_paused": false}),
});
console.log(await res.json());Python
import os, requests
res = requests.put(
"https://api.wemail.io/v3/organisation/workspaces/9d2f6c1e-4b3a-4e7d-8a1f-0c5b7e9d2a64/limits",
headers={"Authorization": "Bearer " + os.environ["WEMAIL_ORG_KEY"]},
json={"monthly_allocation": 50000, "sending_paused": false},
)
print(res.json())ResponseExample response
{
"quota_model": "shared_pool",
"plan": "professional",
"monthly_allocation": 50000,
"monthly_limit": 50000,
"daily_limit": null,
"sending_paused": false,
"sending_paused_by": null
}