curl --request POST \
--url https://api.clarionhealth.com/v1/sequence-manager/sequences/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sequence_definition_id": 123,
"next_activity_date": "2024-01-15T10:00:00Z",
"rows": [
{
"phoneNumber": "+15551234567",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "1990-01-15"
},
{
"phoneNumber": "+15559876543",
"firstName": "Jane",
"lastName": "Smith",
"dateOfBirth": "1985-06-20"
}
],
"validate_only": false
}
'import requests
url = "https://api.clarionhealth.com/v1/sequence-manager/sequences/batch"
payload = {
"sequence_definition_id": 123,
"next_activity_date": "2024-01-15T10:00:00Z",
"rows": [
{
"phoneNumber": "+15551234567",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "1990-01-15"
},
{
"phoneNumber": "+15559876543",
"firstName": "Jane",
"lastName": "Smith",
"dateOfBirth": "1985-06-20"
}
],
"validate_only": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sequence_definition_id: 123,
next_activity_date: '2024-01-15T10:00:00Z',
rows: [
{
phoneNumber: '+15551234567',
firstName: 'John',
lastName: 'Doe',
dateOfBirth: '1990-01-15'
},
{
phoneNumber: '+15559876543',
firstName: 'Jane',
lastName: 'Smith',
dateOfBirth: '1985-06-20'
}
],
validate_only: false
})
};
fetch('https://api.clarionhealth.com/v1/sequence-manager/sequences/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.clarionhealth.com/v1/sequence-manager/sequences/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sequence_definition_id' => 123,
'next_activity_date' => '2024-01-15T10:00:00Z',
'rows' => [
[
'phoneNumber' => '+15551234567',
'firstName' => 'John',
'lastName' => 'Doe',
'dateOfBirth' => '1990-01-15'
],
[
'phoneNumber' => '+15559876543',
'firstName' => 'Jane',
'lastName' => 'Smith',
'dateOfBirth' => '1985-06-20'
]
],
'validate_only' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.clarionhealth.com/v1/sequence-manager/sequences/batch"
payload := strings.NewReader("{\n \"sequence_definition_id\": 123,\n \"next_activity_date\": \"2024-01-15T10:00:00Z\",\n \"rows\": [\n {\n \"phoneNumber\": \"+15551234567\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"dateOfBirth\": \"1990-01-15\"\n },\n {\n \"phoneNumber\": \"+15559876543\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Smith\",\n \"dateOfBirth\": \"1985-06-20\"\n }\n ],\n \"validate_only\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.clarionhealth.com/v1/sequence-manager/sequences/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sequence_definition_id\": 123,\n \"next_activity_date\": \"2024-01-15T10:00:00Z\",\n \"rows\": [\n {\n \"phoneNumber\": \"+15551234567\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"dateOfBirth\": \"1990-01-15\"\n },\n {\n \"phoneNumber\": \"+15559876543\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Smith\",\n \"dateOfBirth\": \"1985-06-20\"\n }\n ],\n \"validate_only\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.clarionhealth.com/v1/sequence-manager/sequences/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sequence_definition_id\": 123,\n \"next_activity_date\": \"2024-01-15T10:00:00Z\",\n \"rows\": [\n {\n \"phoneNumber\": \"+15551234567\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"dateOfBirth\": \"1990-01-15\"\n },\n {\n \"phoneNumber\": \"+15559876543\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Smith\",\n \"dateOfBirth\": \"1985-06-20\"\n }\n ],\n \"validate_only\": false\n}"
response = http.request(request)
puts response.read_body{
"valid": true,
"total_attempted": 2,
"created_count": 2,
"created": [
{
"rowIndex": 0,
"sequence_id": 100
},
{
"rowIndex": 1,
"sequence_id": 101
}
],
"errors": [],
"warnings": []
}Batch Upload Sequences
Create multiple sequences from an array of patient data rows. Maximum 100 rows per request.
curl --request POST \
--url https://api.clarionhealth.com/v1/sequence-manager/sequences/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"sequence_definition_id": 123,
"next_activity_date": "2024-01-15T10:00:00Z",
"rows": [
{
"phoneNumber": "+15551234567",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "1990-01-15"
},
{
"phoneNumber": "+15559876543",
"firstName": "Jane",
"lastName": "Smith",
"dateOfBirth": "1985-06-20"
}
],
"validate_only": false
}
'import requests
url = "https://api.clarionhealth.com/v1/sequence-manager/sequences/batch"
payload = {
"sequence_definition_id": 123,
"next_activity_date": "2024-01-15T10:00:00Z",
"rows": [
{
"phoneNumber": "+15551234567",
"firstName": "John",
"lastName": "Doe",
"dateOfBirth": "1990-01-15"
},
{
"phoneNumber": "+15559876543",
"firstName": "Jane",
"lastName": "Smith",
"dateOfBirth": "1985-06-20"
}
],
"validate_only": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sequence_definition_id: 123,
next_activity_date: '2024-01-15T10:00:00Z',
rows: [
{
phoneNumber: '+15551234567',
firstName: 'John',
lastName: 'Doe',
dateOfBirth: '1990-01-15'
},
{
phoneNumber: '+15559876543',
firstName: 'Jane',
lastName: 'Smith',
dateOfBirth: '1985-06-20'
}
],
validate_only: false
})
};
fetch('https://api.clarionhealth.com/v1/sequence-manager/sequences/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.clarionhealth.com/v1/sequence-manager/sequences/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sequence_definition_id' => 123,
'next_activity_date' => '2024-01-15T10:00:00Z',
'rows' => [
[
'phoneNumber' => '+15551234567',
'firstName' => 'John',
'lastName' => 'Doe',
'dateOfBirth' => '1990-01-15'
],
[
'phoneNumber' => '+15559876543',
'firstName' => 'Jane',
'lastName' => 'Smith',
'dateOfBirth' => '1985-06-20'
]
],
'validate_only' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.clarionhealth.com/v1/sequence-manager/sequences/batch"
payload := strings.NewReader("{\n \"sequence_definition_id\": 123,\n \"next_activity_date\": \"2024-01-15T10:00:00Z\",\n \"rows\": [\n {\n \"phoneNumber\": \"+15551234567\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"dateOfBirth\": \"1990-01-15\"\n },\n {\n \"phoneNumber\": \"+15559876543\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Smith\",\n \"dateOfBirth\": \"1985-06-20\"\n }\n ],\n \"validate_only\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.clarionhealth.com/v1/sequence-manager/sequences/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sequence_definition_id\": 123,\n \"next_activity_date\": \"2024-01-15T10:00:00Z\",\n \"rows\": [\n {\n \"phoneNumber\": \"+15551234567\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"dateOfBirth\": \"1990-01-15\"\n },\n {\n \"phoneNumber\": \"+15559876543\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Smith\",\n \"dateOfBirth\": \"1985-06-20\"\n }\n ],\n \"validate_only\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.clarionhealth.com/v1/sequence-manager/sequences/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sequence_definition_id\": 123,\n \"next_activity_date\": \"2024-01-15T10:00:00Z\",\n \"rows\": [\n {\n \"phoneNumber\": \"+15551234567\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"dateOfBirth\": \"1990-01-15\"\n },\n {\n \"phoneNumber\": \"+15559876543\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Smith\",\n \"dateOfBirth\": \"1985-06-20\"\n }\n ],\n \"validate_only\": false\n}"
response = http.request(request)
puts response.read_body{
"valid": true,
"total_attempted": 2,
"created_count": 2,
"created": [
{
"rowIndex": 0,
"sequence_id": 100
},
{
"rowIndex": 1,
"sequence_id": 101
}
],
"errors": [],
"warnings": []
}Overview
This endpoint creates multiple sequences from an array of patient data rows. Key details:- Maximum 100 rows per request
- Each row requires
phoneNumber,firstName, andlastName - Additional fields are mapped to sequence inputs based on the definition’s
inputs_definition - All row input fields must be in camelCase as per agent convention
Validation Mode
Setvalidate_only: true to validate rows without creating sequences. This lets you preview errors and warnings before committing the upload.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Batch upload request
ID of the sequence definition to use
Patient data rows (max 100). Each row requires phoneNumber, firstName, and lastName, plus any additional fields defined in the sequence definition's inputs_definition. All row input fields must be in camelCase as per agent convention.
100Show child attributes
Show child attributes
ISO 8601 date for when the first activity should be scheduled. Defaults to now if not provided.
If true, validate without creating sequences
Response
Batch upload result with validation status and any errors/warnings
True if all rows passed validation (warnings don't affect this)
Total rows in the request
Rows that passed validation
Sequences created (0 if validate_only was true)
Created sequence identifiers
Show child attributes
Show child attributes
Validation errors (rows with errors are not created)
Show child attributes
Show child attributes
Warnings (rows with warnings can still be created)
Show child attributes
Show child attributes

