Run an automation from a conversation

Start an automation execution with conversation, contact, and recent messages as initial_payload, matching the “Run automation” action in the message composer.

Endpoint

POST
/automations-executions

Prerequisite — load context like the app

  1. GET /conversations/:id with query: { organization_id }
  2. GET /contacts/:contactId if the conversation has contact_id
  3. GET /conversation-messages-{channel} with:
json

Reverse the data array chronologically when building the payload (the app does this before create).

Request

FieldTypeDescription
automation_idNumberAutomation to run.
organization_idNumberOrganization scope.
conversation_idNumberConversation thread id.
initial_payloadObjectAt minimum includes conversation, contact (nullable), and messages as built above.

Response

Returns the created execution record (exact fields depend on server configuration). The app shows a success toast and closes the picker.

Notes

  • Unsupported channels: the UI only enables this when a conversation-messages-{channel} service exists for the conversation’s channel.
  • Keep $limit at 50 when loading messages for the payload.

Report an issue with this documentation

Please log in to report issues with our documentation.