Skip to main content
POST
/
api
/
ingest
/
sendflow
/
v1
/
{sendflow_id}
/
trigger
Trigger Sendflow
curl --request POST \
  --url https://api-ai.zixflow.com/api/ingest/sendflow/v1/{sendflow_id}/trigger \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <x-api-key>' \
  --header 'x-workspace-id: <x-workspace-id>' \
  --data '
{
  "recipients": {
    "phone": "<string>",
    "email": "<string>"
  },
  "variables": {}
}
'
import requests

url = "https://api-ai.zixflow.com/api/ingest/sendflow/v1/{sendflow_id}/trigger"

payload = {
    "recipients": {
        "phone": "<string>",
        "email": "<string>"
    },
    "variables": {}
}
headers = {
    "x-api-key": "<x-api-key>",
    "x-workspace-id": "<x-workspace-id>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {
    'x-api-key': '<x-api-key>',
    'x-workspace-id': '<x-workspace-id>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({recipients: {phone: '<string>', email: '<string>'}, variables: {}})
};

fetch('https://api-ai.zixflow.com/api/ingest/sendflow/v1/{sendflow_id}/trigger', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api-ai.zixflow.com/api/ingest/sendflow/v1/{sendflow_id}/trigger",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'recipients' => [
        'phone' => '<string>',
        'email' => '<string>'
    ],
    'variables' => [
        
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "x-api-key: <x-api-key>",
    "x-workspace-id: <x-workspace-id>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api-ai.zixflow.com/api/ingest/sendflow/v1/{sendflow_id}/trigger"

	payload := strings.NewReader("{\n  \"recipients\": {\n    \"phone\": \"<string>\",\n    \"email\": \"<string>\"\n  },\n  \"variables\": {}\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<x-api-key>")
	req.Header.Add("x-workspace-id", "<x-workspace-id>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api-ai.zixflow.com/api/ingest/sendflow/v1/{sendflow_id}/trigger")
  .header("x-api-key", "<x-api-key>")
  .header("x-workspace-id", "<x-workspace-id>")
  .header("Content-Type", "application/json")
  .body("{\n  \"recipients\": {\n    \"phone\": \"<string>\",\n    \"email\": \"<string>\"\n  },\n  \"variables\": {}\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api-ai.zixflow.com/api/ingest/sendflow/v1/{sendflow_id}/trigger")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["x-workspace-id"] = '<x-workspace-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"recipients\": {\n    \"phone\": \"<string>\",\n    \"email\": \"<string>\"\n  },\n  \"variables\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "message": "Sendflow triggered successfully",
  "request_id": "req_1234567890"
}
{
  "success": false,
  "message": "Invalid sendflow_id"
}

Description

This endpoint allows you to trigger a Sendflow automation workflow. You can pass recipient information (phone and email) and custom variables to the workflow, and optionally run it in draft mode for testing.

Headers

x-api-key
string
required
Your API key for authentication.
x-workspace-id
string
required
Your workspace ID for authentication.

Path Parameters

sendflow_id
string
required
The unique identifier of the Sendflow workflow to trigger.

Query Parameters

is_draft
boolean
Whether to run the workflow in draft mode. Default: false. Use true for testing workflows.

Body

recipients
object
required
Recipient information for the workflow. Contains fixed phone and email fields.
variables
object
Key-value pairs for template variables. Keys should match the variable names in your Sendflow workflow, and values will replace the placeholders.

Request Example

{
  "recipients": {
    "phone": "919876543210",
    "email": "demo@example.com"
  },
  "variables": {
    "name": "sam"
  }
}

Response

success
boolean
Indicates whether the call was successful. true if successful, false if not.
message
string
Success or error response message.
request_id
string
The unique identifier for this workflow execution request. Use this ID to stop the workflow if needed.
{
  "success": true,
  "message": "Sendflow triggered successfully",
  "request_id": "req_1234567890"
}
{
  "success": false,
  "message": "Invalid sendflow_id"
}