import { createClient } from "@mailsai/sdk";
const client = createClient(); // reads MAILS_API_KEY
const result = await client.connected_apps.list({
limit: 10,
});
console.log(result);from mailsai import create_client
client = create_client() # reads MAILS_API_KEY
result = client.list_connected_apps(limit=10)
print(result)curl 'https://api.mails.ai/v1/oauth/grants?limit=10' \
-H "Authorization: Bearer $MAILS_API_KEY"mails connected-apps list{
"name": "mails_connected_apps_list",
"arguments": { "limit": 10 }
}{
"data": [
{
"id": "oag_01JZX8K3M9Q4P7VN2YB6RTDC0E",
"client_id": "<client_id>",
"client_name": "<client_name>",
"first_party": false,
"scope": "<scope>",
"scopes": ["send"],
"created_at": "2026-10-04T12:00:00.000Z",
"approved_at": "2026-10-04T12:00:00.000Z",
"last_used_at": "2026-10-04T12:00:00.000Z",
"created_api_keys": 0,
"created_webhooks": 0,
"signing_secrets_known": 0
}
],
"has_more": false,
"next_cursor": "<next_cursor>"
}200 A page of connected apps.
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 connected apps
import { createClient } from "@mailsai/sdk";
const client = createClient(); // reads MAILS_API_KEY
const result = await client.connected_apps.list({
limit: 10,
});
console.log(result);from mailsai import create_client
client = create_client() # reads MAILS_API_KEY
result = client.list_connected_apps(limit=10)
print(result)curl 'https://api.mails.ai/v1/oauth/grants?limit=10' \
-H "Authorization: Bearer $MAILS_API_KEY"mails connected-apps list{
"name": "mails_connected_apps_list",
"arguments": { "limit": 10 }
}{
"data": [
{
"id": "oag_01JZX8K3M9Q4P7VN2YB6RTDC0E",
"client_id": "<client_id>",
"client_name": "<client_name>",
"first_party": false,
"scope": "<scope>",
"scopes": ["send"],
"created_at": "2026-10-04T12:00:00.000Z",
"approved_at": "2026-10-04T12:00:00.000Z",
"last_used_at": "2026-10-04T12:00:00.000Z",
"created_api_keys": 0,
"created_webhooks": 0,
"signing_secrets_known": 0
}
],
"has_more": false,
"next_cursor": "<next_cursor>"
}200 A page of connected apps.
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
Page size (1–100).
Opaque cursor from a previous page's next_cursor.
Only those that can still act are listed, newest first: one revoked, or whose tokens have all expired or been signed out, is not. Settings › Connected apps in the dashboard shows the same apps to everyone in the workspace. There, a member can revoke the apps they connected, and an owner or admin can revoke any of them. Closed to apps connected by sign-in (403 connected_app_not_allowed), and to a key tied to one agent (403): use an API key with manage that is not tied to an agent, or the mails CLI.
Response
The items on this page, at most limit of them.
True when more items follow this page: pass next_cursor as cursor to get them.
Pass as cursor to fetch the next page. Absent on the last page.
Was this page helpful?