For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
contact@agentmail.ccDiscord
DocumentationAPI ReferenceKnowledge BaseChangelog
DocumentationAPI ReferenceKnowledge BaseChangelog
  • API Reference
      • GETList Pods
      • GETGet Pod
      • POSTCreate Pod
      • DELDelete Pod
        • GETList API Keys
        • POSTCreate API Key
        • DELDelete API Key
LogoLogo
contact@agentmail.ccDiscord
API ReferencePodsAPI Keys

Create API Key

POST
/v0/pods/:pod_id/api-keys
POST
/v0/pods/:pod_id/api-keys
1from agentmail import AgentMail
2
3client = AgentMail(
4 api_key="YOUR_TOKEN_HERE",
5)
6
7client.pods.api_keys.create(
8 pod_id="pod_id",
9)
1{
2 "api_key_id": "api_key_id",
3 "api_key": "api_key",
4 "prefix": "prefix",
5 "name": "name",
6 "created_at": "2024-01-15T09:30:00Z",
7 "pod_id": "pod_id",
8 "inbox_id": "inbox_id",
9 "permissions": {
10 "inbox_read": true,
11 "inbox_create": true,
12 "inbox_update": true,
13 "inbox_delete": true,
14 "thread_read": true,
15 "thread_delete": true,
16 "message_read": true,
17 "message_send": true,
18 "message_update": true,
19 "label_spam_read": true,
20 "label_blocked_read": true,
21 "label_trash_read": true,
22 "draft_read": true,
23 "draft_create": true,
24 "draft_update": true,
25 "draft_delete": true,
26 "draft_send": true,
27 "webhook_read": true,
28 "webhook_create": true,
29 "webhook_update": true,
30 "webhook_delete": true,
31 "domain_read": true,
32 "domain_create": true,
33 "domain_update": true,
34 "domain_delete": true,
35 "list_entry_read": true,
36 "list_entry_create": true,
37 "list_entry_delete": true,
38 "metrics_read": true,
39 "api_key_read": true,
40 "api_key_create": true,
41 "api_key_delete": true,
42 "pod_read": true,
43 "pod_create": true,
44 "pod_delete": true
45 }
46}
**CLI:** ```bash agentmail pods:api-keys create --pod-id <pod_id> --name "My Key" ```
Was this page helpful?
Previous

Delete API Key

Next
Built with

CLI:

$agentmail pods:api-keys create --pod-id <pod_id> --name "My Key"

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

pod_idstringRequired
ID of pod.

Request

This endpoint expects an object.
namestringOptional
Name of api key.
permissionsobjectOptional
Granular permissions for the API key. When ommitted all permissions are granted. Otherwise, only permissions set to true are granted.

Response

This endpoint returns an object.
api_key_idstring
ID of api key.
api_keystring
API key.
prefixstring
Prefix of api key.
namestring
Name of api key.
created_atdatetime
Time at which api key was created.
pod_idstring
Pod ID the api key is scoped to.
inbox_idstring
Inbox ID the api key is scoped to.
permissionsobject
Granular permissions for the API key. When ommitted all permissions are granted. Otherwise, only permissions set to true are granted.

Errors

400
Validation Error
404
Not Found Error