Email Outbound
Send emails, manage drafts, and handle reply/forward workflows programmatically.
The Email Outbound API lets you send emails from Optimaite, manage drafts, and generate pre-filled reply/forward envelopes.
Endpoints
| Method | Path | Description |
|---|---|---|
POST | /api/v1/email/outbound/drafts | Create an email draft |
GET | /api/v1/email/outbound/drafts | List 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}/send | Send an existing draft |
POST | /api/v1/email/outbound/send | Send email directly (no draft) |
POST | /api/v1/email/outbound/reply-envelope | Get pre-filled reply envelope |
POST | /api/v1/email/outbound/forward-envelope | Get pre-filled forward envelope |
GET | /api/v1/email/outbound/signature | Get 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
| Status | Code | Meaning |
|---|---|---|
| 400 | VALIDATION_ERROR | Missing required fields (to, subject) |
| 403 | AUTH_INSUFFICIENT_SCOPE | Missing inbox:write scope |
| 404 | DRAFT_NOT_FOUND | Draft ID does not exist |
| 413 | ATTACHMENT_TOO_LARGE | Total attachment size exceeded |
Next Steps
- Email Inbound -- Receive and process emails
- beA Mailbox -- German electronic legal mailbox
- Documents -- Attach documents to emails
