Skip to main content
POST
/
api
/
v1
/
emails
/
{id}
/
forward
curl -X POST "https://api.jasni.ai/api/v1/emails/12345/[email protected]" \
  -H "Authorization: Bearer jsk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "[email protected]",
    "text": "FYI - see the email below.",
    "includeOriginal": true
  }'
{
  "success": true,
  "data": {
    "messageId": "<[email protected]>",
    "from": "[email protected]",
    "to": ["[email protected]"],
    "subject": "Fwd: Project Update",
    "savedToSent": true,
    "forwardedFrom": {
      "uid": 12345,
      "from": "[email protected]",
      "subject": "Project Update",
      "date": "2024-01-15T10:30:00Z"
    }
  }
}

Request

id
integer
required
UID of the email to forward
account
string
required
Email account to send from
folder
string
default:"INBOX"
Folder where the original email is located

Body

to
string | string[]
required
Recipient(s) to forward to
cc
string | string[]
CC recipient(s)
bcc
string | string[]
BCC recipient(s)
text
string
Optional message to include before the forwarded content
html
string
Optional HTML message
includeOriginal
boolean
default:"true"
Whether to include the original email content

Response

success
boolean
Indicates if the forward was sent successfully
data
object
curl -X POST "https://api.jasni.ai/api/v1/emails/12345/[email protected]" \
  -H "Authorization: Bearer jsk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "[email protected]",
    "text": "FYI - see the email below.",
    "includeOriginal": true
  }'
{
  "success": true,
  "data": {
    "messageId": "<[email protected]>",
    "from": "[email protected]",
    "to": ["[email protected]"],
    "subject": "Fwd: Project Update",
    "savedToSent": true,
    "forwardedFrom": {
      "uid": 12345,
      "from": "[email protected]",
      "subject": "Project Update",
      "date": "2024-01-15T10:30:00Z"
    }
  }
}

How It Works

When you forward an email, Jasni:
  1. Fetches the original email: Retrieves the full content from the specified folder
  2. Formats the forward:
    • Adds Fwd: prefix to the subject
    • Includes forwarded message header with original sender, date, subject
    • Wraps the original content
  3. Adds your message: Your text or html appears before the forwarded content
  4. Sends to new recipients: Delivers to the specified To/CC/BCC addresses
  5. Saves to Sent: Stores a copy in your Sent folder

Forward with Custom Message

// Forward with a detailed HTML message
const response = await fetch(
  'https://api.jasni.ai/api/v1/emails/12345/[email protected]',
  {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer jsk_your_api_key',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      to: ['[email protected]'],
      bcc: ['[email protected]'],
      html: `
        <p>Hi Team Lead,</p>
        <p>Please review the customer inquiry below. I think we should:</p>
        <ul>
          <li>Schedule a call this week</li>
          <li>Prepare a proposal</li>
        </ul>
        <p>Let me know your thoughts.</p>
        <p>Thanks!</p>
      `,
      includeOriginal: true,
    }),
  }
);

Notes

  • The to parameter is required - you must specify at least one recipient
  • All recipient emails are validated before sending
  • The original email content is preserved including any formatting
  • forwardedFrom in the response contains metadata about the original email