journeys.trigger when your backend needs to start one active API-entry Journey for one Profile. Every trigger request requires an Idempotency-Key.
Use journeyRuns.retrieve to poll the returned run handle.
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Trigger saved API-entry journeys by stable developer key.
journeys.trigger when your backend needs to start one active API-entry Journey for one Profile. Every trigger request requires an Idempotency-Key.
Use journeyRuns.retrieve to poll the returned run handle.
import Segmentflow from "@segmentflow/segmentflow-typescript";
const client = new Segmentflow({ apiKey: process.env.SEGMENTFLOW_API_KEY });
const run = await client.v1.journeys.trigger(
"receipt-flow",
{
profile: {
email: "buyer@example.com",
externalId: "customer-123",
},
variables: {
orderId: "ord_123",
},
},
{ idempotencyKey: "receipt:ord_123" },
);
const status = await client.v1.journeyRuns.retrieve(run.runId);
