Workflows
Create automated email sequences triggered by events or API calls.
Workflows allow you to build automated email sequences that respond to subscriber actions. Each workflow consists of triggers, conditions, and actions that execute in sequence.
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/workflows | List all workflows |
| POST | /api/v1/workflows | Create a new workflow |
| GET | /api/v1/workflows/:id | Get workflow details |
| PUT | /api/v1/workflows/:id | Update a workflow |
| DELETE | /api/v1/workflows/:id | Delete a workflow |
| POST | /api/v1/workflows/:id/activate | Activate a workflow |
| POST | /api/v1/workflows/:id/pause | Pause a workflow |
Trigger Types
Workflows can be triggered by various events or manually via the API.
Triggered manually via API call
When a new subscriber is added
When subscriber data changes
When a recipient opens an email
When a recipient clicks a link
List Workflows
Retrieve all workflows for your organization with optional filtering.
curl -X GET https://api.sendmailos.com/api/v1/workflows \
-H "Authorization: Bearer sk_live_..."
{
"success": true,
"workflows": [
{
"id": "wf_abc123",
"name": "Welcome Series",
"status": "active",
"triggerConfig": { "type": "subscriber.created" },
"stats": {
"totalRuns": 1250,
"activeRuns": 42,
"completedRuns": 1208
}
}
]
}
Create Workflow
Create a new workflow with a name and optional trigger configuration.
nameRequired - Workflow nametriggerOptional - Trigger configurationtrigger.typeTrigger type (default: "api")workspace_idOptional - Associate with workspacecurl -X POST https://api.sendmailos.com/api/v1/workflows \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Welcome Series",
"trigger": {
"type": "subscriber.created"
}
}'
Activate & Pause
Control workflow execution by activating or pausing workflows.
curl -X POST https://api.sendmailos.com/api/v1/workflows/wf_abc123/activate \
-H "Authorization: Bearer sk_live_..."
# Pause a workflow
curl -X POST https://api.sendmailos.com/api/v1/workflows/wf_abc123/pause \
-H "Authorization: Bearer sk_live_..."
Update Workflow
Update workflow properties including name, nodes, edges, and trigger configuration.
nameWorkflow namenodesArray of workflow nodesedgesArray of node connectionstriggerTrigger configurationcurl -X PUT https://api.sendmailos.com/api/v1/workflows/wf_abc123 \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Welcome Series",
"trigger": {
"type": "subscriber.created",
"conditions": { "tags": ["premium"] }
}
}'
Delete Workflow
Permanently delete a workflow. This action cannot be undone.
Warning: Deleting a workflow will stop all active executions and remove all historical data. Consider pausing the workflow instead if you may need it later.
curl -X DELETE https://api.sendmailos.com/api/v1/workflows/wf_abc123 \
-H "Authorization: Bearer sk_live_..."
{
"success": true,
"message": "Workflow deleted"
}
Workflow Statuses
Workflow is being configured, not yet activated
Workflow is live and processing triggers
Workflow is paused, no new executions will start