Workflows
Overview
Workflows define conditions and actions that run against tickets. The trigger_type controls when a workflow fires:
on_new_ticket: runs once when a new ticket is created. Does not run on replies.on_inbound_message: runs on every inbound message, including replies to existing tickets.manual: can be triggered from the ticket sidebar when conditions match.
Admin role is required to create, update, or delete workflows.
List Workflows
GET /api/workflows
Show Workflow
GET /api/workflows/{workflow}
The response includes nested conditions and actions arrays.
Create Workflow (admin only)
POST /api/workflows
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | Yes | |
description |
string | No | |
trigger_type |
string | Yes | on_new_ticket, on_inbound_message, or manual |
condition_match_type |
string | No | all (default) or any |
is_enabled |
boolean | No | Defaults to true |
conditions |
array | No | Array of { type, parameters } condition objects |
actions |
array | No | Array of { type, parameters } action objects |
Condition Types
body_containschannel_iscontact_is_newfrom_domain_equalsfrom_email_containsfrom_email_equalsis_first_messagesubject_containssubject_equals
Example Request
curl -X POST https://there-there.app/api/workflows \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "X-Workspace-Id: 1" \
-H "Content-Type: application/json" \
-d '{
"name": "Auto-close spam",
"trigger_type": "on_new_ticket",
"condition_match_type": "any",
"conditions": [
{ "type": "subject_contains", "parameters": { "value": "unsubscribe" } }
],
"actions": [
{ "type": "set_status", "parameters": { "status": "spam" } }
]
}'
Update Workflow (admin only)
PUT /api/workflows/{workflow}
Omit fields to leave them unchanged. If conditions or actions is included, existing conditions/actions are replaced entirely.
Delete Workflow (admin only)
DELETE /api/workflows/{workflow}