Skip to main content
POST
Assign to Workflow
Puts one phone number into a workflow from your own system, such as a CRM, a website form or your backend. It does the same as assigning a contact from the CRM, and can save details on the contact first so every step of the workflow can use them.

Quick Example

Use Cases

  • New leads: start a follow-up workflow the moment a form is submitted or a lead is created in your CRM
  • Lifecycle events: put a customer into a renewal, payment-reminder or onboarding workflow when it happens in your system
  • Scheduled outreach: pass schedule_at to start the workflow at a set time, such as the morning after a sign-up

Where to find the values

What happens on your account

1

The workflow is checked

The workflow must belong to the account the API key is for, and must have at least one step. A key from another account gets 404, the same answer as a workflow that does not exist.
2

The contact is saved

The number becomes a contact in your CRM if it is not one already, and the attributes you sent are saved on it.
3

The run starts

The number enters the workflow at Start, now or at schedule_at. Every step can read the saved attributes: as Contact values in conditions, in {{variables}}, and in a Send Call step’s call metadata.
The run then appears with the workflow’s other runs, as described in Enroll and Monitor.

How attributes are saved

Each row in attributes is a key, a value and an optional replace.
  • Matching names: key is matched to your CRM attributes ignoring case, spaces, underscores and hyphens, so "First Name" matches first_name.
  • replace: true overwrites a value the contact already has.
  • replace: false (the default) only fills an attribute that is empty. An existing value is kept.
  • Types: the value is checked against the attribute’s type. A number attribute needs a number, a date needs a date, and an enum value must be one of its options.
  • Edits made by hand win: a value someone typed into the CRM is never overwritten through the API, even with replace: true.
Only attributes that already exist in CRM → Attributes are saved. A key with no matching attribute is not created; it is listed under ignored in the response. Create the attribute first.
The response reports what happened to every row, so a typo does not go unnoticed:

Scheduling

schedule_at is a date and time in IST, written as YYYY-MM-DDTHH:mm:ss with two digits for the month and day: 2026-12-31T09:30:00, not 2026-12-31T9:30 or 2026-12-3T09:30:00. Leave it out to start now. A time that has already passed also starts now.

Errors worth handling

The workflow ID is wrong, or the API key belongs to a different account from the workflow. Check both.
The number is partway through this workflow already, so it is not started a second time. The attributes you sent are still saved. The number can be assigned again once its current run has finished.
Add steps to the workflow and save it, or use a different workflow. Older AI workflows cannot take contacts through this endpoint.
The date is not in the expected shape. Use two digits for every part and a T between the date and the time.
Do not retry a 400, 404 or 409: the same request will get the same answer. Only 5xx responses are worth retrying, and a retry can start the run if the first attempt had not.

Authorizations

X-API-KEY
string
header
required

Body

application/json
to_number
string
required

Phone number with country code. A leading + is optional.

Example:

"+919876543210"

workflow_id
string
required

ID of a normal workflow, from the end of its URL when you open it in the dashboard.

Example:

"6ab6243266ba77dbaf2276c7"

attributes
object[]

Values to save on the contact before the run starts.

Maximum array length: 50
schedule_at
string

When the run should start, as YYYY-MM-DDTHH:mm:ss in IST (Asia/Kolkata). Omit it, or pass a time that has passed, to start now.

Example:

"2026-12-31T09:30:00"

Response

Run started or scheduled

status
string
Example:

"done"

message
string
Example:

"Workflow started"

run_id
string

ID of the run that was started

enrollment_id
string

ID shared by every run started in this request

attributes
object

What happened to each attribute you sent. Also returned on 409 and 500 responses, since the contact is saved before the run starts.