Skip to main content

API: Add Record to Workflow

To add a record to a workflow, send a POST request to https://system.2xsolutions.ai/api/call/. The scheduler of the workflow will attempt to call the record as soon as possible. The payload should be…

NCOL Support
Updated by NCOL Support

To add a record to a workflow, send a POST request to https://system.2xsolutions.ai/api/call/. The scheduler of the workflow will attempt to call the record as soon as possible.

The payload should be sent as follows:

{
"api_key": "...",
"workflow_key": "A1B2C3",
"record_phone_number": "9876543210",
"record_first_name": "John",
"record_last_name": "Doe",
"record_zip_code": "12345",
"transfer_number": "5556667777",
"placeholders": {
"car_color": "blue",
"car_model": "corolla"
},
"meta": {
"campaign": "fall2024"
}
}

The workflow_key can be found in the details section of the workflow. placeholdersmetarecord_last_nametransfer_number and record_zip_code are optional fields. All other fields are required.

record_phone_number and transfer_number fields should be exactly 10 digits long. Do not include the "+1" country code.

The transfer_number field allows you to set a specific transfer number per record. This is optional and, if not set, will use the workflow or company-level transfer number.

Metafields

If you have identifiers that you need to pass through to your CRM via the post call webhook, you can use metafields. These values can be passed in whatever object structure you like via the meta key.

Placeholders

If your script will use placeholders to dynamically swap in data value for each record, you will need to supply the placeholder values in your API call.

Important: Record Cannot Be Added in All Capital Letters

Please ensure that the record is formatted in proper case (e.g., "John Doe") rather than all capital letters (e.g., "JOHN DOE"). Adding records in all caps can cause issues with system processing.

Multiple Records

You can also add multiple records in one call using the bulk version of this API route. The URL is https://system.2xsolutions.ai/api/bulk-call/. The payload takes an array of records:

{
"api_key": "...",
"workflow_key": "A1B2C3",
"records": [
{
"record_phone_number": "9876543210",
"placeholders": {
"car_color": "green",
},
"record_first_name": "Ben",
"record_last_name": "Jones",
},
{
"record_phone_number": "9876543211",
"transfer_number": "5556667777",
"placeholders": {
"car_color": "red",
},
"record_first_name": "Sally",
"record_last_name": "Smith",
},
...
]
}

If there are errors, the system will upload whatever records are valid and return errors for any invalid records. For example:

{
"message": "Successfully imported 98 records. Failed to import 2 records.",
"errors": [
{
"index": 1,
"error": "Record 2 is missing required placeholder field \"car\"."
},
{
"index”: 5,
"error": "Record 6 is missing required placeholder field \"car\"."
}
]
}

The index field refers to the position of the record in the array that was posted.

There is currently a limit of 1,000 records per call.

How did we do?

API: Mark Record as Complete

Contact