Skip to main content

Automations

Automation rules that trigger actions when specific events occur. Rules have conditions, actions, and can be tested with dry runs.

The Automation object

id string

Rule ID

name string

Rule name

triggerEvent string

Event that triggers this rule

conditions object

Conditions that must match (all/any)

actions array

Actions to execute when triggered

enabled boolean

Whether the rule is active

executionCount integer

Total times this rule has fired

Endpoints

GET /api/v1/teams/{teamId}/automations

List Automations

List all automation rules.

Code Examples

bash
curl -X GET "https://www.cstar.help/api/v1/teams/{teamId}/automations" \
  -H "Authorization: Bearer sk_live_your_key"

Responses

200 Automation rules
json
{
  "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
json
{
  "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
json
{
  "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
json
{
  "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

Create Automation

Create a new automation rule.

Request Body

name string required

Rule name

triggerEvent string required

Trigger event

conditions object

Match conditions

actions array

Actions to execute

enabled boolean

Enable immediately

Default: true

Code Examples

bash
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":"is","value":"urgent"}]},"actions":[{"type":"assign_to","memberId":"550e8400-e29b-41d4-a716-446655440001"}]}'

Responses

201 Rule created
json
{
  "success": true,
  "data": {
    "id": "rule_abc",
    "name": "Auto-assign urgent",
    "triggerEvent": "ticket.created",
    "enabled": true
  }
}

401 Authentication failed: missing or invalid API key
json
{
  "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
json
{
  "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
json
{
  "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}/test

Test Automation (Dry Run)

Dry-run a rule against a specific resource to preview its actions without executing them.

Path Parameters

ruleId string required

Rule ID

Request Body

resourceType string required

Resource type to test against

resourceId string required

Resource ID to test against

Code Examples

bash
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
json
{
  "success": true,
  "data": {
    "wouldMatch": true,
    "conditionResults": {
      "all": [
        {
          "field": "priority",
          "passed": true
        }
      ]
    },
    "actionsWouldExecute": [
      {
        "action": "assign",
        "success": true
      }
    ]
  }
}

401 Authentication failed: missing or invalid API key
json
{
  "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
json
{
  "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
json
{
  "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"
  }
}