API Reference: Inboxes

Complete reference for the Inboxes API including endpoints, request/response schemas, and examples.

Authentication

All inbox endpoints require a valid API key passed in the Authorization header as Bearer <token>.
POST/api/v1/inboxes

Create a new temporary email inbox with optional TTL, metadata, and session association.

Request Body

NameTypeRequiredDescription
ttlSecondsintegerOptionalTime-to-live in seconds. After this period, the inbox expires.(default: 3600)
metadataobjectOptionalUser-defined key-value pairs for tracking or tagging.
sessionIdstringOptionalAssociate this inbox with an existing session.
bash
curl -X POST https://agentinbox.in/api/v1/inboxes \
-H "Authorization: Bearer $AgentInbox_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"ttlSeconds": 3600,
"metadata": { "workflow": "signup" },
"sessionId": "sess_abc"
}'

Responses

HTTP 201
{
"id": "inb_123",
"emailAddress": "k3v9x2m4q7tz@agentinbox.in",
"status": "active",
"ttlSeconds": 3600,
"expiresAt": "2024-06-12T11:30:00Z",
"createdAt": "2024-06-12T10:30:00Z",
"metadata": { "workflow": "signup" },
"sessionId": "sess_abc"
}
GET/api/v1/inboxes

List all inboxes with pagination support. Filter by status or retrieve all.

Query Parameters

NameTypeRequiredDescription
limitintegerOptionalNumber of results per page.(default: 20)
offsetintegerOptionalNumber of results to skip.(default: 0)
statusstringOptionalFilter by inbox status. One of active or expired.
bash
curl -s https://agentinbox.in/api/v1/inboxes \
-H "Authorization: Bearer $AgentInbox_API_KEY"

Responses

HTTP 200
{
"data": [
{
"id": "inb_123",
"emailAddress": "k3v9x2m4q7tz@agentinbox.in",
"status": "active",
"expiresAt": "2024-06-12T11:30:00Z"
}
],
"pagination": {
"limit": 20,
"offset": 0,
"total": 42
}
}
GET/api/v1/inboxes/{id}

Retrieve a specific inbox by its unique ID.

Path Parameters

NameTypeRequiredDescription
idstringRequiredThe unique inbox ID (e.g., inb_123).
bash
curl -s https://agentinbox.in/api/v1/inboxes/inb_123 \
-H "Authorization: Bearer $AgentInbox_API_KEY"

Responses

HTTP 200
{
"id": "inb_123",
"emailAddress": "k3v9x2m4q7tz@agentinbox.in",
"status": "active",
"ttlSeconds": 3600,
"expiresAt": "2024-06-12T11:30:00Z",
"createdAt": "2024-06-12T10:30:00Z",
"metadata": {},
"sessionId": null
}
DELETE/api/v1/inboxes/{id}

Delete an inbox immediately. This action is irreversible.

Path Parameters

NameTypeRequiredDescription
idstringRequiredThe unique inbox ID to delete.
bash
curl -X DELETE https://agentinbox.in/api/v1/inboxes/inb_123 \
-H "Authorization: Bearer $AgentInbox_API_KEY"

Responses

HTTP 204
// No body

Schema: Inbox

The Inbox object represents a temporary email address.

Inbox Object
{
"id": string, // Unique inbox ID (e.g., "inb_123")
"emailAddress": string, // Full email address
"status": "active" | "expired",
"ttlSeconds": number, // TTL in seconds
"expiresAt": string, // ISO 8601 timestamp
"createdAt": string, // ISO 8601 timestamp
"metadata": object, // User-defined key-value pairs
"sessionId": string | null
}

Related Documentation