Coop
API Reference

Automations

Create, update, toggle, test, and inspect automation workflows.

POST /api/v1/automations

Create an automation.

Request

FieldTypeRequiredDescription
namestringYesHuman-readable name
triggerstringYesmessage_received or message_sent
conditionsobject[]NoFilter rules (see below)
actionsobject[]YesActions to execute (see below)
enabledbooleanNoDefault true

Condition object

FieldTypeDescription
fieldstringbody, from, to
operatorstringcontains, equals, starts_with, ends_with, matches_regex, is_in
valuestringValue to match against

Combine with "logic": "and" or "logic": "or".

Action object

FieldTypeDescription
typestringsend_reply, create_contact, call_webhook, log_to_crm
configobjectType-specific configuration

send_reply config: { "body": "reply text" }

call_webhook config: { "url": "https://..." }

Response 201

The created automation object.


GET /api/v1/automations

List automations.


GET /api/v1/automations/:id

Get automation details and recent execution history.


PUT /api/v1/automations/:id

Update an automation. Full replacement — include all fields.


DELETE /api/v1/automations/:id

Delete an automation and its execution history.


PATCH /api/v1/automations/:id/toggle

Toggle enabled/disabled state.


POST /api/v1/automations/:id/test

Dry-run the automation with sample data.

Request

FieldTypeRequiredDescription
messageobjectYesSample message with from, body, etc.

Response 200

{
  "matched": true,
  "conditionsEvaluated": [
    { "field": "body", "operator": "contains", "value": "appointment", "matched": true }
  ],
  "actionsWouldExecute": ["send_reply", "call_webhook"]
}

GET /api/v1/automations/:id/executions

Paginated list of past execution logs.

On this page