Message status lookup¶
Two endpoints let you look a message up by the id returned on send. They follow the Postal API contract, but are not complete yet.
Partial implementation
messages/messagereturnsnullfor bodies, attachments, inspection and activity history.messages/deliveriesreturns only the last delivery attempt, not the history.- There is no list or search endpoint. You can only look up a message whose
idyou already have.
To follow deliveries in production, use webhooks and store the events on your side. Use these endpoints for spot checks.
Authentication and the response envelope are the same as in the Sending API.
Look up a message¶
POST /api/v1/messages/message
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | The id returned in data.messages on send. |
_expansions | true or array of strings | no | Which blocks to include. true includes all. |
Only messages of the server that owns the key are found. Without _expansions, the response carries only id and token.
Expansions¶
| Expansion | State | Content |
|---|---|---|
status | available | The message's current state. |
details | available | Envelope, subject, size, tag. |
headers | available | Headers, with lower-case names and values in arrays. |
raw_message | available | The complete message, base64 encoded. |
plain_body, html_body | always null | Not implemented yet. |
attachments | always null | Not implemented yet. |
inspection | always null | Not implemented yet. |
activity_entries | always null | Not implemented yet. |
headers and raw_message may be null if the message's stored content cannot be read.
Example¶
curl -sS https://api.frontengine.net/api/v1/messages/message \
-H "X-Server-API-Key: $FRONTENGINE_KEY" \
-H "Content-Type: application/json" \
-d '{"id": 1042, "_expansions": ["status", "details"]}'
{
"status": "success",
"time": 0.006,
"flags": {},
"data": {
"id": 1042,
"token": "Zp3kQ9xT",
"status": {
"status": "Sent",
"last_delivery_attempt": 1764331205.412,
"held": false,
"hold_expiry": null
},
"details": {
"rcpt_to": "[email protected]",
"mail_from": "[email protected]",
"subject": "Order 1234 confirmed",
"message_id": "[email protected]",
"timestamp": 1764331203.118,
"direction": "outgoing",
"size": 1834,
"bounce": false,
"bounce_for_id": 0,
"tag": "order-confirmed",
"received_with_ssl": true
}
}
}
Times are seconds since the Unix epoch, with a fraction.
Values of status.status¶
| Value | Meaning |
|---|---|
Pending | Queued, no outcome yet. |
Sent | Accepted by the destination server. |
SoftFail | Temporary failure. It will be retried. |
HardFail | Permanent failure, or retries exhausted. |
Held | Held. It will not be delivered while held. |
Bounced | Accepted by the destination and later returned by a bounce received as email. |
Fields with a fixed value¶
These fields exist for Postal compatibility and carry no information today: direction is always outgoing, bounce is always false, bounce_for_id is always 0, received_with_ssl is always true and hold_expiry is always null.
Look up a message's deliveries¶
POST /api/v1/messages/deliveries
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | The message's id. |
curl -sS https://api.frontengine.net/api/v1/messages/deliveries \
-H "X-Server-API-Key: $FRONTENGINE_KEY" \
-H "Content-Type: application/json" \
-d '{"id": 1042}'
{
"status": "success",
"time": 0.004,
"flags": {},
"data": [
{
"id": 1042,
"status": "SoftFail",
"details": "451 4.7.1 Try again later",
"output": "451 4.7.1 Try again later",
"sent_with_ssl": true,
"log_id": null,
"time": null,
"timestamp": 1764331205.412
}
]
}
What to expect in data:
- Empty array: the message has had no delivery attempt yet.
- One entry with the last attempt. Earlier attempts do not appear.
- One additional entry with
statusset toBouncedwhen a bounce arrived by email after delivery.
Field limitations:
detailsandoutputcarry the same text: the last recorded error. On a successful delivery they may be empty.log_idandtimeare alwaysnull.idis the message'sid, not an identifier of the attempt.
Errors¶
| Response | Cause |
|---|---|
status: "parameter-error" | The id parameter was not given. |
status: "error", code: "MessageNotFound" | No message with that id exists on this server, or the id is not numeric. |
The other errors are those of the Sending API.