Aliasify

Send Emails

Send emails from one of your aliases

Send an Email

Sends an email from one of your aliases. The email is queued for asynchronous delivery.

POST /api/v1/emails

Required scope: emails:write

Request Body

FieldTypeRequiredDescription
fromAddressIdstringYesUUID of the alias used as sender
tostringYesRecipient email address
subjectstringYesEmail subject (max 200 characters)
bodystringYesEmail body in plain text (max 50,000 characters)
bodyHtmlstringNoEmail body in HTML

Example

curl -X POST https://api.aliasify.app/api/v1/emails \
  -H "Authorization: Bearer jm_live_xxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "fromAddressId": "550e8400-e29b-41d4-a716-446655440000",
    "to": "destinataire@example.com",
    "subject": "Test depuis Aliasify",
    "body": "Ceci est un email envoyé via l'\''API Aliasify.",
    "bodyHtml": "<p>Ceci est un email envoyé via l'\''API <b>Aliasify</b>.</p>"
  }'

JavaScript

const response = await fetch('https://api.aliasify.app/api/v1/emails', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer jm_live_xxxx',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    fromAddressId: '550e8400-e29b-41d4-a716-446655440000',
    to: 'destinataire@example.com',
    subject: 'Test depuis Aliasify',
    body: "Ceci est un email envoyé via l'API Aliasify.",
  }),
});

Python

import requests

response = requests.post(
    'https://api.aliasify.app/api/v1/emails',
    headers={
        'Authorization': 'Bearer jm_live_xxxx',
        'Content-Type': 'application/json',
    },
    json={
        'fromAddressId': '550e8400-e29b-41d4-a716-446655440000',
        'to': 'destinataire@example.com',
        'subject': 'Test depuis Aliasify',
        'body': "Ceci est un email envoyé via l'API Aliasify.",
    }
)

Response

{
  "data": {
    "id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8"
  },
  "message": "Email queued for sending"
}

The email is processed asynchronously. The returned id can be used to retrieve the sent email via GET /api/v1/emails/:id once it has been processed.