Panduan pembalasan.id
Automation Rule

Add a new automation rule

POST
/api/v1/accounts/{account_id}/automation_rules

Add a new automation rule to account

Authorization

userApiKey
api_access_token<token>

This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels. This token can be saved by an external system when user is created via API, to perform activities on behalf of the user.

In: header

Path Parameters

account_id*integer

The numeric ID of the account

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/api/v1/accounts/0/automation_rules" \  -H "Content-Type: application/json" \  -d '{}'
{
  "payload": [
    {
      "id": 0,
      "account_id": 0,
      "name": "Add label on message create event",
      "description": "Add label support and sales on message create event if incoming message content contains text help",
      "event_name": "message_created",
      "conditions": [
        {
          "attribute_key": "content",
          "filter_operator": "contains",
          "values": [
            "help"
          ],
          "query_operator": "and"
        }
      ],
      "actions": [
        {
          "action_name": "add_label",
          "action_params": [
            "support",
            "sales"
          ]
        }
      ],
      "created_on": 0,
      "active": true
    }
  ]
}
{
  "description": "string",
  "errors": [
    {
      "field": "string",
      "message": "string",
      "code": "string"
    }
  ]
}