Resend a message
/api/v1/email-logs/{event}/resendSubmits the stored copy of this message again. Requires messages:send, not
events:read — it puts mail back on the wire.
Pass to to send it somewhere else. That is the usual reason to resend: the customer
gave the wrong address, and reconstructing the message by hand to send it to the right
one loses whatever the original actually said.
A redirected resend is not a privileged path — the new recipient is checked against your suppression list and counted against your rate limit exactly like a fresh send.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
eventrequired | path | string | The event identifier. |
Request body
toanySend to this address instead of the original recipient. Omit to resend to whoever it went to the first time.
Request
/api/v1/email-logs/{event}/resendcurl -X POST 'https://app.mailyte.com/api/v1/email-logs/01JBT8XQ2M9WYC3K4F6R7S8T9V/resend' \
-H 'Authorization: Bearer mk_live_YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"to": "corrected@example.com"
}'const response = await fetch('https://app.mailyte.com/api/v1/email-logs/01JBT8XQ2M9WYC3K4F6R7S8T9V/resend', {
method: 'POST',
headers: {
Authorization: 'Bearer mk_live_YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"to": "corrected@example.com"
}),
});
const { data } = await response.json();import requests
response = requests.post(
"https://app.mailyte.com/api/v1/email-logs/01JBT8XQ2M9WYC3K4F6R7S8T9V/resend",
headers={"Authorization": "Bearer mk_live_YOUR_API_KEY"},
json={
"to": "corrected@example.com"
},
)
data = response.json()["data"]<?php
$response = Http::withToken('mk_live_YOUR_API_KEY')
->post('https://app.mailyte.com/api/v1/email-logs/01JBT8XQ2M9WYC3K4F6R7S8T9V/resend', [
'to' => 'corrected@example.com',
]);
$data = $response->json('data');require "net/http"
require "json"
uri = URI("https://app.mailyte.com/api/v1/email-logs/01JBT8XQ2M9WYC3K4F6R7S8T9V/resend")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer mk_live_YOUR_API_KEY"
request["Content-Type"] = "application/json"
request.body = {
"to": "corrected@example.com"
}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }Response
Success.
dataobjectobjectstringmessageidstringMailyte's ID for this message: a ULID such as
01JBT8XQ2M9WYC3K4F6R7S8T9V, without angle brackets. Look it up right away withGET /email-logs/messages/{id}. It is not the Message-ID header.message_idstringThe Message-ID header as sent, angle brackets included, such as
<01JBT8XQ2M…@example.com>. Use it, percent-encoded, withGET /domains/{domain}/messages/{messageId}. It is not the same asid.recipientstringThe first recipient's address, without a display name. Read
recipientsfor everyone the message was sent to.recipientsobjectEveryone the message was addressed to. Bcc recipients are never listed here; they appear only in your delivery log.
toarray<string>As accepted, including any display name.
ccarray<string>Empty when there were no cc recipients.
countintegerTo plus Cc. Excludes Bcc, which is not published here; the limit of 50 counts all three together.
reply_tostringThe Reply-To address sent. Null when none was set; replies then go to
from.attachment_countintegerHow many files were attached.
fromobjectThe sender. An object here, and everywhere else a sender appears, so one piece of caller code reads all of them.
emailstringThe address the message was sent from.
namestringThe display name in the
From:header. Null when the sender has no display name, so the message went out as a bare address.
subjectstringThe subject as sent, with
{{ }}variables filled in. An empty subject is"", never null.submitted_atstringWhen we accepted the message. This is not delivery: a 200 means queued, and the outcome arrives as a delivery event or a webhook.
modestringlive | testlivefor a real send.testwhen the request used a test API key (mk_test_…): the message was checked and built like a real one, then stored in your Sandbox instead of being delivered. Read it withGET /sandbox/messages/{id}. Test sends skip suppression and rate limits, and fire no live webhooks.sandboxobjectWhere a test send was stored. Null for a live send.
message_idstringThe sandbox message id, for
GET /sandbox/messages/{id}. Not the same asid: that is the Message-ID local part the message carries, this is the sandbox's own record of it.inbox_idstringThe inbox it landed in: your default sandbox inbox, created for you on the first test send if you had none.
Returned inside the standard envelope.
Errors
| Status | When |
|---|---|
401 | The API key is missing, unknown, revoked or expired. All four answer identically, on purpose: distinguishing them would confirm which keys exist. |
403 | The key is valid but may not do this: it lacks the required scope, its IP allowlist does not include you, or this endpoint does not accept API keys. |
404 | No such resource in this organization. |
422 | The request was understood but the values were not acceptable. |
429 | Too many requests, or the organization has spent its sending allowance. `Retry-After` says how long to wait. |
Every status, with what causes it and what to do, is on the error reference.