import { createClient } from "@mailsai/sdk";
const client = createClient(); // reads MAILS_API_KEY
const result = await client.me();
console.log(result);from mailsai import create_client
client = create_client() # reads MAILS_API_KEY
result = client.me()
print(result)curl 'https://api.mails.ai/v1/me' \
-H "Authorization: Bearer $MAILS_API_KEY"{ "name": "mails_me", "arguments": {} }{
"api_key": {
"id": "key_01JZXD7R9T1V3X5Z7B9D1F3H5K",
"prefix": "mk_live_a1b2",
"name": "Production server",
"mode": "live",
"scopes": ["send", "read"],
"agent_id": null,
"last_used_at": "2026-06-24T17:30:00.000Z",
"created_at": "2026-06-01T09:12:44.000Z"
},
"workspace": {
"id": "wsk_01JZ8A1B2C3D4E5F6G7H8J9K0M",
"slug": "acme",
"display_name": "Acme, Inc.",
"tier": "pro",
"tier_status": "active"
},
"agent": null
}200 The current key, workspace, and agent.
401 Missing or invalid API key.
500 Internal server error.Identify the current key
Returns the authenticating API key, its workspace, and its bound agent (if any).
GET/v1/me
import { createClient } from "@mailsai/sdk";
const client = createClient(); // reads MAILS_API_KEY
const result = await client.me();
console.log(result);from mailsai import create_client
client = create_client() # reads MAILS_API_KEY
result = client.me()
print(result)curl 'https://api.mails.ai/v1/me' \
-H "Authorization: Bearer $MAILS_API_KEY"{ "name": "mails_me", "arguments": {} }{
"api_key": {
"id": "key_01JZXD7R9T1V3X5Z7B9D1F3H5K",
"prefix": "mk_live_a1b2",
"name": "Production server",
"mode": "live",
"scopes": ["send", "read"],
"agent_id": null,
"last_used_at": "2026-06-24T17:30:00.000Z",
"created_at": "2026-06-01T09:12:44.000Z"
},
"workspace": {
"id": "wsk_01JZ8A1B2C3D4E5F6G7H8J9K0M",
"slug": "acme",
"display_name": "Acme, Inc.",
"tier": "pro",
"tier_status": "active"
},
"agent": null
}200 The current key, workspace, and agent.
401 Missing or invalid API key.
500 Internal server error.Any valid key works — no scope required.
Response
api_keyobject
The credential that made this request: an API key, or an access token from a connected app such as the mails CLI.
workspaceobject | null
The workspace the credential belongs to. Null only if it can no longer be found.
agentobject | null
The agent the key is tied to. Null for a key that may act for every agent, and for an access token.
Was this page helpful?