Send Email
Send a transactional email with optional attachments, tracking, and personalization. At least one of html or text content must be provided. Supply Idempotency-Key for safe retries using SparkPost native transmission idempotency. Keys are namespaced per Lettr API key and retained by SparkPost for 24 hours. Repeating the same transmission payload returns its original result without another delivery; conflicting payloads or in-progress transmissions return 409. Retry transport failures with the same key. Lettr still validates authorization, domains and sending quota before contacting SparkPost, so an exhausted quota returns 429 even for a retry. Replayed responses do not increment sending counters again. Requests without this header are sent independently.
Request
- Base URL: https://app.lettr.com/api
- URL: https://app.lettr.com/api/emails
- Auth: HTTP bearer
Headers
A unique key for one logical send. Reuse it with the same payload and API key when retrying. SparkPost retains the key for 24 hours. If using a template, keep the resolved template content unchanged across retries.
Request body
Example request
{
"from": "sender@example.com",
"from_name": "Sender Name",
"subject": "Welcome to Lettr",
"to": [
"recipient@example.com"
],
"cc": [
"cc@example.com"
],
"bcc": [
"bcc@example.com"
],
"reply_to": "reply@example.com",
"reply_to_name": "Reply Name",
"html": "<h1>Hello</h1><p>Welcome!</p>",
"text": "Hello\n\nWelcome!",
"project_id": 123,
"template_slug": "welcome-email",
"template_version": 1,
"tag": "welcome-series-2024",
"metadata": {
"user_id": "12345",
"campaign": "onboarding"
},
"headers": {
"X-Mailer": "MyApp/1.0",
"X-Custom-ID": "abc-123"
},
"substitution_data": {
"first_name": "John",
"company": "Acme Inc"
},
"attachments": [
{
"name": "invoice.pdf",
"type": "application/pdf",
"data": "JVBERi0xLjQKJeLjz9MKMyAwIG9iago8PC9UeXBlL1BhZ2U="
}
]
}Response
Email queued for delivery. Free tier teams receive quota headers indicating their usage and limits.
Example response
{
"message": "Email queued for delivery.",
"data": {
"request_id": "12345678901234567890",
"accepted": 1
}
}Changes
No recorded changes to this operation across all 1 revision of this API.