Marketing
Manage audience segments, build email templates, and run campaigns. Track opens, clicks, bounces, and other engagement metrics across your marketing efforts.
List segments
Retrieve a paginated list of all audience segments.
Optional parameters
- Name
status- Type
- string
- Description
Filter by status:
active,archived.
- Name
limit- Type
- integer
- Description
Maximum number of records to return (default: 50).
- Name
offset- Type
- integer
- Description
Number of records to skip for pagination.
Request
curl https://api.umbraerp.com/v1/marketing/segments \
-H "Authorization: Bearer <your_access_token>"
Response
{
"result": "success",
"segments": [
{
"id": "seg_abc123",
"name": "Active Customers",
"description": "Customers with a purchase in the last 90 days",
"contact_count": 342,
"status": "active",
"created_at": "2026-01-10T08:00:00Z"
}
],
"total_count": 1
}
Create segment
Create a new audience segment.
Required attributes
- Name
name- Type
- string
- Description
Name of the segment.
Optional attributes
- Name
description- Type
- string
- Description
Description of the segment criteria.
- Name
filters- Type
- object
- Description
Filter rules to automatically populate the segment. Supports
field,operator, andvalueconditions.
- Name
contact_ids- Type
- array
- Description
Array of contact IDs to manually add to the segment.
Request
curl -X POST https://api.umbraerp.com/v1/marketing/segments \
-H "Authorization: Bearer <your_access_token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Active Customers",
"description": "Customers with a purchase in the last 90 days",
"filters": {
"conditions": [
{
"field": "last_purchase_date",
"operator": "gte",
"value": "2025-12-01"
}
]
}
}'
Response
{
"result": "success",
"segment_id": "seg_abc123",
"message": "Segment created successfully."
}
Get segment
Retrieve details of a specific segment, including contact count and filter rules.
Request
curl https://api.umbraerp.com/v1/marketing/segments/seg_abc123 \
-H "Authorization: Bearer <your_access_token>"
Response
{
"result": "success",
"segment": {
"id": "seg_abc123",
"name": "Active Customers",
"description": "Customers with a purchase in the last 90 days",
"contact_count": 342,
"status": "active",
"filters": {
"conditions": [
{
"field": "last_purchase_date",
"operator": "gte",
"value": "2025-12-01"
}
]
},
"created_at": "2026-01-10T08:00:00Z",
"updated_at": "2026-01-10T08:00:00Z"
}
}
Update segment
Update an existing segment's name, description, or filter rules.
Optional attributes
- Name
name- Type
- string
- Description
Updated segment name.
- Name
description- Type
- string
- Description
Updated description.
- Name
filters- Type
- object
- Description
Updated filter rules.
- Name
status- Type
- string
- Description
Set to
activeorarchived.
Request
curl -X PUT https://api.umbraerp.com/v1/marketing/segments/seg_abc123 \
-H "Authorization: Bearer <your_access_token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Active Customers (90 Days)",
"status": "active"
}'
Response
{
"result": "success",
"message": "Segment updated successfully."
}
Delete segment
Delete an audience segment. This does not delete the contacts within the segment.
Request
curl -X DELETE https://api.umbraerp.com/v1/marketing/segments/seg_abc123 \
-H "Authorization: Bearer <your_access_token>"
Response
{
"result": "success",
"message": "Segment deleted successfully."
}
List templates
Retrieve a paginated list of all email templates.
Optional parameters
- Name
status- Type
- string
- Description
Filter by status:
draft,published,archived.
- Name
limit- Type
- integer
- Description
Maximum number of records to return (default: 50).
- Name
offset- Type
- integer
- Description
Number of records to skip for pagination.
Request
curl https://api.umbraerp.com/v1/marketing/templates \
-H "Authorization: Bearer <your_access_token>"
Response
{
"result": "success",
"templates": [
{
"id": "tmpl_001",
"name": "Monthly Newsletter",
"subject": "Your monthly update from {{company_name}}",
"status": "published",
"created_at": "2026-01-05T09:00:00Z",
"updated_at": "2026-02-01T14:30:00Z"
}
],
"total_count": 1
}
Create template
Create a new email template.
Required attributes
- Name
name- Type
- string
- Description
Internal name for the template.
- Name
subject- Type
- string
- Description
Email subject line. Supports merge tags like
{{first_name}}.
- Name
html_body- Type
- string
- Description
HTML content of the email. Supports merge tags.
Optional attributes
- Name
text_body- Type
- string
- Description
Plain text version of the email.
- Name
from_name- Type
- string
- Description
Sender display name.
- Name
from_email- Type
- string
- Description
Sender email address (must be a verified domain).
Request
curl -X POST https://api.umbraerp.com/v1/marketing/templates \
-H "Authorization: Bearer <your_access_token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Monthly Newsletter",
"subject": "Your monthly update from {{company_name}}",
"html_body": "<h1>Hello {{first_name}}</h1><p>Here is your monthly update.</p>",
"text_body": "Hello {{first_name}}, here is your monthly update.",
"from_name": "Marketing Team",
"from_email": "marketing@example.com"
}'
Response
{
"result": "success",
"template_id": "tmpl_001",
"message": "Template created successfully."
}
Get template
Retrieve details of a specific email template, including its HTML and text content.
Request
curl https://api.umbraerp.com/v1/marketing/templates/tmpl_001 \
-H "Authorization: Bearer <your_access_token>"
Response
{
"result": "success",
"template": {
"id": "tmpl_001",
"name": "Monthly Newsletter",
"subject": "Your monthly update from {{company_name}}",
"html_body": "<h1>Hello {{first_name}}</h1><p>Here is your monthly update.</p>",
"text_body": "Hello {{first_name}}, here is your monthly update.",
"from_name": "Marketing Team",
"from_email": "marketing@example.com",
"status": "published",
"created_at": "2026-01-05T09:00:00Z",
"updated_at": "2026-02-01T14:30:00Z"
}
}
Update template
Update an existing email template.
Optional attributes
- Name
name- Type
- string
- Description
Updated template name.
- Name
subject- Type
- string
- Description
Updated subject line.
- Name
html_body- Type
- string
- Description
Updated HTML content.
- Name
text_body- Type
- string
- Description
Updated plain text content.
- Name
status- Type
- string
- Description
Set to
draft,published, orarchived.
Request
curl -X PUT https://api.umbraerp.com/v1/marketing/templates/tmpl_001 \
-H "Authorization: Bearer <your_access_token>" \
-H "Content-Type: application/json" \
-d '{
"subject": "Your February update from {{company_name}}",
"status": "published"
}'
Response
{
"result": "success",
"message": "Template updated successfully."
}
Delete template
Delete an email template. Templates that are currently in use by active campaigns cannot be deleted.
Request
curl -X DELETE https://api.umbraerp.com/v1/marketing/templates/tmpl_001 \
-H "Authorization: Bearer <your_access_token>"
Response
{
"result": "success",
"message": "Template deleted successfully."
}
List campaigns
Retrieve a paginated list of all email campaigns.
Optional parameters
- Name
status- Type
- string
- Description
Filter by status:
draft,scheduled,sending,sent,paused,cancelled.
- Name
limit- Type
- integer
- Description
Maximum number of records to return (default: 50).
- Name
offset- Type
- integer
- Description
Number of records to skip for pagination.
Request
curl https://api.umbraerp.com/v1/marketing/campaigns \
-H "Authorization: Bearer <your_access_token>"
Response
{
"result": "success",
"campaigns": [
{
"id": "cmp_001",
"name": "February Newsletter",
"template_id": "tmpl_001",
"segment_id": "seg_abc123",
"status": "sent",
"sent_at": "2026-02-01T10:00:00Z",
"created_at": "2026-01-28T14:00:00Z"
}
],
"total_count": 1
}
Create campaign
Create a new email campaign.
Required attributes
- Name
name- Type
- string
- Description
Campaign name.
- Name
template_id- Type
- string
- Description
ID of the email template to use.
- Name
segment_id- Type
- string
- Description
ID of the audience segment to send to.
Optional attributes
- Name
subject_override- Type
- string
- Description
Override the template's subject line for this campaign.
- Name
from_name_override- Type
- string
- Description
Override the sender display name.
- Name
from_email_override- Type
- string
- Description
Override the sender email address.
- Name
reply_to- Type
- string
- Description
Reply-to email address.
Request
curl -X POST https://api.umbraerp.com/v1/marketing/campaigns \
-H "Authorization: Bearer <your_access_token>" \
-H "Content-Type: application/json" \
-d '{
"name": "February Newsletter",
"template_id": "tmpl_001",
"segment_id": "seg_abc123",
"reply_to": "replies@example.com"
}'
Response
{
"result": "success",
"campaign_id": "cmp_001",
"message": "Campaign created successfully."
}
Get campaign
Retrieve details of a specific campaign, including its current status and configuration.
Request
curl https://api.umbraerp.com/v1/marketing/campaigns/cmp_001 \
-H "Authorization: Bearer <your_access_token>"
Response
{
"result": "success",
"campaign": {
"id": "cmp_001",
"name": "February Newsletter",
"template_id": "tmpl_001",
"segment_id": "seg_abc123",
"status": "draft",
"reply_to": "replies@example.com",
"created_at": "2026-01-28T14:00:00Z",
"updated_at": "2026-01-28T14:00:00Z"
}
}
Send campaign
Send a campaign immediately. The campaign must be in draft or scheduled status.
Request
curl -X POST https://api.umbraerp.com/v1/marketing/campaigns/cmp_001/send \
-H "Authorization: Bearer <your_access_token>"
Response
{
"result": "success",
"message": "Campaign is being sent.",
"recipients_count": 342
}
Schedule campaign
Schedule a campaign for future delivery. The campaign must be in draft status.
Required attributes
- Name
scheduled_at- Type
- string
- Description
ISO 8601 datetime for when the campaign should be sent (e.g.,
2026-03-15T10:00:00Z).
Request
curl -X POST https://api.umbraerp.com/v1/marketing/campaigns/cmp_001/schedule \
-H "Authorization: Bearer <your_access_token>" \
-H "Content-Type: application/json" \
-d '{
"scheduled_at": "2026-03-15T10:00:00Z"
}'
Response
{
"result": "success",
"message": "Campaign scheduled successfully.",
"scheduled_at": "2026-03-15T10:00:00Z"
}
Pause campaign
Pause a campaign that is currently sending or scheduled. Pausing a sending campaign will stop delivery to remaining recipients.
Request
curl -X POST https://api.umbraerp.com/v1/marketing/campaigns/cmp_001/pause \
-H "Authorization: Bearer <your_access_token>"
Response
{
"result": "success",
"message": "Campaign paused successfully."
}
Cancel campaign
Cancel a campaign. Only campaigns in draft, scheduled, or paused status can be cancelled. This action is irreversible.
Request
curl -X POST https://api.umbraerp.com/v1/marketing/campaigns/cmp_001/cancel \
-H "Authorization: Bearer <your_access_token>"
Response
{
"result": "success",
"message": "Campaign cancelled successfully."
}
Campaign analytics
Retrieve performance analytics for a sent campaign, including opens, clicks, bounces, and unsubscribes.
Request
curl https://api.umbraerp.com/v1/marketing/campaigns/cmp_001/analytics \
-H "Authorization: Bearer <your_access_token>"
Response
{
"result": "success",
"analytics": {
"campaign_id": "cmp_001",
"recipients": 342,
"delivered": 338,
"opened": 186,
"open_rate": 55.03,
"clicked": 72,
"click_rate": 21.30,
"bounced": 4,
"bounce_rate": 1.17,
"unsubscribed": 2,
"unsubscribe_rate": 0.59,
"spam_reports": 0,
"last_updated_at": "2026-02-02T08:00:00Z"
}
}

