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, purpose, and session association.

Request Body

NameTypeRequiredDescription
ttlSecondsintegerOptionalTime-to-live in seconds. After this period, the inbox expires.(default: 3600)
purposestringOptionalHuman-readable purpose for tracking this inbox.
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,
"purpose": "signup",
"sessionId": "00000000-0000-4000-8000-000000000004"
}'

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"
}
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)
cursorstringOptionalPagination cursor from the previous response.
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
{
"object": "list",
"data": [
{
"id": "inb_123",
"emailAddress": "k3v9x2m4q7tz@agentinbox.in",
"status": "active",
"expiresAt": "2024-06-12T11:30:00Z"
}
],
"nextCursor": null,
"hasMore": false
}
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"
}
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
}

Related Documentation