Logo

Flows

How to trigger Quotient flows from your application

Overview

Programmatic flows let you trigger automated sequences from your application code. Set a flow's trigger type to PROGRAMMATIC in the Quotient UI, then call the trigger endpoint with a person ID.

EndpointAPI KeyServer SDKClient SDK
Trigger flowpublic or privateflow.trigger()flow.trigger()

Programmatic Flow

Trigger a Flow

flow.trigger(options)

POST /api/v0/flow/{flowId}/trigger

Auth: public or private key · scope: FLOW_TRIGGER

ParamTypeRequiredDescription
flowIdstringYesThe flow ID to trigger
personIdstringYesThe person to enroll in the flow
await client.flow.trigger({
  flowId: "YOUR-FLOW-ID",
  personId: "PERSON-FOR-FLOW",
});

Returns:

{
  success: boolean;
}

Server Side

import { QuotientServer } from "@quotientjs/server";

const client = new QuotientServer({ privateKey: "sk_..." });

await client.flow.trigger({
  flowId: "YOUR-FLOW-ID",
  personId: "PERSON-FOR-FLOW",
});

Client Side

import { QuotientClient } from "@quotientjs/client";

const client = await QuotientClient.init({ apiKey: "pk_..." });

await client.flow.trigger({
  flowId: "YOUR-FLOW-ID",
  personId: "PERSON-FOR-FLOW",
});

Next Steps