Docs
Migrating from v1Email accounts

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 APINew API
Method + routeDELETE /v1/email-accounts/{emailAccountId}DELETE /v2/workspaces/{workspaceId}/accounts/{id}
Key permission (scope)any keyaccounts:write (key owner needs editor role or higher)
Rate bucket20/min sharedwrite
Plan needed--

What changed

  • Only the path changed (now under the workspace).
  • Success is still 204 No Content with an empty body. There is no data or meta on success.

Path and query parameters

NameInTypeRequiredDefault / limitsWhat it meansOld name
workspaceIdpathnumberyes-Your TrulyInbox workspace id.-
idpathnumberyes-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

HTTPerror.codeWhen it happensWhat to do
401unauthorized / invalid_api_keyKey missing, wrong or revoked.Check the Authorization: Bearer header.
403insufficient_scopeThe key lacks accounts:write.Add the scope to the key.
403workspace_forbiddenThe key cannot access this workspaceId.Use the right workspace id or key.
403forbiddenThe key owner is only a viewer in this workspace.Use a key from an editor.
403subscription_pausedThe subscription is paused.Resume the subscription.
404not_foundNo account with this id in this workspace (or it was already deleted).If you are retrying a delete, treat it as done.
429rate_limit_exceededWrite 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 APINew API
Method + routePOST /v1/email-accounts/bulk-deleteremoved - call DELETE /v2/workspaces/{workspaceId}/accounts/{id} once per account
Key permission (scope)any keyaccounts:write (for each DELETE)
Rate bucket20/min sharedwrite (each DELETE counts once)
Plan needed--

What changed

  • There is no bulk delete. Send one DELETE per 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 429 replies.

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)
done

Replacement 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.