Optimaite

Email Outbound

Send emails, manage drafts, and handle reply/forward workflows programmatically.

3 Min. LesezeitAktualisiert 27. Mai 2026

The Email Outbound API lets you send emails from Optimaite, manage drafts, and generate pre-filled reply/forward envelopes.

Endpoints

MethodPathDescription
POST/api/v1/email/outbound/draftsCreate an email draft
GET/api/v1/email/outbound/draftsList drafts for current user
GET/api/v1/email/outbound/drafts/{id}Get a draft by ID
PUT/api/v1/email/outbound/drafts/{id}Update a draft (autosave)
DELETE/api/v1/email/outbound/drafts/{id}Delete a draft
POST/api/v1/email/outbound/drafts/{id}/sendSend an existing draft
POST/api/v1/email/outbound/sendSend email directly (no draft)
POST/api/v1/email/outbound/reply-envelopeGet pre-filled reply envelope
POST/api/v1/email/outbound/forward-envelopeGet pre-filled forward envelope
GET/api/v1/email/outbound/signatureGet default email signature

Required scope: inbox:write for sending and draft management.

The Draft Object

{
  "id": "draft_01ABCDEFG",
  "to": ["client@example.com"],
  "cc": [],
  "bcc": [],
  "subject": "Re: Contract Review",
  "body_html": "<p>Dear Mr. Smith,</p><p>...</p>",
  "attachments": [
    {
      "document_id": "doc_01ABCDEF",
      "filename": "contract_v2.pdf"
    }
  ],
  "case_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "draft",
  "created_at": "2026-05-20T14:00:00Z",
  "updated_at": "2026-05-20T14:05:00Z"
}

Create a Draft

POST /api/v1/email/outbound/drafts
{
  "to": ["client@example.com"],
  "subject": "Re: Contract Review",
  "body_html": "<p>Dear Mr. Smith,</p><p>Please find the updated contract attached.</p>",
  "case_id": "550e8400-e29b-41d4-a716-446655440000",
  "attachments": ["doc_01ABCDEF"]
}

Send Directly

POST /api/v1/email/outbound/send

Send an email without managing a draft explicitly. Generate one UUID for the user's send action and reuse that same idempotency_key for every retry of the request. Reusing it with different content is rejected.

{
  "idempotency_key": "5de89f5e-c224-4f6d-a9a0-cb976cd30e82",
  "to_recipients": ["opposing.counsel@lawfirm.de"],
  "cc_recipients": ["partner@optimaite.eu"],
  "subject": "Response to Your Letter dated May 15",
  "body_html": "<p>Dear Colleague,</p><p>...</p>"
}

Response

Returns 200 OK with the provider-neutral sent identity:

{
  "success": true,
  "email_id": "0198ef9a-03c7-74cb-a29b-4ad9e6bf33ac",
  "message_id": "provider-message-id",
  "sent_at": "2026-05-20T14:10:00Z"
}

Reply / Forward Envelopes

Get a pre-filled draft envelope based on an existing correspondence item:

POST /api/v1/email/outbound/reply-envelope
{
  "correspondence_id": "corr_01INBOUND",
  "reply_all": false
}

Returns a draft object with to, subject (with "Re:"), body_html (quoted original), and case context pre-filled.

Signature

GET /api/v1/email/outbound/signature

Returns the current user's configured email signature for use in drafts.

Error Responses

StatusCodeMeaning
400VALIDATION_ERRORMissing required fields (to, subject)
403AUTH_INSUFFICIENT_SCOPEMissing inbox:write scope
404DRAFT_NOT_FOUNDDraft ID does not exist
413ATTACHMENT_TOO_LARGETotal attachment size exceeded

Next Steps

Contact

Let's talk

Ready for the next step? Tell us about your project and we'll show you how Optimaite can help.

By submitting, you agree to our Privacy Policy .