API v1
v1
View as Markdown

Get an email sent

GET /api/v1/emails-sent/{emailSent}

Retrieve one email we sent, including the copy that left.

Everything a row in the list carries, and one field more: `body`, the text of the email as it was sent. That is what tells you what we actually said, rather than only that we said something.

The `delivery_status` is one of three words. `delivered` means it arrived, `bounced` means it came back, and `sent` means it left and nothing has come back yet. When a provider reports a delivery and a bounce for the same email, which it can do out of order, the email reads as `bounced`.

This endpoint also answers QUERY, with the same parameters sent in the request body. How QUERY works.

Path parameters

Sent as JSON. Anything not listed here is ignored.

emailSent integer Required

The id of the email.

Returns

One email we sent. An email belonging to another account answers 404, and so does an id that matches nothing, deliberately: the two cannot be told apart.

data object

The email.

data.type string

Always email_sent. It names the kind of record, so a caller holding several kinds can tell them apart without looking at where they came from.

data.id string

The id of this record, as a string even when it reads as a number. It is what every endpoint naming this record takes.

data.attributes object

Everything the record holds.

data.attributes.email_type string

Which of our emails this was, as a key such as new_login or magic_link_created, up to 255 characters. The keys come from a set the product keeps and adds to as it sends new kinds of mail, so match the ones you care about and let an unfamiliar one through rather than treating it as an error.

data.attributes.subject string

The subject line as it was sent, of no fixed length, or null for a record written before we kept them.

data.attributes.email_address string

The address it went to, up to 255 characters. It need not belong to anybody with an account: what matters is that it left on behalf of yours.

data.attributes.body string

The copy that was sent, or null for a record written before we kept it. It is carried only when one email is read, never on a list row, so that asking for a page never turns into a download. Links and web addresses are removed from the copy before it is kept, so a sign-in link can never be read back.

data.attributes.delivery_status string

Where the email got to: one of complained, bounced, delivered or sent. It is the one word you want out of the four moments below, worked out the same way the account screen works it out, and read in that order, so a complaint outranks a bounce and either outranks a delivery when a provider reports them out of order.

data.attributes.sent_at timestamp

When it left us, as a count of seconds since 1970, or null for a record written before we kept it. This is the moment the list is ordered by.

data.attributes.delivered_at timestamp

When the provider told us it arrived, as a count of seconds, or null when nobody has told us. Null means we have not heard, not that it failed.

data.attributes.bounced_at timestamp

When it came back, as a count of seconds, or null when it has not. An email with a moment here reached nobody, whether the receiving server refused it or our provider never managed to send it at all.

data.attributes.complained_at timestamp

When the recipient marked it as spam, as a count of seconds, or null when they have not. It is a separate fact from a bounce: the address works, the person did not want the email.

data.attributes.created_at timestamp

When the record was written, as a count of seconds. Usually the same second it was sent, and not the same field.

data.links object

Where to find this record.

data.links.self string

The absolute address this record is read from.

Rate limit

Sixty requests per minute, per user, shared by every key and device. Every answer carries the budget left in X-RateLimit-Remaining.

GET
curl https://my.monicahq.com/api/v1/emails-sent/42 \
-H "Authorization: Bearer $MONICA_TOKEN"
const response = await fetch('https://my.monicahq.com/api/v1/emails-sent/42', {
headers: { Authorization: `Bearer ${token}` },
})
const data = await response.json()
$response = Http::withToken($token)->get('https://my.monicahq.com/api/v1/emails-sent/42');
Response 200
{
"data": {
"type": "email_sent",
"id": "42",
"attributes": {
"email_type": "new_login",
"subject": "A sign-in from a new place",
"email_address": "[email protected]",
"body": "Somebody just signed in to your account from a device we have not seen before.",
"delivery_status": "delivered",
"sent_at": 1756339200,
"delivered_at": 1756339260,
"bounced_at": null,
"complained_at": null,
"created_at": 1756339200
},
"links": {
"self": "https://my.monicahq.com/api/v1/emails-sent/42"
}
}
}

Keys act as you, with exactly the access you have. Make one per integration so you can revoke it alone.