Sari la conținut

Automatizări

Regulile „când X, fă Y”: trigger_key (client.created, appointment.cancelled, invoice.issued, subscription.payment_failed, subscription.cancelled, invoice.overdue, quote.unanswered, contract.expiring, client.inactive, campaign.clicked, contact.unsubscribed, event.registered, event.payment_abandoned, event.attended, event.absent, review.received, stock.low, asset.deadline_due, course.abandoned, stamp.reward_earned, stamp.reward_expiring, points.earned, points.idle), trigger_days, conditions (match all sau any, rules: field, op, value), steps (notify, email, task, wait, client_message, chat, webhook, bonus_points), dry_run, daily_limit, is_active. O regulă salvată cu cheia API rulează cu scope-urile cheii. Acțiuni: activate, deactivate, apply_existing.

Modul: Automatizări (automations).

  • GET /api/v1/automations - Listare cu filtre, sortare și paginare (scope automations:read)
  • GET /api/v1/automations/{id} - O înregistrare după id (scope automations:read)
  • POST /api/v1/automations - Creează o înregistrare (scope automations:write)
  • PATCH /api/v1/automations/{id} - Modifică câmpurile trimise (scope automations:write)
  • DELETE /api/v1/automations/{id} - Șterge sau dezactivează (scope automations:write)
  • POST /api/v1/automations/{id}/activate - Pornește regula (de acum înainte) (scope automations:write)
  • POST /api/v1/automations/{id}/deactivate - Oprește regula (scope automations:write)
  • POST /api/v1/automations/{id}/apply_existing - Aplică regula pe zile și pe înregistrările de dinainte de pornire (scope automations:write)
  • id (string, uuid; citire): Identificator unic (UUID).
  • name (string; scriere, obligatoriu)
  • is_active (boolean; citire): Dacă înregistrarea este activă.
  • trigger_key (string; scriere, obligatoriu)
  • trigger_table (string; citire)
  • conditions (string; scriere)
  • steps (string; scriere)
  • daily_limit (number; scriere)
  • trigger_days (number; scriere)
  • dry_run (boolean; scriere)
  • time_floor (string, date; citire)
  • activated_at (string, date-time; citire)
  • saved_by (string; citire)
  • disabled_reason (string; citire)
  • version (integer; citire)
  • created_at (string, date-time; citire): Data creării (ISO 8601).
  • updated_at (string, date-time; citire): Data ultimei modificări (ISO 8601).