List Emails

Retrieve emails from your organization's inbox

GET/email/inbox
Requires Bearer authentication

Retrieve emails for your organization. Supports filtering by view (inbox, sent, all) and fetching specific threads.

Query Parameters

viewstring

Filter emails by direction. Options: inbox, sent, all. Defaults to inbox.

threadIdstring

Fetch all messages in a specific thread. When provided, marks the thread as read.

pageinteger

Page number for pagination. Defaults to 1.

limitinteger

Number of items per page. Defaults to 50.

GET/email/inbox
curl -X GET "https://api.vastal.agency/v1/email/inbox?view=inbox&limit=50" \
-H "Authorization: Bearer YOUR_API_KEY"
200Success
{
"messages": [
  {
    "id": "msg_abc123",
    "thread_id": "thr_xyz789",
    "direction": "inbound",
    "status": "received",
    "from_address": "client@example.com",
    "from_name": "John Smith",
    "to_addresses": ["hello@yourbusiness.com"],
    "subject": "Question about services",
    "body_text": "Hi, I have a question...",
    "body_html": "<p>Hi, I have a question...</p>",
    "created_at": "2024-01-20T10:30:00Z"
  }
],
"pagination": {
  "page": 1,
  "limit": 50,
  "total": 127,
  "totalPages": 3
}
}