Automation
A rule has a trigger, optional conditions, and actions. Create and run rules on https://api.athenous.io with the signed-in session. Run counts are on the public API. The terminal commands are on CLI.
Where it lives
Rule paths are on the app host. Send the session cookie athenous_token. public-api.athenous.io does not route them, so X-Api-Key cannot create, list, enable, or trigger a rule. An API key can read run counts. Those two public paths are on Analytics.
| Call | Path |
|---|---|
| List | GET /api/v1/automation/rules |
| Create | POST /api/v1/automation/rules |
| Get | GET /api/v1/automation/rules/{id} |
| Update | PUT /api/v1/automation/rules/{id} |
| Enable / disable | PATCH …/enable and PATCH …/disable |
| Run now | POST /api/v1/automation/rules/{id}/trigger |
| Dry run | POST /api/v1/automation/rules/{id}/test |
| Runs | GET /api/v1/automation/rules/{id}/runs |
| What this engine runs | GET /api/v1/automation/capabilities |
List filters are enabled, triggerType, tag, and q. Page size defaults to 20 and is capped at 1000. Triggers are MANUAL, SCHEDULE, EVENT, METRIC_THRESHOLD, CAMPAIGN_STATUS, and CONNECTOR_HEALTH.
Create a rule
name is required. actions is a JSON string, not a nested array. A new rule stays disabled until you enable it. triggerConfig is a cron expression for SCHEDULE, such as 0 9 * * *.
curl -sS -X POST "https://api.athenous.io/api/v1/automation/rules" \
-H "Content-Type: application/json" \
--cookie "athenous_token=$ATHENOUS_TOKEN" \
-d '{
"name": "Daily note",
"description": "In-app note when someone runs this rule",
"triggerType": "MANUAL",
"actions": "[{\"type\":\"notify\",\"title\":\"Daily note\",\"message\":\"Rule ran\"}]"
}'
Enable it with PATCH /api/v1/automation/rules/RULE_ID/enable. Clone makes a disabled copy at POST /api/v1/automation/rules/{id}/clone.
Run and inspect
POST /api/v1/automation/rules/{id}/trigger runs the actions now. Add ?confirmed=true when the rule’s guardConfig sets confirmDestructive. POST …/test evaluates conditions and does not perform the actions. GET …/runs?limit=20 lists recent runs. GET …/preview is a text summary of the trigger, conditions, and actions.
curl -sS -X POST "https://api.athenous.io/api/v1/automation/rules/RULE_ID/trigger" \
--cookie "athenous_token=$ATHENOUS_TOKEN"
curl -sS "https://api.athenous.io/api/v1/automation/rules/RULE_ID/runs?limit=20" \
--cookie "athenous_token=$ATHENOUS_TOKEN"
Bulk
Turn many rules on or off with PATCH /api/v1/automation/rules/bulk/enabled and {"ruleIds":["…"],"enabled":true}. The body returns updated and skipped. Delete many with POST /api/v1/automation/rules/bulk/delete and {"ruleIds":["…"]}. The body returns deleted and skipped.
Paid plans. CSV import creates up to 500 rules. Download the header row, then post the file as Content-Type: text/csv. Each row needs a name. The response is 201 and createdRules.
curl -sS "https://api.athenous.io/api/v1/automation/rules/csv/template" \
-H "Accept: text/csv" --cookie "athenous_token=$ATHENOUS_TOKEN" -o rules-template.csv
curl -sS -X POST "https://api.athenous.io/api/v1/automation/rules/csv/import" \
-H "Content-Type: text/csv" --cookie "athenous_token=$ATHENOUS_TOKEN" \
--data-binary @rules.csv
Columns are name, description, trigger_type, trigger_config, conditions, actions, enabled, priority, severity, guard_config, tags, timezone, retry_max, retry_backoff_seconds, event_type, target_resource_type. Export is GET /api/v1/automation/rules/csv/export. Campaign bulk is on Ads. Post bulk is on Posts.
Actions
GET /api/v1/automation/capabilities lists the triggers and actions this environment runs. Live actions include notify, webhook (url required), slack_notify (webhookUrl required), log, update_campaign, create_note, and delay (capped at 5 seconds). create_post, run_script, and crm_sync are listed as planned and are not executed.
Run counts
These two calls accept X-Api-Key on https://public-api.athenous.io. days defaults to 7 and is capped at 90. Any key with api can read them, including a key limited to Posts or Ads.
curl -sS "https://public-api.athenous.io/api/v1/automation/analytics/summary?days=7" \
-H "X-Api-Key: $ATHENOUS_API_KEY"
curl -sS "https://public-api.athenous.io/api/v1/automation/rules/RULE_ID/analytics?days=30" \
-H "X-Api-Key: $ATHENOUS_API_KEY"
Field names are on Analytics.