API Reference
Complete reference for the OgBae REST API.
Authentication
The email send endpoint uses API key authentication via the Authorization header with a Bearer token. Create API keys in the dashboard at API Keys.
Authorization: Bearer sk_live_your_api_key_hereAll other endpoints (domains, logs, webhooks, suppressions) use session cookie authentication from the panel.
Send Email
Base URL: https://email-api.ogbae.com
/api/v1/email/sendSend an email or batch of emails
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| from | string | Yes | Sender address. Supports "Name <email>" format. |
| to | string[] | Yes* | Recipient addresses. Ignored if personalizations is set. |
| cc | string[] | No | CC recipients. |
| bcc | string[] | No | BCC recipients. |
| subject | string | Yes | Email subject line. |
| text | string | No | Plain text body. |
| html | string | No | HTML body. At least one of text or html is required. |
| reply_to | string | No | Reply-To address. |
| headers | object | No | Custom headers as key-value pairs. |
| type | string | No | "transactional" (default) or "marketing". Marketing costs 2 credits. |
| categories | string[] | No | Tags for analytics grouping. |
| tracking | object | No | {"opens": bool, "clicks": bool}. Overrides default tracking. |
| schedule | string | No | ISO 8601 datetime to schedule delivery. |
| attachments | object[] | No | Array of {filename, content_type, data (base64), content_id}. |
| template_id | string | No | UUID of a saved template. Renders template to HTML at send time. |
| variables | object | No | Key-value pairs for {{key}} substitution in subject, text, and HTML. |
| personalizations | object[] | No | Per-recipient variables. See below. |
Personalizations
When personalizations is provided, the root-level to, cc, and bcc fields are ignored. Each personalization creates a separate email with variable substitution using {{key}} placeholders in the subject, text, and HTML body.
{
"from": "hello@yourdomain.com",
"subject": "Hello {{name}}",
"html": "<p>Welcome, {{name}}!</p>",
"personalizations": [
{
"to": ["alice@example.com"],
"variables": { "name": "Alice" }
},
{
"to": ["bob@example.com"],
"variables": { "name": "Bob" }
}
]
}Response
{
"success": true,
"data": {
"job_id": "abc123",
"message": "Email queued for delivery"
}
}{
"success": true,
"data": {
"job_ids": ["abc123", "def456"],
"message": "2 emails queued for delivery"
}
}Domains
Base URL: https://panel-api.ogbae.com. Session auth required.
/api/v1/domainsAdd a domain. Returns DNS records to configure.
/api/v1/domainsList all domains.
/api/v1/domains/:idGet domain details and DNS records.
/api/v1/domains/:id/verifyVerify domain DNS records.
/api/v1/domains/:idDelete a domain.
Email Logs
Base URL: https://panel-api.ogbae.com. Session auth required.
/api/v1/email-logsList email logs. Supports page, per_page (max 100), status, source, category, search, from, to query params.
/api/v1/email-logs/:idGet a single email log with delivery details and tracking history.
/api/v1/email-logs/stats?period=7dAggregate stats. period: 24h, 7d, 30d, 90d. Includes open/click rates.
/api/v1/email-logs/categoriesList all categories used in email logs.
Suppressions
Base URL: https://panel-api.ogbae.com. Session auth required. Suppressions are type-aware: unsubscribe blocks marketing only, while hard_bounce, spam_complaint, and manual block all mail.
/api/v1/suppressionsList suppressions. Supports page, per_page, reason, search query params.
/api/v1/suppressionsAdd email to suppression list. Body: {"email": "user@example.com"}.
/api/v1/suppressions/check?email=user@example.comCheck if an email is suppressed.
/api/v1/suppressions/:idRemove a suppression. spam_complaint suppressions cannot be deleted.
/api/v1/suppressions/countGet total suppression count.
Webhooks
Base URL: https://panel-api.ogbae.com. Session auth required. Payloads are signed with HMAC-SHA256 using your webhook secret.
/api/v1/webhooksCreate webhook endpoint. Body: {"url": "https://...", "events": ["email.sent"]}.
/api/v1/webhooksList webhook endpoints.
/api/v1/webhooks/:idGet webhook details.
/api/v1/webhooks/:idUpdate webhook URL, events, or active status.
/api/v1/webhooks/:idDelete a webhook endpoint.
/api/v1/webhooks/:id/deliveriesList delivery attempts. Supports page, per_page, status, event query params.
/api/v1/webhooks/:id/testSend a test event to the webhook URL.
/api/v1/webhooks/:id/reveal-secretReveal the webhook signing secret.
Supported events
| Event | Description |
|---|---|
| email.sent | Email was successfully delivered to the recipient's mail server. |
| email.failed | Email delivery failed permanently. |
| email.bounced | Email bounced (hard bounce). |
| email.spam_complaint | Recipient marked the email as spam. |
| email.opened | Recipient opened the email. Includes "first": true/false flag. |
| email.clicked | Recipient clicked a link. Includes link_url, link_index, and "first": true/false. |
Templates
Base URL: https://panel-api.ogbae.com. Session auth required. Create and manage reusable email templates with the visual drag-and-drop editor. Reference templates by template_id when sending email via the API.
/api/v1/templatesList all templates.
/api/v1/templatesCreate a template. Body: {"name": "...", "subject": "...", "document": {...}}.
/api/v1/templates/:idGet template details including full document.
/api/v1/templates/:idUpdate template name, subject, or document.
/api/v1/templates/:idDelete a template.
/api/v1/templates/:id/renderRender template to HTML. Body: {"variables": {"key": "value"}}.
/api/v1/templates/:id/duplicateDuplicate a template.
Sending with templates
Pass template_id and variables in the send request. The template is rendered server-side and {{key}} placeholders are replaced with variable values. If subject is not provided, the template's subject is used.
curl -X POST https://email-api.ogbae.com/api/v1/email/send \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"from": "hello@yourdomain.com",
"to": ["user@example.com"],
"template_id": "your-template-uuid",
"variables": {
"first_name": "Alex",
"company": "Acme Inc"
}
}'