Skip to main content
import { createClient } from "@mailsai/sdk";

const client = createClient(); // reads MAILS_API_KEY

const result = await client.agents.archive(
  "agt_01JZX8K3M9Q4P7VN2YB6RTDC0E",
);
console.log(result);
{
  "id": "agt_01JZX8K3M9Q4P7VN2YB6RTDC0E",
  "status": "archived",
  "archived_at": "2026-10-04T12:00:00.000Z"
}

Archive an agent

Soft-deletes the agent (sets status to archived).
DELETE/v1/agents/{id}scope · manage
import { createClient } from "@mailsai/sdk";

const client = createClient(); // reads MAILS_API_KEY

const result = await client.agents.archive(
  "agt_01JZX8K3M9Q4P7VN2YB6RTDC0E",
);
console.log(result);
{
  "id": "agt_01JZX8K3M9Q4P7VN2YB6RTDC0E",
  "status": "archived",
  "archived_at": "2026-10-04T12:00:00.000Z"
}

Path Parameters

idstringrequired

Agent id or name.

The address is retained and cannot be reused, and archiving cannot be undone. The agent sends nothing more; mail that reaches it is still received, stored and sent to your webhooks as before, so none is lost. A pause by our abuse-prevention system or for the agent's bounce or complaint rate stays as its pause_reason; one for the workspace's bounce or complaint rate stays until the hourly check finds that rate recovered, and then reads archived_via_api. A test key cannot archive an agent that has a live key tied to it, live mail (sent, scheduled or received) or a draft a live key made (403 live_mode_required).

Response

idstring

Id of the archived agent (agt_…), also when the path named it by name.

statusstring

Always archived. The agent's address stays taken and cannot be given to a new agent.

One of: archived

archived_atstring

The time of this call. It is not kept on the agent, so archiving an archived agent again returns a new time.

Was this page helpful?