Skip to main content
GET
/
api
/
v1
/
emails
/
{id}
curl -X GET "https://api.jasni.ai/api/v1/emails/[email protected]&folder=INBOX" \
  -H "Authorization: Bearer jsk_your_api_key"
{
  "success": true,
  "data": {
    "email": {
      "uid": 12345,
      "messageId": "<[email protected]>",
      "from": "[email protected]",
      "to": ["[email protected]"],
      "cc": ["[email protected]"],
      "subject": "Project Update",
      "date": "2024-01-15T10:30:00Z",
      "text": "Hi,\n\nHere's the latest update on the project...",
      "html": "<html><body><p>Hi,</p><p>Here's the latest update on the project...</p></body></html>",
      "attachments": [
        {
          "filename": "report.pdf",
          "contentType": "application/pdf",
          "size": 102400
        }
      ],
      "flags": ["\\Seen"]
    }
  }
}

Request

id
integer
required
Email UID (unique identifier within the mailbox)
account
string
required
Email account the email belongs to
folder
string
default:"INBOX"
Folder where the email is located

Response

success
boolean
Indicates if the request was successful
data
object
curl -X GET "https://api.jasni.ai/api/v1/emails/[email protected]&folder=INBOX" \
  -H "Authorization: Bearer jsk_your_api_key"
{
  "success": true,
  "data": {
    "email": {
      "uid": 12345,
      "messageId": "<[email protected]>",
      "from": "[email protected]",
      "to": ["[email protected]"],
      "cc": ["[email protected]"],
      "subject": "Project Update",
      "date": "2024-01-15T10:30:00Z",
      "text": "Hi,\n\nHere's the latest update on the project...",
      "html": "<html><body><p>Hi,</p><p>Here's the latest update on the project...</p></body></html>",
      "attachments": [
        {
          "filename": "report.pdf",
          "contentType": "application/pdf",
          "size": 102400
        }
      ],
      "flags": ["\\Seen"]
    }
  }
}

Notes

  • The id must be a valid integer representing the email’s UID
  • The account parameter is required to identify which mailbox to query
  • The full email body (both text and html) is returned, unlike the list endpoint which may truncate