Delete an account to Note: Microsoft redirect path
Permanently deletes the account and all its warmup history. This cannot be undone. Use "Disconnect an account" if you want to keep the data.
Delete an account
Permanently deletes the account and all its warmup history. This cannot be undone. Use "Disconnect an account" if you want to keep the data.
| Old API | New API | |
|---|---|---|
| Method + route | DELETE /v1/email-accounts/{emailAccountId} | DELETE /v2/workspaces/{workspaceId}/accounts/{id} |
| Key permission (scope) | any key | accounts:write (key owner needs editor role or higher) |
| Rate bucket | 20/min shared | write |
| Plan needed | - | - |
What changed
- Only the path changed (now under the workspace).
- Success is still
204 No Contentwith an empty body. There is nodataormetaon success.
Path and query parameters
| Name | In | Type | Required | Default / limits | What it means | Old name |
|---|---|---|---|---|---|---|
workspaceId | path | number | yes | - | Your TrulyInbox workspace id. | - |
id | path | number | yes | - | The account id. | emailAccountId |
Request body
No body.
Example request (new)
curl -X DELETE "$TI_BASE_URL/v2/workspaces/57/accounts/4821" \
-H "Authorization: Bearer ti_ws_your_key"Example request (old)
curl -X DELETE "https://lupus-edge.trulyinbox.com/v1/email-accounts/4821" \
-H "X-Api-Key: YOUR_API_KEY"Response (new)
204 No Content. No body.
Response (old)
204 No Content. No body.
Errors you should handle
| HTTP | error.code | When it happens | What to do |
|---|---|---|---|
| 401 | unauthorized / invalid_api_key | Key missing, wrong or revoked. | Check the Authorization: Bearer header. |
| 403 | insufficient_scope | The key lacks accounts:write. | Add the scope to the key. |
| 403 | workspace_forbidden | The key cannot access this workspaceId. | Use the right workspace id or key. |
| 403 | forbidden | The key owner is only a viewer in this workspace. | Use a key from an editor. |
| 403 | subscription_paused | The subscription is paused. | Resume the subscription. |
| 404 | not_found | No account with this id in this workspace (or it was already deleted). | If you are retrying a delete, treat it as done. |
| 429 | rate_limit_exceeded | Write bucket used up. | Wait error.retry_after seconds, then retry. |
Bulk delete (removed)
The old bulk delete endpoint has no new version. Delete accounts one at a time with "Delete an account".
| Old API | New API | |
|---|---|---|
| Method + route | POST /v1/email-accounts/bulk-delete | removed - call DELETE /v2/workspaces/{workspaceId}/accounts/{id} once per account |
| Key permission (scope) | any key | accounts:write (for each DELETE) |
| Rate bucket | 20/min shared | write (each DELETE counts once) |
| Plan needed | - | - |
What changed
- There is no bulk delete. Send one
DELETEper account. - The old per-id result (
deleted,errorCode) becomes the HTTP status of each call:204= deleted,404 not_found= did not exist. - Each DELETE uses one write request. Your plan's write budget per minute is small (for example 10 on Growth), so pace the loop and obey
429replies.
Path and query parameters
See "Delete an account".
Request body
No body (for each DELETE).
Example request (new) - replacement loop in bash
WORKSPACE_ID=57
for ID in 4821 4907 4912; do
CODE=$(curl -s -o /dev/null -w "%{http_code}" -X DELETE \
"$TI_BASE_URL/v2/workspaces/$WORKSPACE_ID/accounts/$ID" \
-H "Authorization: Bearer ti_ws_your_key")
echo "$ID -> $CODE" # 204 = deleted, 404 = not found
sleep 7 # stay under the write limit (about 10 per minute)
doneReplacement loop in JavaScript, with retry on 429:
async function bulkDelete(workspaceId, ids, apiKey) {
const results = [];
for (const id of ids) {
// One request at a time: they share the write rate limit.
while (true) {
const res = await fetch(
`${process.env.TI_BASE_URL}/v2/workspaces/${workspaceId}/accounts/${id}`,
{ method: "DELETE", headers: { Authorization: `Bearer ${apiKey}` } }
);
if (res.status === 204) { results.push({ id, deleted: true }); break; }
const body = await res.json();
if (res.status === 429) {
const wait = Number(res.headers.get("Retry-After") ?? body.error.retry_after ?? 10);
await new Promise((r) => setTimeout(r, wait * 1000));
continue; // try the same id again
}
results.push({ id, deleted: false, errorCode: body.error.code }); // e.g. "not_found"
break;
}
}
return results; // same idea as the old { results: [...] }
}Example request (old)
curl -X POST "https://lupus-edge.trulyinbox.com/v1/email-accounts/bulk-delete" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "emailAccountIds": [4821, 4907, 4912] }'Response (new)
Each DELETE returns 204 No Content with no body. See "Delete an account".
Response (old)
{
"results": [
{ "emailAccountId": 4821, "deleted": true },
{ "emailAccountId": 4907, "deleted": false, "errorCode": "not_found" }
]
}Errors you should handle
Same as "Delete an account", per call. Handle 429 rate_limit_exceeded by waiting Retry-After seconds and retrying the same id.
Note: Microsoft redirect path
The Microsoft sign-in redirect moved from GET /v1/email-accounts/microsoft/callback to GET /v2/email-accounts/microsoft/callback (no workspace id in this path). Microsoft sends the browser there after consent. You never call it yourself. It only matters if your network, proxy or security tool allow-lists redirect URLs: add /v2/email-accounts/microsoft/callback on the new API host.
Get an OAuth consent link to Disconnect an account
Returns a link that a person opens in a browser to connect a Gmail, Google Workspace, Outlook or Microsoft 365 mailbox. The mailbox is connected after they a...
Warmup
Move warmup status, settings, start/stop and bulk actions to the /v2 enable, pause and resume routes.