Automations
Automation rules that trigger actions when specific events occur. Rules have conditions, actions, and can be tested with dry runs.
The Automation object
Rule ID
Rule name
Event that triggers this rule
Conditions that must match (all/any)
Actions to execute when triggered
Whether the rule is active
Total times this rule has fired
Endpoints
/api/v1/teams/{teamId}/automationsList Automations
List all automation rules.
Code Examples
curl -X GET "https://www.cstar.help/api/v1/teams/{teamId}/automations" \
-H "Authorization: Bearer sk_live_your_key" Responses
{
"success": true,
"data": [
{
"id": "rule_abc",
"name": "Auto-assign critical",
"triggerEvent": "ticket.created",
"enabled": true,
"executionCount": 234
}
]
} {
"success": false,
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The API key provided is invalid or has been revoked",
"doc_url": "https://www.cstar.help/developers/errors#invalid_api_key",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "authentication_error",
"code": "insufficient_permissions",
"message": "Your API key does not have permission for this operation",
"doc_url": "https://www.cstar.help/developers/errors#insufficient_permissions",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Try again in 60 seconds.",
"retryAfter": 60,
"doc_url": "https://www.cstar.help/developers/errors#rate_limit_exceeded",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} /api/v1/teams/{teamId}/automationsCreate Automation
Create a new automation rule.
Request Body
name string requiredRule name
triggerEvent string requiredTrigger event
conditions object Match conditions
actions array Actions to execute
enabled boolean Enable immediately
Default: true
Code Examples
curl -X POST "https://www.cstar.help/api/v1/teams/{teamId}/automations" \
-H "Authorization: Bearer sk_live_your_key" \
-H "Content-Type: application/json" \
-d '{"name":"Auto-assign critical","triggerEvent":"ticket.created","conditions":{"all":[{"field":"priority","operator":"is","value":"critical"}]},"actions":[{"type":"assign_to","memberId":"550e8400-e29b-41d4-a716-446655440001"}]}' Responses
{
"success": true,
"data": {
"id": "rule_abc",
"name": "Auto-assign critical",
"triggerEvent": "ticket.created",
"enabled": true
}
} {
"success": false,
"error": {
"type": "invalid_request_error",
"code": "idempotency_key_in_use",
"message": "A request with this Idempotency-Key is still being processed. Retry after it finishes.",
"doc_url": "https://www.cstar.help/developers/errors#idempotency_key_in_use",
"request_id": "req_abc123"
},
"meta": {
"requestId": "req_abc123",
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "invalid_request_error",
"code": "idempotency_key_reused",
"message": "The Idempotency-Key was already used for a request with a different body. Generate a new key for this request.",
"doc_url": "https://www.cstar.help/developers/errors#idempotency_key_reused",
"request_id": "req_abc123"
},
"meta": {
"requestId": "req_abc123",
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The API key provided is invalid or has been revoked",
"doc_url": "https://www.cstar.help/developers/errors#invalid_api_key",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "authentication_error",
"code": "insufficient_permissions",
"message": "Your API key does not have permission for this operation",
"doc_url": "https://www.cstar.help/developers/errors#insufficient_permissions",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Try again in 60 seconds.",
"retryAfter": 60,
"doc_url": "https://www.cstar.help/developers/errors#rate_limit_exceeded",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} /api/v1/teams/{teamId}/automations/{ruleId}/testTest Automation (Dry Run)
Dry-run a rule against a specific resource to preview its actions without executing them.
Path Parameters
ruleId string requiredRule ID
Request Body
resourceType string requiredResource type to test against
resourceId string requiredResource ID to test against
messageId string New Message rules only: a message on the ticket to test with. Without it, the test uses a public customer message, which is what a rule runs on unless its ALL conditions set Message from or Message type. A rule that passes over the message answers wouldMatch false with skippedReason 'not_a_customer_message'. Any id that is not one of the ticket's messages gets a 404.
Code Examples
curl -X POST "https://www.cstar.help/api/v1/teams/{teamId}/automations/{ruleId}/test" \
-H "Authorization: Bearer sk_live_your_key" \
-H "Content-Type: application/json" \
-d '{"resourceType":"ticket","resourceId":"tkt_abc"}' Responses
{
"success": true,
"data": {
"wouldMatch": true,
"conditionResults": {
"all": [
{
"field": "priority",
"passed": true
}
]
},
"actionsWouldExecute": [
{
"action": "assign",
"success": true
}
]
}
} {
"success": false,
"error": {
"type": "invalid_request_error",
"code": "idempotency_key_in_use",
"message": "A request with this Idempotency-Key is still being processed. Retry after it finishes.",
"doc_url": "https://www.cstar.help/developers/errors#idempotency_key_in_use",
"request_id": "req_abc123"
},
"meta": {
"requestId": "req_abc123",
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "invalid_request_error",
"code": "idempotency_key_reused",
"message": "The Idempotency-Key was already used for a request with a different body. Generate a new key for this request.",
"doc_url": "https://www.cstar.help/developers/errors#idempotency_key_reused",
"request_id": "req_abc123"
},
"meta": {
"requestId": "req_abc123",
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The API key provided is invalid or has been revoked",
"doc_url": "https://www.cstar.help/developers/errors#invalid_api_key",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "authentication_error",
"code": "insufficient_permissions",
"message": "Your API key does not have permission for this operation",
"doc_url": "https://www.cstar.help/developers/errors#insufficient_permissions",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
} {
"success": false,
"error": {
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Try again in 60 seconds.",
"retryAfter": 60,
"doc_url": "https://www.cstar.help/developers/errors#rate_limit_exceeded",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
}