Add a sending identity
/api/v1/sendersA sender is an identity you are allowed to send as — a name and address, like
Ada from Acme <ada@acme.com>.
This is not the same as a mailbox, and not the same as an SMTP credential. A mailbox
receives; a credential authenticates; a sender is what appears in the From: header.
POST /messages refuses a from address that is not a verified sender here.
Request body
domain_idstringrequiredThe ID of one of your domains. Copy it from the domain's page in the dashboard, or read it from
GET /domains.namestringrequiredThe name recipients see next to the address, as in
Ada from Acme <ada@yourdomain.com>.emailstringrequiredThe From address, on the domain
domain_id.email_account_idstringOptional. The mailbox this address belongs to, when it is one of your Mailyte mailboxes. Copy its ID from the mailbox's page, or read it from
GET /email-accounts.
Request
/api/v1/senderscurl -X POST 'https://app.mailyte.com/api/v1/senders' \
-H 'Authorization: Bearer mk_live_YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"domain_id": "01JBT8XQ2M9WYC3K4F6R7S8T9V",
"name": "Ada from Acme",
"email": "ada@yourdomain.com"
}'const response = await fetch('https://app.mailyte.com/api/v1/senders', {
method: 'POST',
headers: {
Authorization: 'Bearer mk_live_YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"domain_id": "01JBT8XQ2M9WYC3K4F6R7S8T9V",
"name": "Ada from Acme",
"email": "ada@yourdomain.com"
}),
});
const { data } = await response.json();import requests
response = requests.post(
"https://app.mailyte.com/api/v1/senders",
headers={"Authorization": "Bearer mk_live_YOUR_API_KEY"},
json={
"domain_id": "01JBT8XQ2M9WYC3K4F6R7S8T9V",
"name": "Ada from Acme",
"email": "ada@yourdomain.com"
},
)
data = response.json()["data"]<?php
$response = Http::withToken('mk_live_YOUR_API_KEY')
->post('https://app.mailyte.com/api/v1/senders', [
'domain_id' => '01JBT8XQ2M9WYC3K4F6R7S8T9V',
'name' => 'Ada from Acme',
'email' => 'ada@yourdomain.com',
]);
$data = $response->json('data');require "net/http"
require "json"
uri = URI("https://app.mailyte.com/api/v1/senders")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer mk_live_YOUR_API_KEY"
request["Content-Type"] = "application/json"
request.body = {
"domain_id": "01JBT8XQ2M9WYC3K4F6R7S8T9V",
"name": "Ada from Acme",
"email": "ada@yourdomain.com"
}.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }Response
Success.
dataobjectobjectstringsenderidstringUnique identifier for the sender.
namestringThe display name recipients see, e.g.
Acme SupportinAcme Support <hello@acme.com>.emailstringThe address this identity sends as.
POST /messagesrefuses afromthat is not a verified sender.domainstringThe domain this address sends from, such as
acme.com. Its DNS details are onGET /domains/{domain}.verificationobjectWhether this address may be sent from. Verification checks the domain's public DNS records; there is no token.
statestringpending | verified | failedThe one verification answer. Only
verifiedpermits sending;pendingandfailedboth do not, and differ in whether a check has run.verified_atstringWhen the address last passed verification. Set only while
stateisverified. Readstateto know whether the sender works.errorstringWhy the last check failed, usually DNS records still missing. Null when
stateis notfailed.
created_atstringWhen this sender was created.
updated_atstringWhen this sender was last changed.
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.