Skip to main content
POST
/
api
/
v1
/
emails
/
send
curl -X POST https://api.jasni.ai/api/v1/emails/send \
  -H "Authorization: Bearer jsk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "[email protected]",
    "to": "[email protected]",
    "subject": "Hello from Jasni!",
    "text": "This is a plain text message.",
    "html": "<h1>Hello!</h1><p>This is an HTML message.</p>"
  }'
{
  "success": true,
  "data": {
    "messageId": "<[email protected]>",
    "from": "[email protected]",
    "to": ["[email protected]"],
    "subject": "Hello from Jasni!",
    "savedToSent": true
  }
}

Request Body

from
string
required
Sender email address. Must be an account you own.
to
string | string[]
required
Recipient email address(es)
subject
string
required
Email subject line
text
string
Plain text body. At least one of text or html is required.
html
string
HTML body. At least one of text or html is required.
cc
string | string[]
CC recipient(s)
bcc
string | string[]
BCC recipient(s)
replyTo
string
Reply-to address

Response

success
boolean
Indicates if the email was sent successfully
data
object
curl -X POST https://api.jasni.ai/api/v1/emails/send \
  -H "Authorization: Bearer jsk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "[email protected]",
    "to": "[email protected]",
    "subject": "Hello from Jasni!",
    "text": "This is a plain text message.",
    "html": "<h1>Hello!</h1><p>This is an HTML message.</p>"
  }'
{
  "success": true,
  "data": {
    "messageId": "<[email protected]>",
    "from": "[email protected]",
    "to": ["[email protected]"],
    "subject": "Hello from Jasni!",
    "savedToSent": true
  }
}

Notes

  • The from address must be an email account that belongs to you
  • At least one of text or html body is required
  • For best compatibility, provide both text and html versions
  • The email is automatically saved to the Sent folder (savedToSent: true)
  • An email.sent webhook event is triggered after successful delivery

Webhook Event

When an email is sent successfully, an email.sent webhook event is dispatched:
{
  "event": "email.sent",
  "timestamp": "2024-01-15T10:30:00.000Z",
  "data": {
    "id": "<[email protected]>",
    "messageId": "<[email protected]>",
    "from": "[email protected]",
    "to": ["[email protected]"],
    "subject": "Hello from Jasni!",
    "account": "[email protected]"
  }
}