Skip to content

Messages & Storage API

The Messages API provides access to metadata for all messages that pass through your Vectis server — both inbound and outbound. Message metadata is stored automatically when mail is sent via the Sending API or received by Postfix.

All endpoints require authentication. domain_admin users must specify a domain_id and can only access domains assigned to them.

GET /api/v1/messages

Returns a paginated, filterable list of message metadata.

Query parameters:

ParameterTypeRequiredDescription
domain_idstring (UUID)Yes (for domain_admin)Filter by domain.
directionstringNoinbound or outbound.
statusstringNoMessage status (see table below).
searchstringNoFull-text search on subject and sender.
senderstringNoFilter by sender email address.
cursorstringNoPagination cursor.
limitintegerNoItems per page (default 50, max 200).

Status values:

StatusDescription
sentOutbound message accepted by Postfix.
deliveredInbound message delivered to local mailbox.
spamInbound message flagged as spam by Rspamd.
bouncedMessage bounced.
failedMessage delivery failed.

Example — list recent outbound messages:

Terminal window
curl "https://mail.example.com/api/v1/messages?domain_id=0192abc0-...&direction=outbound&limit=20" \
-H "Authorization: Bearer vectis_sk_abc123..."

Example — search by subject:

Terminal window
curl "https://mail.example.com/api/v1/messages?domain_id=0192abc0-...&search=invoice" \
-H "Authorization: Bearer vectis_sk_abc123..."

Response:

{
"data": [
{
"id": "0192abc0-def1-7000-8000-000000000040",
"domain_id": "0192abc0-def1-7000-8000-000000000001",
"message_id": "<20260404120000.abc123@example.com>",
"direction": "outbound",
"sender": "alice@example.com",
"recipients": ["bob@recipient.com"],
"subject": "Invoice #2026-04-001",
"status": "sent",
"size_bytes": 12540,
"spam_score": null,
"spam_action": null,
"queue_id": null,
"created_at": "2026-04-04T12:00:00Z"
},
{
"id": "0192abc0-def1-7000-8000-000000000041",
"domain_id": "0192abc0-def1-7000-8000-000000000001",
"message_id": "<20260404120500.xyz789@sender.com>",
"direction": "inbound",
"sender": "external@sender.com",
"recipients": ["alice@example.com"],
"subject": "Re: Invoice #2026-04-001",
"status": "delivered",
"size_bytes": 4521,
"spam_score": 1.2,
"spam_action": "no action",
"queue_id": "ABC123DEF",
"created_at": "2026-04-04T12:05:00Z"
}
],
"meta": {
"request_id": "...",
"timestamp": "...",
"pagination": {
"next_cursor": "MjAyNi0wNC0wNFQxMjowNTowMFo=",
"has_more": true
}
}
}
GET /api/v1/messages/{id}

Returns full metadata for a single message.

Terminal window
curl https://mail.example.com/api/v1/messages/0192abc0-def1-7000-8000-000000000040 \
-H "Authorization: Bearer vectis_sk_abc123..."

Response:

{
"data": {
"id": "0192abc0-def1-7000-8000-000000000040",
"domain_id": "0192abc0-def1-7000-8000-000000000001",
"message_id": "<20260404120000.abc123@example.com>",
"direction": "outbound",
"sender": "alice@example.com",
"recipients": ["bob@recipient.com"],
"subject": "Invoice #2026-04-001",
"status": "sent",
"size_bytes": 12540,
"spam_score": null,
"spam_action": null,
"queue_id": null,
"created_at": "2026-04-04T12:00:00Z"
},
"meta": { "request_id": "...", "timestamp": "..." }
}

Errors:

CodeStatusDescription
NOT_FOUND404Message does not exist.
FORBIDDEN403No access to the message’s domain.
DOMAIN_REQUIRED400domain_admin users must specify domain_id.

The search parameter performs full-text search across the subject and sender fields. It supports partial matching and is case-insensitive.

Terminal window
# Find messages about invoices
curl "https://mail.example.com/api/v1/messages?search=invoice" \
-H "Authorization: Bearer vectis_sk_abc123..."
# Find messages from a specific sender
curl "https://mail.example.com/api/v1/messages?sender=alice@example.com" \
-H "Authorization: Bearer vectis_sk_abc123..."
# Combine filters
curl "https://mail.example.com/api/v1/messages?domain_id=0192abc0-...&direction=inbound&status=spam&limit=10" \
-H "Authorization: Bearer vectis_sk_abc123..."
FieldTypeDescription
idstring (UUID)Vectis internal ID.
domain_idstring (UUID)Domain the message belongs to.
message_idstringRFC 5322 Message-ID header value.
directionstringinbound or outbound.
senderstringSender email address.
recipientsarray of stringsRecipient email addresses.
subjectstringEmail subject line.
statusstringCurrent message status.
size_bytesintegerMessage size in bytes (inbound only).
spam_scorenumber/nullRspamd spam score (inbound only).
spam_actionstring/nullRspamd action taken (inbound only).
queue_idstring/nullPostfix queue ID (inbound only).
created_atstringISO 8601 timestamp when the message was recorded.
  • Outbound: Metadata is stored when a message is submitted via POST /send or POST /send/batch.
  • Inbound: Metadata is stored when Postfix delivers a message to Dovecot and sends a notification to the Vectis API.

The Messages API stores metadata only, not message body content. The actual email content lives in the Dovecot Maildir storage. For full inbound message content, use the mail.received.full webhook.