CRM automation

Создать правило автоматизации

Changed on

Правила «когда → если → то» живут в общем движке кабинета (/api/platform/automation/rules, «Настройки → Автоматизации»): новое правило CRM не заводится — 409 crm.automation_adopted.

post/api/v1/crm/automation/rules

Request

  • Base URL
    https://erp.akeda.ru
  • Auth
    • HTTP bearer
    • or OAuth 2
      Authorization codehttps://erp.akeda.ru/oauth2/authorize
      Token URLhttps://erp.akeda.ru/oauth2/token
      Scopesakeda:delegate

Headers

X-Tenant, string required

Slug выбранного кабинета; кабинет не является юрлицом

Request body

CRMAutomationRuleInput required
name, string required
event_type, 'lead.created' | 'lead.qualified' | 'deal.created' | 'deal.stage_changed' | 'inbox.message_received' required
conditions, object nullable
actions, CRMAutomationAction[] required
is_enabled, boolean

Response

Созданное правило

CRMAutomationRule required
id, string uuid required
name, string required
event_type, 'lead.created' | 'lead.qualified' | 'deal.created' | 'deal.stage_changed' | 'inbox.message_received' required
conditions, object nullable required

Допустимые ключи - status, stage_id, owner_id

actions, CRMAutomationAction[] nullable required
is_enabled, boolean required
created_by, integer required
created_at, string date-time required
updated_at, string date-time required
adopted_at, string date-time

Правило перенесено на общий движок: события после этого момента исполняет правило adopted_rule_id; здесь оно не правится (409)

adopted_rule_id, string uuid
adoption_problem, object

Почему правило осталось в CRM: общий движок его не принял. Перенос идёт сам, правило с исправленным условием переедет при следующем проходе

Changes

    • info

      added the optional property field to the response with the status

    • info

      added the optional property field to the response with the status

    • info

      added the optional property field to the response with the status

    5 more changes in this revision