List Emails
Retrieve emails from your organization's inbox
GET
/email/inboxRequires
Bearer authenticationRetrieve emails for your organization. Supports filtering by view (inbox, sent, all) and fetching specific threads.
Query Parameters
viewstringFilter emails by direction. Options: inbox, sent, all. Defaults to inbox.
threadIdstringFetch all messages in a specific thread. When provided, marks the thread as read.
pageintegerPage number for pagination. Defaults to 1.
limitintegerNumber of items per page. Defaults to 50.
GET
/email/inboxcurl -X GET "https://api.vastal.agency/v1/email/inbox?view=inbox&limit=50" \ -H "Authorization: Bearer YOUR_API_KEY"
const response = await fetch( 'https://api.vastal.agency/v1/email/inbox?view=inbox', { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } } ); const data = await response.json();
import requests response = requests.get( 'https://api.vastal.agency/v1/email/inbox', params={'view': 'inbox', 'limit': 50}, headers={'Authorization': 'Bearer YOUR_API_KEY'} ) data = response.json()
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 } }