curl --request POST \
--url https://api.stardex.ai/v1/campaigns/{id}/enrollment-batches/{batch_id}/start \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"version": 5,
"expected_recipient_count": 4,
"from_email": "riya@acmetalent.com"
}
'import requests
url = "https://api.stardex.ai/v1/campaigns/{id}/enrollment-batches/{batch_id}/start"
payload = {
"version": 5,
"expected_recipient_count": 4,
"from_email": "riya@acmetalent.com"
}
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({version: 5, expected_recipient_count: 4, from_email: 'riya@acmetalent.com'})
};
fetch('https://api.stardex.ai/v1/campaigns/{id}/enrollment-batches/{batch_id}/start', 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.stardex.ai/v1/campaigns/{id}/enrollment-batches/{batch_id}/start",
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([
'version' => 5,
'expected_recipient_count' => 4,
'from_email' => 'riya@acmetalent.com'
]),
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.stardex.ai/v1/campaigns/{id}/enrollment-batches/{batch_id}/start"
payload := strings.NewReader("{\n \"version\": 5,\n \"expected_recipient_count\": 4,\n \"from_email\": \"riya@acmetalent.com\"\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.stardex.ai/v1/campaigns/{id}/enrollment-batches/{batch_id}/start")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"version\": 5,\n \"expected_recipient_count\": 4,\n \"from_email\": \"riya@acmetalent.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stardex.ai/v1/campaigns/{id}/enrollment-batches/{batch_id}/start")
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 \"version\": 5,\n \"expected_recipient_count\": 4,\n \"from_email\": \"riya@acmetalent.com\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"batch_id": "eb8d2f41-3c7a-4e19-b5d2-7f0a1c9e6b34",
"status": "starting",
"replayed": false,
"summary": {
"enrolled": 3,
"rejected_at_start": 1,
"not_enrolled": 1
},
"enrollments": [
{
"person_id": "2f6b9d1e-4a8c-4e3f-b7d2-1c5a9e3b7f40",
"enrollment_id": "e7b1d3f5-9a2c-4e6b-8d0f-3a5c7e9b1d42",
"first_email_estimated_at": "2026-10-19T08:00:00.000Z"
},
{
"person_id": "4e8b2d6f-1a3c-4e9b-8f5d-7c2a6e1b3d95",
"enrollment_id": "f3a5c7e9-1b3d-4f6a-8c2e-4d6f8a0c2e57",
"first_email_estimated_at": "2026-10-19T08:00:00.000Z"
},
{
"person_id": "8f6c1d2e-3b5a-4c7e-9d1f-6a8c0e2b4d76",
"enrollment_id": "a9c1e3f5-7b2d-4e8a-9c4f-6e8a0c2e4b18",
"first_email_estimated_at": "2026-10-19T08:00:00.000Z"
}
],
"not_enrolled": [
{
"person_id": "9c4f1a7e-2d8b-4e6c-b3a9-5f1d7c3e8b24",
"status": "blocked"
}
],
"rejected_at_start": [
{
"person_id": "6a3e8c2f-9b1d-4f7a-a5c3-8e2b6d4f1a73",
"issues": [
{
"code": "person_do_not_contact",
"message": "Marked do not contact."
}
]
}
],
"follow_up_errors": [
{
"person_id": "4e8b2d6f-1a3c-4e9b-8f5d-7c2a6e1b3d95",
"message": "Enrolled, but adding them to the job didn't finish. It is retried automatically."
}
]
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Start an enrollment
Enrolls every ready person with exactly the emails stored on the batch. Pass the version and summary.ready you read, so nothing you haven’t seen is sent; if either changed you get 409 and nothing is enrolled. Everyone is checked again: a person who unsubscribed or was enrolled in this campaign by someone else in the meantime is listed in rejected_at_start and the rest are enrolled. Calling start again is safe: it returns or finishes the first result with replayed: true. To undo a start, stop the batch with POST /v1/campaigns/{id}/enrollments/stop. Only the API key or person who created the batch can start it. Needs campaigns:enroll.
curl --request POST \
--url https://api.stardex.ai/v1/campaigns/{id}/enrollment-batches/{batch_id}/start \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"version": 5,
"expected_recipient_count": 4,
"from_email": "riya@acmetalent.com"
}
'import requests
url = "https://api.stardex.ai/v1/campaigns/{id}/enrollment-batches/{batch_id}/start"
payload = {
"version": 5,
"expected_recipient_count": 4,
"from_email": "riya@acmetalent.com"
}
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({version: 5, expected_recipient_count: 4, from_email: 'riya@acmetalent.com'})
};
fetch('https://api.stardex.ai/v1/campaigns/{id}/enrollment-batches/{batch_id}/start', 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.stardex.ai/v1/campaigns/{id}/enrollment-batches/{batch_id}/start",
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([
'version' => 5,
'expected_recipient_count' => 4,
'from_email' => 'riya@acmetalent.com'
]),
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.stardex.ai/v1/campaigns/{id}/enrollment-batches/{batch_id}/start"
payload := strings.NewReader("{\n \"version\": 5,\n \"expected_recipient_count\": 4,\n \"from_email\": \"riya@acmetalent.com\"\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.stardex.ai/v1/campaigns/{id}/enrollment-batches/{batch_id}/start")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"version\": 5,\n \"expected_recipient_count\": 4,\n \"from_email\": \"riya@acmetalent.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stardex.ai/v1/campaigns/{id}/enrollment-batches/{batch_id}/start")
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 \"version\": 5,\n \"expected_recipient_count\": 4,\n \"from_email\": \"riya@acmetalent.com\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"batch_id": "eb8d2f41-3c7a-4e19-b5d2-7f0a1c9e6b34",
"status": "starting",
"replayed": false,
"summary": {
"enrolled": 3,
"rejected_at_start": 1,
"not_enrolled": 1
},
"enrollments": [
{
"person_id": "2f6b9d1e-4a8c-4e3f-b7d2-1c5a9e3b7f40",
"enrollment_id": "e7b1d3f5-9a2c-4e6b-8d0f-3a5c7e9b1d42",
"first_email_estimated_at": "2026-10-19T08:00:00.000Z"
},
{
"person_id": "4e8b2d6f-1a3c-4e9b-8f5d-7c2a6e1b3d95",
"enrollment_id": "f3a5c7e9-1b3d-4f6a-8c2e-4d6f8a0c2e57",
"first_email_estimated_at": "2026-10-19T08:00:00.000Z"
},
{
"person_id": "8f6c1d2e-3b5a-4c7e-9d1f-6a8c0e2b4d76",
"enrollment_id": "a9c1e3f5-7b2d-4e8a-9c4f-6e8a0c2e4b18",
"first_email_estimated_at": "2026-10-19T08:00:00.000Z"
}
],
"not_enrolled": [
{
"person_id": "9c4f1a7e-2d8b-4e6c-b3a9-5f1d7c3e8b24",
"status": "blocked"
}
],
"rejected_at_start": [
{
"person_id": "6a3e8c2f-9b1d-4f7a-a5c3-8e2b6d4f1a73",
"issues": [
{
"code": "person_do_not_contact",
"message": "Marked do not contact."
}
]
}
],
"follow_up_errors": [
{
"person_id": "4e8b2d6f-1a3c-4e9b-8f5d-7c2a6e1b3d95",
"message": "Enrolled, but adding them to the job didn't finish. It is retried automatically."
}
]
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Authorizations
Authenticate with a Bearer token: API key, OAuth token, or session token.
Body
The batch version you read. Start fails if it has changed.
x >= 1How many people you expect to enroll: summary.ready from the batch you read.
x >= 0The mailbox you expect it to send from. When given and different from the batch, start fails with 409 SENDER_MISMATCH.
Was this page helpful?