CORE CONCEPTS

Sending mail

Send text, HTML, replies, and attachments through the agent API.

Send endpoint

Messages may include text, HTML, cc, bcc, reply-to, threading headers, and attachments. The authenticated key determines the sending agent and From address.

POST https://api.tekmail.app/api/v1/send
Authorization: Bearer tk_your_api_key
Idempotency-Key: task_01K1SEND123
Content-Type: application/json

{
  "to": "customer@example.com",
  "subject": "Your report is ready",
  "text": "I attached the completed report."
}

Safe retries

Generate one stable idempotency key for each logical message. If a timeout or tool interruption makes the result uncertain, retry the exact payload with the same key. TekMail returns the original message ID and current status instead of creating a second send. Reusing a key with a changed payload returns HTTP 409.