Opbox

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

MethodEndpointDescription
GET/api/integrationsList all integrations
POST/api/integrationsCreate an integration
GET/api/integrations/:idGet integration details
PATCH/api/integrations/:idUpdate an integration
DELETE/api/integrations/:idDelete an integration
GET/api/integrations/statsGet integration statistics
GET/api/integrations/email-provider-a/templatesList email provider A templates
GET/api/integrations/email-provider-b/templatesList email provider B templates
POST/api/tables/integration/initInitialize 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

FieldTypeRequiredDescription
namestringYesIntegration display name (1-255 characters)
typestringYesProvider type: EMAIL_PROVIDER, DOCUMENT_ENGINE, WEBHOOK, SLACK, EXTERNAL_DATABASE, WEBHOOK_PLATFORM, CRM_PLATFORM, CLOUD_STORAGE
configobjectNoProvider config. Email: fromEmail, fromName. Document Engine: baseUrl. Other types: varies.
credentialsobjectNoProvider credentials (e.g. apiKey). Encrypted at rest.
enabledbooleanNoWhether the integration is active (default: true)
setAsSiteEmailProviderbooleanNoSet 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.

TypeConfig FieldsCredential FieldsDescription
EMAIL_PROVIDERfromEmail, fromNameapiKeyEmail delivery provider
EMAIL_PROVIDER_ALTfromEmail, fromNameapiKeyAlternative email delivery provider
DOCUMENT_ENGINEbaseUrlapiKeyTemplate-based document generation
WEBHOOKurlsecretWebhook endpoint
SLACKchannel, webhookUrlbotTokenWorkspace notifications
EXTERNAL_DATABASEbaseUrl, baseIdapiTokenExternal database sync
WEBHOOK_PLATFORMwebhookUrl-Webhook platform trigger
CRM_PLATFORMportalIdaccessTokenCRM platform sync
CLOUD_STORAGErootFolderIdaccessToken, refreshTokenCloud 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:

ColumnTypeDescription
Sent AtDateWhen the email was sent
ToTextRecipient address(es)
FromTextSender address
SubjectTextEmail subject line
StatusText"delivered" or "failed"
ProviderTextProvider name (e.g. "email-provider")
Message IDTextProvider message identifier
CCTextCC recipients (comma-separated)
BCCTextBCC recipients (comma-separated)
Template IDTextTemplate used (if any)
SourceTextWhere the email originated (see below)
ErrorTextError message (if failed)
AttachmentsNumberCount of attachments

Source Labels

The Source column identifies where each email originated. Current source labels:

SourceOrigin
Workflow AutomationWorkflow engine email step
Matter Email StepMatter pipeline EMAIL step
Matter Form StepSending a form to a client from a matter
Workflow StepWorkflow builder email node
Workflow EmailManual email send via workflow API
Form SendSending a form link to a client
Submission ShareSharing a submission via email
Matter StepMatter 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.