Managed (Cloud)
Self-Hosted
- Welcome to Self Mail Kit
- How to Deploy
API Reference
- API Reference Introduction
- Endpoints
- Email
- Domain
- Audience
- Contact
Endpoints
- Email
- Domain
- Audience
- Contact
Email
Send email
Endpoint: v1/emails
Send a transactional email with optional template, attachments, and variables
curl --request POST \
--url https://api.selfmailkit.com/v1/emails \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"from": "Your Name <sender@yourdomain.com>",
"to": "recipient@example.com",
"subject": "Welcome to Our Service!",
"html": "<p>Hello {{name}}!</p>",
"template_id": "welcome-template",
"text": "Hello {{name}}!",
"cc": "cc@example.com",
"bcc": "bcc@example.com",
"reply_to": "reply@yourdomain.com",
"variables": {
"date": "27 November",
"plan": {
"value": "Pro Plan",
"default": "Free Plan"
},
"company": {
"value": null,
"default": "our company"
},
"title": {
"value": null,
"default": "valued customer"
}
},
"attachments": [
{
"filename": "<string>",
"path": "<string>",
"content_type": "<string>"
}
]
}'
{
"id": "0195c9e3-5067-741d-be87-a4f75ef93372"
}
Authorizations
API key with format "Bearer {your-api-key}"
Body
application/json
Response
201
application/json
Email successfully queued for sending
The response is of type object
.
curl --request POST \
--url https://api.selfmailkit.com/v1/emails \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"from": "Your Name <sender@yourdomain.com>",
"to": "recipient@example.com",
"subject": "Welcome to Our Service!",
"html": "<p>Hello {{name}}!</p>",
"template_id": "welcome-template",
"text": "Hello {{name}}!",
"cc": "cc@example.com",
"bcc": "bcc@example.com",
"reply_to": "reply@yourdomain.com",
"variables": {
"date": "27 November",
"plan": {
"value": "Pro Plan",
"default": "Free Plan"
},
"company": {
"value": null,
"default": "our company"
},
"title": {
"value": null,
"default": "valued customer"
}
},
"attachments": [
{
"filename": "<string>",
"path": "<string>",
"content_type": "<string>"
}
]
}'
{
"id": "0195c9e3-5067-741d-be87-a4f75ef93372"
}
Assistant
Responses are generated using AI and may contain mistakes.