Agnic
API Reference

Agent Email

Dedicated email addresses for AI agents — send, receive, and manage email programmatically.

Every agent gets a unique address agent-{id}@agent.agnic.ai. Use these endpoints to manage the alias, check the inbox, send emails, and reply to messages.

GET/api/agent/email

Get Agent Email Alias

Returns the agent's dedicated email address and alias metadata. If no alias has been created yet, returns `{ "hasEmail": false }`.
Auth:ApiTokenOAuth2

Responses

200Email alias info
FieldTypeDescription
hasEmailboolean
Whether an email alias exists for this agent
emailAddressstring<email>
The agent's dedicated email address (agent-{id}@agent.agnic.ai)
displayNamestring
Display name used in the From header for outgoing emails
walletAddressstring
The agent's on-chain wallet address
agentIdinteger
The agent's numeric ID
isActiveboolean
createdAtstring<date-time>
401Unauthorized - invalid or missing authentication
FieldTypeDescription
errorstring
error_descriptionstring
messagestring
500Internal server error
object — circular

Example (cURL)

curl -X GET 'https://api.agnic.ai/api/agent/email' \
  -H 'X-Agnic-Token: YOUR_TOKEN'
POST/api/agent/email

Create Agent Email Alias

Creates a dedicated email alias for the agent (`agent-{id}@agent.agnic.ai`). Idempotent — returns the existing alias if one already exists. Requires the agent to be onboarded (status `active`).
Auth:ApiTokenOAuth2

Request body

FieldTypeDescription
displayNamestring
Display name shown in outgoing email From header (optional)
Example request
{
  "displayName": "My Research Agent"
}

Responses

200Email alias created or returned
FieldTypeDescription
hasEmailboolean
Whether an email alias exists for this agent
emailAddressstring<email>
The agent's dedicated email address (agent-{id}@agent.agnic.ai)
displayNamestring
Display name used in the From header for outgoing emails
walletAddressstring
The agent's on-chain wallet address
agentIdinteger
The agent's numeric ID
isActiveboolean
createdAtstring<date-time>
400No active agent found
FieldTypeDescription
errorstring
error_descriptionstring
messagestring
401Unauthorized - invalid or missing authentication
object — circular
500Internal server error
object — circular

Example (cURL)

curl -X POST 'https://api.agnic.ai/api/agent/email' \
  -H 'X-Agnic-Token: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"displayName":"My Research Agent"}'
GET/api/agent/email/inbox

Get Email Inbox

Returns the agent's inbox — both inbound messages received and outbound messages sent. Messages are retained for 30 days.
Auth:ApiTokenOAuth2

query parameters

NameTypeDescription
limitinteger
default: 20
Max messages to return
offsetinteger
default: 0
Pagination offset

Responses

200Inbox messages
FieldTypeDescription
emailAddressstring<email>
messagesobject[]
show nested schema
array of
FieldTypeDescription
idstring
Unique message ID (use this for reply)
example: "aem_1775222237594_v4gwcj"
direction"inbound" | "outbound"
fromstring<email>
tostring<email>
subjectstring
bodyTextstring
bodyHtmlstring
isReadboolean
threadIdstring
createdAtstring<date-time>
limitinteger
offsetinteger
401Unauthorized - invalid or missing authentication
FieldTypeDescription
errorstring
error_descriptionstring
messagestring
404No email alias found
object — circular
500Internal server error
object — circular

Example (cURL)

curl -X GET 'https://api.agnic.ai/api/agent/email/inbox' \
  -H 'X-Agnic-Token: YOUR_TOKEN'
POST/api/agent/email/send

Send Email

Sends an email from the agent's dedicated address (`agent-{id}@agent.agnic.ai`). The outbound message is stored in the agent's inbox for reference.
Auth:ApiTokenOAuth2

Request body *

FieldTypeDescription
to*string<email>
Recipient email address
subject*string
Email subject line
body*string
Email body (plain text)
Example request
{
  "to": "[email protected]",
  "subject": "Research Results",
  "body": "Here are the findings from my analysis..."
}

Responses

200Email sent
FieldTypeDescription
sentboolean
messageIdstring
Resend message ID
fromstring<email>
tostring<email>
subjectstring
400Missing required fields
FieldTypeDescription
errorstring
error_descriptionstring
messagestring
401Unauthorized - invalid or missing authentication
object — circular
404No email alias found
object — circular
500Internal server error
object — circular
502Email provider error
object — circular
503Email sending not configured
object — circular

Example (cURL)

curl -X POST 'https://api.agnic.ai/api/agent/email/send' \
  -H 'X-Agnic-Token: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"to":"[email protected]","subject":"Research Results","body":"Here are the findings from my analysis..."}'
POST/api/agent/email/reply

Reply to Email

Replies to a message in the agent's inbox. Automatically sets `In-Reply-To` and `References` headers to maintain email thread continuity. Also marks the original message as read.
Auth:ApiTokenOAuth2

Request body *

FieldTypeDescription
messageId*string
ID of the inbox message to reply to (from GET /api/agent/email/inbox)
example: "aem_1775222237594_v4gwcj"
body*string
Reply body (plain text)
Example request
{
  "messageId": "aem_1775222237594_v4gwcj",
  "body": "Thank you, confirmed!"
}

Responses

200Reply sent
FieldTypeDescription
sentboolean
messageIdstring
Resend message ID
fromstring<email>
tostring<email>
subjectstring
400Missing required fields
FieldTypeDescription
errorstring
error_descriptionstring
messagestring
401Unauthorized - invalid or missing authentication
object — circular
404No email alias or original message not found
object — circular
500Internal server error
object — circular
502Email provider error
object — circular
503Email sending not configured
object — circular

Example (cURL)

curl -X POST 'https://api.agnic.ai/api/agent/email/reply' \
  -H 'X-Agnic-Token: YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"messageId":"aem_1775222237594_v4gwcj","body":"Thank you, confirmed!"}'