import { createClient } from "@mailsai/sdk";
const client = createClient(); // reads MAILS_API_KEY
const result = await client.agents.list({ limit: 10 });
console.log(result);from mailsai import create_client
client = create_client() # reads MAILS_API_KEY
result = client.list_agents(limit=10)
print(result)curl 'https://api.mails.ai/v1/agents?limit=10' \
-H "Authorization: Bearer $MAILS_API_KEY"mails agents list
mails agents list --status all --json{
"name": "mails_list_agents",
"arguments": { "limit": 10 }
}{
"data": [
{
"id": "agt_01JZX8K3M9Q4P7VN2YB6RTDC0E",
"name": "<name>",
"email": "jordan@example.com",
"domain": "<domain>",
"receiving_address": "jordan@example.com",
"workspace_id": "wsk_01JZX8K3M9Q4P7VN2YB6RTDC0E",
"status": "active",
"pause_reason": "<pause_reason>",
"daily_send_limit": 0,
"hourly_send_limit": 0,
"allowlist_domains": ["<allowlist_domains>"],
"blocklist_domains": ["<blocklist_domains>"],
"classify_inbound": false,
"unread_count": 0,
"forwarding": false,
"forwarding_address": "jordan@example.com",
"forwarding_status": "not_verified",
"forwarding_test_sent_at": "2026-10-04T12:00:00.000Z",
"forwarding_verified_at": "2026-10-04T12:00:00.000Z",
"created_at": "2026-10-04T12:00:00.000Z",
"updated_at": "2026-10-04T12:00:00.000Z"
}
],
"has_more": false,
"next_cursor": "<next_cursor>"
}200 A page of agents.
400 Invalid request — malformed JSON or a field failed
validation. Also feature_not_enabled when this
server has a feature switched off (custom domains
before they are available).
401 Missing or invalid API key.
403 The API key lacks the required scope
(insufficient_scope), or the token belongs to an
app connected by sign-in and this operation is
closed to connected apps
(connected_app_not_allowed).
500 Internal server error.List agents
Lists the workspace's agents, newest first.
import { createClient } from "@mailsai/sdk";
const client = createClient(); // reads MAILS_API_KEY
const result = await client.agents.list({ limit: 10 });
console.log(result);from mailsai import create_client
client = create_client() # reads MAILS_API_KEY
result = client.list_agents(limit=10)
print(result)curl 'https://api.mails.ai/v1/agents?limit=10' \
-H "Authorization: Bearer $MAILS_API_KEY"mails agents list
mails agents list --status all --json{
"name": "mails_list_agents",
"arguments": { "limit": 10 }
}{
"data": [
{
"id": "agt_01JZX8K3M9Q4P7VN2YB6RTDC0E",
"name": "<name>",
"email": "jordan@example.com",
"domain": "<domain>",
"receiving_address": "jordan@example.com",
"workspace_id": "wsk_01JZX8K3M9Q4P7VN2YB6RTDC0E",
"status": "active",
"pause_reason": "<pause_reason>",
"daily_send_limit": 0,
"hourly_send_limit": 0,
"allowlist_domains": ["<allowlist_domains>"],
"blocklist_domains": ["<blocklist_domains>"],
"classify_inbound": false,
"unread_count": 0,
"forwarding": false,
"forwarding_address": "jordan@example.com",
"forwarding_status": "not_verified",
"forwarding_test_sent_at": "2026-10-04T12:00:00.000Z",
"forwarding_verified_at": "2026-10-04T12:00:00.000Z",
"created_at": "2026-10-04T12:00:00.000Z",
"updated_at": "2026-10-04T12:00:00.000Z"
}
],
"has_more": false,
"next_cursor": "<next_cursor>"
}200 A page of agents.
400 Invalid request — malformed JSON or a field failed
validation. Also feature_not_enabled when this
server has a feature switched off (custom domains
before they are available).
401 Missing or invalid API key.
403 The API key lacks the required scope
(insufficient_scope), or the token belongs to an
app connected by sign-in and this operation is
closed to connected apps
(connected_app_not_allowed).
500 Internal server error.Query Parameters
limitinteger
Page size (1–100).
cursorstring
Opaque cursor from a previous page's next_cursor.
statusstring
Which agents to list. Defaults to live — everything except archived — because an archived agent cannot send, so listing tombstones by default answers a different question than the one you asked. Use all to include them, or filter to one exact status.
A key tied to one agent lists that agent and no other.
Response
dataobject[]
The items on this page, at most limit of them.
has_moreboolean
True when more items follow this page: pass next_cursor as cursor to get them.
next_cursorstring
Pass as cursor to fetch the next page. Absent on the last page.
Was this page helpful?