Skip to main content

Build Tenant-Aware Communications

Use the Communications Block API when your product needs reusable lists, contacts, templates, campaigns, suppressions, tracking, and unsubscribe analytics.

Communications endpoints are tenant-scoped with X-Tenant-Id.

When To Use Communications Block

Use it when the application needs:

  • contact lists and subscriber management
  • reusable templates
  • template validation before saving
  • campaigns and campaign analytics
  • suppressions and unsubscribe handling
  • tenant-aware communication workflows

For one-off transactional email, use the HTTP Send API instead.

Required Header

X-Tenant-Id: YOUR_TENANT_ID

Health Check

curl -H "X-Tenant-Id: $COMM_TENANT_ID" \
"https://api.motorical.com/comm-api/api/health"

Validate a Template

Validate templates before saving them or attaching them to campaign workflows.

curl -X POST "https://api.motorical.com/comm-api/api/templates/validate" \
-H "X-Tenant-Id: $COMM_TENANT_ID" \
-H "Content-Type: application/json" \
-d '{
"name": "Welcome template",
"type": "html",
"subject": "Welcome {{name}}",
"body_html": "<p>Hello {{name}}</p><p><a href=\"{{unsubscribe_url}}\">Unsubscribe</a></p>",
"body_text": "Hello {{name}}\nUnsubscribe: {{unsubscribe_url}}",
"sampleData": {
"name": "Ada",
"unsubscribe_url": "https://example.com/unsubscribe"
}
}'

List Campaigns Compactly

Use compact campaign responses for scripts, checks, and logs.

curl -H "X-Tenant-Id: $COMM_TENANT_ID" \
"https://api.motorical.com/comm-api/api/campaigns?compact=true"

For clean operations, pair Communications workflows with the right Motor Block boundaries:

  • one tenant per Communications tenant when data isolation matters
  • one Motor Block per sender domain or application
  • separate testing and production blocks for campaign QA
  • separate webhooks for staging and production campaign events