Integrations API
Manage external service connections for email delivery, document generation, and more. Opbox supports multiple email delivery providers and template-based document generation, along with several other integration types, all with encrypted credential storage.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/integrations | List all integrations |
| POST | /api/integrations | Create an integration |
| GET | /api/integrations/:id | Get integration details |
| PATCH | /api/integrations/:id | Update an integration |
| DELETE | /api/integrations/:id | Delete an integration |
| GET | /api/integrations/stats | Get integration statistics |
| GET | /api/integrations/email-provider-a/templates | List email provider A templates |
| GET | /api/integrations/email-provider-b/templates | List email provider B templates |
| POST | /api/tables/integration/init | Initialize email log tables for active providers |
List Integrations
Returns all integrations for your workspace. Credentials are never included in the response.
GET /api/integrations
Response
[
{
"id": "cm...",
"name": "Production Email",
"type": "EMAIL_PROVIDER",
"config": {
"fromEmail": "noreply@example.com",
"fromName": "Opbox Notifications",
"apiKeyFingerprint": "key.a1b2...****"
},
"enabled": true,
"isSiteEmailProvider": true,
"createdAt": "2026-01-15T08:00:00.000Z",
"updatedAt": "2026-02-01T12:30:00.000Z"
}
]
Create an Integration
Creates a new email provider integration with encrypted credentials. Requires ADMIN or OWNER role.
POST /api/integrations
Content-Type: application/json
{
"name": "Production Email",
"type": "EMAIL_PROVIDER",
"config": {
"fromEmail": "noreply@example.com",
"fromName": "Opbox Notifications"
},
"credentials": {
"apiKey": "your-api-key-here"
},
"enabled": true,
"setAsSiteEmailProvider": true
}
Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Integration display name (1-255 characters) |
type | string | Yes | Provider type: EMAIL_PROVIDER, DOCUMENT_ENGINE, WEBHOOK, SLACK, EXTERNAL_DATABASE, WEBHOOK_PLATFORM, CRM_PLATFORM, CLOUD_STORAGE |
config | object | No | Provider config. Email: fromEmail, fromName. Document Engine: baseUrl. Other types: varies. |
credentials | object | No | Provider credentials (e.g. apiKey). Encrypted at rest. |
enabled | boolean | No | Whether the integration is active (default: true) |
setAsSiteEmailProvider | boolean | No | Set this integration as the workspace-wide email provider for system notifications and automations |
Get Integration Details
Returns details for a specific integration. Requires ADMIN or OWNER role. Credentials are never returned.
GET /api/integrations/:id
Response
{
"id": "cm...",
"name": "Production Email",
"type": "EMAIL_PROVIDER",
"config": {
"fromEmail": "noreply@example.com",
"fromName": "Opbox Notifications",
"apiKeyFingerprint": "key.a1b2...****"
},
"enabled": true,
"credentialsConfigured": true,
"isSiteEmailProvider": true,
"createdAt": "2026-01-15T08:00:00.000Z",
"updatedAt": "2026-02-01T12:30:00.000Z"
}
Integration Statistics
Returns aggregate counts of integrations grouped by status and type.
GET /api/integrations/stats
{
"total": 3,
"enabled": 2,
"disabled": 1,
"byType": {
"EMAIL_PROVIDER": 2,
"EMAIL_PROVIDER_ALT": 1
}
}
Email Templates
Fetch available email templates from your configured email provider. These templates can be referenced in automation email steps for consistent branded communications.
Email Provider A Templates
GET /api/integrations/email-provider-a/templates
{
"templates": [
{
"id": "template_id",
"name": "Welcome Email",
"created_at": "2026-01-10T09:00:00.000Z"
}
]
}
Email Provider B Templates
GET /api/integrations/email-provider-b/templates
{
"templates": [
{
"id": "d-xxxxxxxxxxxxxxxx",
"name": "Client Onboarding",
"created_at": "2026-01-10T09:00:00.000Z"
}
]
}
Template listing requires a configured and enabled integration of the corresponding type. The API key stored in the integration credentials is used to authenticate with the provider.
Integration Types
Opbox supports the following integration types. Each type has its own config and credential fields.
| Type | Config Fields | Credential Fields | Description |
|---|---|---|---|
EMAIL_PROVIDER | fromEmail, fromName | apiKey | Email delivery provider |
EMAIL_PROVIDER_ALT | fromEmail, fromName | apiKey | Alternative email delivery provider |
DOCUMENT_ENGINE | baseUrl | apiKey | Template-based document generation |
WEBHOOK | url | secret | Webhook endpoint |
SLACK | channel, webhookUrl | botToken | Workspace notifications |
EXTERNAL_DATABASE | baseUrl, baseId | apiToken | External database sync |
WEBHOOK_PLATFORM | webhookUrl | - | Webhook platform trigger |
CRM_PLATFORM | portalId | accessToken | CRM platform sync |
CLOUD_STORAGE | rootFolderId | accessToken, refreshToken | Cloud storage provider |
Email Log Tables
Opbox automatically logs every outbound email to dedicated integration tables. One table is created per active email provider. These tables appear under the Integrations tab on the Tables page and grow automatically as emails are sent.
Initialize Email Log Tables
Creates email log tables for all active email provider integrations. This endpoint is idempotent - calling it multiple times is safe. It is triggered automatically on first visit to the Integrations tab.
POST /api/tables/integration/init
{
"success": true,
"tables": [
{
"id": "cm...",
"name": "Email Log",
"systemType": "EMAIL_LOG"
}
]
}
Email Log Columns
Each email log table is created with 13 columns capturing full email metadata:
| Column | Type | Description |
|---|---|---|
| Sent At | Date | When the email was sent |
| To | Text | Recipient address(es) |
| From | Text | Sender address |
| Subject | Text | Email subject line |
| Status | Text | "delivered" or "failed" |
| Provider | Text | Provider name (e.g. "email-provider") |
| Message ID | Text | Provider message identifier |
| CC | Text | CC recipients (comma-separated) |
| BCC | Text | BCC recipients (comma-separated) |
| Template ID | Text | Template used (if any) |
| Source | Text | Where the email originated (see below) |
| Error | Text | Error message (if failed) |
| Attachments | Number | Count of attachments |
Source Labels
The Source column identifies where each email originated. Current source labels:
| Source | Origin |
|---|---|
| Workflow Automation | Workflow engine email step |
| Matter Email Step | Matter pipeline EMAIL step |
| Matter Form Step | Sending a form to a client from a matter |
| Workflow Step | Workflow builder email node |
| Workflow Email | Manual email send via workflow API |
| Form Send | Sending a form link to a client |
| Submission Share | Sharing a submission via email |
| Matter Step | Matter step completion email |
Security
Integration API keys are encrypted at rest before being stored. Credentials are never returned in API responses - only a masked fingerprint is available for identification purposes. All mutation endpoints require ADMIN or OWNER role.