POST
/
v1
/
automation
/
rules
Create automation rule
curl --request POST \
  --url https://api.wazapin.com/v1/automation/rules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "actions": [
    {
      "type": "<string>",
      "agent_id": "<string>",
      "fixed_agent_id": "<string>",
      "label": "<string>",
      "label_id": "<string>",
      "strategy": "<string>"
    }
  ],
  "name": "<string>",
  "trigger": {
    "event": "<string>",
    "events": [
      "<string>"
    ]
  },
  "enabled": true,
  "scope": {
    "channel_type": "<string>",
    "conversation_id": "<string>"
  }
}
'
{
  "data": {
    "actions": [
      {
        "type": "<string>",
        "agent_id": "<string>",
        "fixed_agent_id": "<string>",
        "label": "<string>",
        "label_id": "<string>",
        "strategy": "<string>"
      }
    ],
    "created_at": "<string>",
    "created_by": "<string>",
    "enabled": true,
    "id": "<string>",
    "name": "<string>",
    "organization_id": "<string>",
    "scope": {
      "channel_type": "<string>",
      "conversation_id": "<string>"
    },
    "trigger": {
      "event": "<string>",
      "events": [
        "<string>"
      ]
    }
  }
}

Authorizations

Authorization
string
header
required

Session token or API key

Body

application/json
actions
object[] | null
required

Ordered action list

name
string
required

Rule name

Minimum string length: 1
trigger
object
required

Automation trigger configuration

enabled
boolean

Whether this rule is active (defaults to true)

scope
object

Optional organization-local rule scope

Response

OK

data
object
required