Documentation

DocsAPI ReferenceEnrollments API

Enrollments API

GET/v1/enrollments

List enrollments.

TypeScript
const enrollments = await client.listEnrollments();
curl
curl https://api.outreachagent.dev/v1/enrollments \
  -H "Authorization: Bearer $OUTREACHAGENT_API_KEY"
POST/v1/enrollments

Enroll a contact in a workflow. Supports Idempotency-Key header.

ParameterTypeRequiredDescription
workflowIdstringYesTarget workflow ID
contactIdstringYesContact to enroll
variablesobjectNoPer-enrollment template variable overrides. Available in templates as {{ vars.<key> }}
TypeScript
const enrollment = await client.createEnrollment({
  workflowId: "wf_abc",
  contactId: "con_xyz",
  variables: { hook: "your Series A announcement", offer: "15% discount" }
});
curl
curl -X POST https://api.outreachagent.dev/v1/enrollments \
  -H "Authorization: Bearer $OUTREACHAGENT_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: enroll-con_xyz-wf_abc" \
  -d '{"workflowId": "wf_abc", "contactId": "con_xyz", "variables": {"hook": "your Series A announcement"}}'
GET/v1/enrollments/:enrollmentId

Get enrollment status and current node.

TypeScript
const enrollment = await client.getEnrollment("enr_abc");
console.log(enrollment.status);        // "active"
console.log(enrollment.currentNodeId); // "n2"
curl
curl https://api.outreachagent.dev/v1/enrollments/enr_abc \
  -H "Authorization: Bearer $OUTREACHAGENT_API_KEY"
POST/v1/enrollments/bulk

Enroll up to 100 contacts at once. Returns per-contact results.

ParameterTypeRequiredDescription
workflowIdstringYesTarget workflow ID
contactIdsstring[]YesArray of contact IDs (max 100)
TypeScript
const result = await client.bulkEnroll("wf_abc", [
  "con_1", "con_2", "con_3"
]);
// result.results = [
//   { contactId: "con_1", enrollmentId: "enr_1", status: "enrolled" },
//   { contactId: "con_2", status: "skipped", reason: "already enrolled" },
//   ...
// ]
curl
curl -X POST https://api.outreachagent.dev/v1/enrollments/bulk \
  -H "Authorization: Bearer $OUTREACHAGENT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"workflowId": "wf_abc", "contactIds": ["con_1", "con_2", "con_3"]}'
GET/v1/enrollments/:enrollmentId/logs

Get execution logs for each workflow step.

TypeScript
const logs = await client.listEnrollmentLogs("enr_abc");
// logs = [{ nodeId: "n1", status: "completed", message: "Email sent" }, ...]
curl
curl https://api.outreachagent.dev/v1/enrollments/enr_abc/logs \
  -H "Authorization: Bearer $OUTREACHAGENT_API_KEY"