Test A Flow
Endpoint:POST /api/v1/automations/:id/test
Runs the flow once, synchronously, and returns the finished execution. It uses the draft if there is one, otherwise the published version, so you can test changes before publishing them.
A test skips the trigger entirely: keywords, payloads, senderExternalIds, the delay and the loop brake are not applied. It goes straight to the steps (conditions still run). Use it to check what the steps do, and a real comment or DM to check what triggers them.
- DM and click flows:
conversationIdof a real conversation in the team (plustextorpayloadif your conditions look at them), - comment flows:
fetchedCommentIdof a real comment (from the Comments API), - flows with
SENDER_IDconditions: pass the sender’s ID ininputyourself, a test doesn’t take it from the conversation.
400if the flow has neither a draft nor a published version, or its definition doesn’t pass validation (for example missing permissions),404if the flow, conversation or comment isn’t found in the flow’s team,403if the account’s monthly run budget is used up,429if the platform is rate-limiting the account right now (try again shortly).
200 with the execution, even when it didn’t go well: check its status and error. In the execution, input.type is MANUAL_TEST.
Executions
Every run is logged as an execution. This is where you answer “why didn’t my automation reply?”. Logs are kept for 30 days after the run. Endpoints:GET /api/v1/automations/:id/executions?teamId=team_123- runs of one flow, newest firstGET /api/v1/automation-executions/:id- one run, with every step
status, platform, socialAccountId, conversationId, fetchedCommentId, flowVersionId, triggerId. Paginate with limit (max 500) and either offset or cursor (pass back nextCursor), same as conversations.
flow, flowVersion, conversation, conversationMessage, fetchedComment and socialAccount objects, so you rarely need a second request.
Execution Status
Each step has its own status:
PENDING, RUNNING, COMPLETED, FAILED or SKIPPED.
Error Codes Worth Knowing
Failed steps carry a readable
message. Some come from the platform (for example, Meta rejecting a message), others from our own checks before sending (for example, a Facebook private reply to a comment older than 7 days, messaging not enabled for the account, or the monthly message limit).