API Reference v1.0

Enroll Contact in Drip Journey

Enroll a contact into a published Automations (drip) journey. The contact is created automatically if it doesn't already exist, and enrollment starts the journey from its entry node.

POST https://whatsbizapi.com/api/wpbox/drip/{journey}/enroll

Enrolls a contact—creating it first if needed—into the drip journey identified by {journey} in the URL. The journey must be published; enrollment requests against a draft or unpublished journey are rejected.

Journey ID, not slug: {journey} is the numeric ID of the drip journey, the same ID shown in the Automations builder URL (/automations/{id}/edit). It must belong to the same company that owns the API token used to authenticate.

URL Parameters

Parameter Type Description
journey required integer The ID of the drip journey to enroll the contact into.

Body Parameters

Parameter Type Description
token required string Your API authentication token. Found in your dashboard under Settings → API.
phone required string Contact phone number. Non-digit characters are stripped automatically. If a contact with this phone number already exists on your account, it is reused; otherwise a new contact is created.
name optional string Contact name. Used when creating a new contact, or to update the name of an existing contact if it differs. When omitted for a new contact, the phone number is used as the name.
fields optional array Additional custom fields to associate with the contact on creation.

Example Request

cURL
curl -X POST https://whatsbizapi.com/api/wpbox/drip/123/enroll \ -H "Content-Type: application/json" \ -d '{ "token": "YOUR_API_TOKEN", "phone": "919876543210", "name": "Rahul Sharma" }'

Example Response

Response 200
{ "success": true, "enrollment_id": 456, "status": "active" }

Idempotent while active: If the contact already has an active, waiting, or paused enrollment in this journey, that existing enrollment is returned instead of creating a duplicate — status reflects the enrollment's current state, not necessarily active.

Response Fields

Field Type Description
success boolean true when the contact was enrolled (or already had a matching active enrollment).
enrollment_id integer ID of the drip enrollment record.
status string Enrollment status: active, waiting, or paused.

Error Responses

Error Response 401
{ "success": false, "message": "Invalid token" }
Error Response 404
{ "success": false, "message": "Company not found" }
Error Response 404
{ "success": false, "message": "Journey not found" }
Error Response 422
{ "success": false, "message": "Not enrolled (journey not published or contact opted out)" }

Notes

Journey must be published: Draft journeys cannot receive enrollments. Publish the journey from the Automations builder first.

Opt-out respected: If the contact's phone number has opted out of messaging for your account, the enrollment request is rejected with a 422.

Asynchronous processing: Enrollment starts the journey at its entry node and queues the first step for background processing — the enrolled contact will not necessarily receive a message the instant this call returns.