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
GET
/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
200 Automation rules
{
"success": true,
"data": [
{
"id": "rule_abc",
"name": "Auto-assign urgent",
"triggerEvent": "ticket.created",
"enabled": true,
"executionCount": 234
}
]
}401 Authentication failed — missing or invalid API key
{
"success": false,
"error": {
"type": "authentication_error",
"code": "authentication_required",
"message": "Invalid or expired API key",
"doc_url": "https://www.cstar.help/developers/api-reference#authentication",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
}403 Insufficient permissions — wrong key type or team access
{
"success": false,
"error": {
"type": "authorization_error",
"code": "insufficient_permissions",
"message": "Secret key required for this endpoint",
"doc_url": "https://www.cstar.help/developers/api-reference#authentication",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
}429 Rate limit exceeded
{
"success": false,
"error": {
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Try again in 60 seconds",
"doc_url": "https://www.cstar.help/developers/api-reference#rate-limiting",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
}POST
/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 urgent","triggerEvent":"ticket.created","conditions":{"all":[{"field":"priority","operator":"equals","value":"urgent"}]},"actions":[{"type":"assign","agentId":"usr_abc"}]}'Responses
201 Rule created
{
"success": true,
"data": {
"id": "rule_abc",
"name": "Auto-assign urgent",
"triggerEvent": "ticket.created",
"enabled": true
}
}401 Authentication failed — missing or invalid API key
{
"success": false,
"error": {
"type": "authentication_error",
"code": "authentication_required",
"message": "Invalid or expired API key",
"doc_url": "https://www.cstar.help/developers/api-reference#authentication",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
}403 Insufficient permissions — wrong key type or team access
{
"success": false,
"error": {
"type": "authorization_error",
"code": "insufficient_permissions",
"message": "Secret key required for this endpoint",
"doc_url": "https://www.cstar.help/developers/api-reference#authentication",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
}429 Rate limit exceeded
{
"success": false,
"error": {
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Try again in 60 seconds",
"doc_url": "https://www.cstar.help/developers/api-reference#rate-limiting",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
}POST
/api/v1/teams/{teamId}/automations/{ruleId}/testTest Automation (Dry Run)
Dry-run a rule against a specific resource. No actions are executed — just shows what would happen.
Path Parameters
ruleId string requiredRule ID
Request Body
resourceType string requiredResource type to test against
resourceId string requiredResource ID to test against
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
200 Test result
{
"success": true,
"data": {
"wouldMatch": true,
"conditionResults": {
"all": [
{
"field": "priority",
"passed": true
}
]
},
"actionsWouldExecute": [
{
"action": "assign",
"success": true
}
]
}
}401 Authentication failed — missing or invalid API key
{
"success": false,
"error": {
"type": "authentication_error",
"code": "authentication_required",
"message": "Invalid or expired API key",
"doc_url": "https://www.cstar.help/developers/api-reference#authentication",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
}403 Insufficient permissions — wrong key type or team access
{
"success": false,
"error": {
"type": "authorization_error",
"code": "insufficient_permissions",
"message": "Secret key required for this endpoint",
"doc_url": "https://www.cstar.help/developers/api-reference#authentication",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
}429 Rate limit exceeded
{
"success": false,
"error": {
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Try again in 60 seconds",
"doc_url": "https://www.cstar.help/developers/api-reference#rate-limiting",
"request_id": "req_abc123"
},
"meta": {
"timestamp": "2025-12-10T14:30:00Z"
}
}