Update an existing campaign item
curl --request PATCH \
--url https://api.starleads.co/CampaignItem/{campaignId} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"phoneNumber": "<string>",
"itemId": "<string>",
"dataBag": {},
"nextTryDate": "<string>"
}
'import requests
url = "https://api.starleads.co/CampaignItem/{campaignId}"
payload = {
"phoneNumber": "<string>",
"itemId": "<string>",
"dataBag": {},
"nextTryDate": "<string>"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phoneNumber: '<string>',
itemId: '<string>',
dataBag: {},
nextTryDate: '<string>'
})
};
fetch('https://api.starleads.co/CampaignItem/{campaignId}', 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.starleads.co/CampaignItem/{campaignId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'phoneNumber' => '<string>',
'itemId' => '<string>',
'dataBag' => [
],
'nextTryDate' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$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.starleads.co/CampaignItem/{campaignId}"
payload := strings.NewReader("{\n \"phoneNumber\": \"<string>\",\n \"itemId\": \"<string>\",\n \"dataBag\": {},\n \"nextTryDate\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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.patch("https://api.starleads.co/CampaignItem/{campaignId}")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phoneNumber\": \"<string>\",\n \"itemId\": \"<string>\",\n \"dataBag\": {},\n \"nextTryDate\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.starleads.co/CampaignItem/{campaignId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phoneNumber\": \"<string>\",\n \"itemId\": \"<string>\",\n \"dataBag\": {},\n \"nextTryDate\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"campaignId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"processedAt": "2023-11-07T05:31:56Z",
"lastCallDate": "2023-11-07T05:31:56Z",
"runningStatus": "Pending",
"attemptCount": 123,
"channel": 0,
"phoneNumber": "<string>",
"businessId": "<string>",
"nextTryDate": "2023-11-07T05:31:56Z",
"dataBag": {},
"result": {
"tag": {
"id": "<string>",
"name": "<string>",
"color": "<string>"
},
"conversation": {
"id": "<string>",
"messages": [
{
"timestamp": "2023-11-07T05:31:56Z",
"role": "<string>",
"text": "<string>",
"rawText": "<string>",
"intent": "<string>",
"commands": [
"<string>"
],
"isConversationEnded": true,
"endReason": "<string>"
}
]
},
"summary": "<string>",
"isSystem": true,
"metadata": {}
},
"isArchived": true,
"eventList": [
{
"type": "LaunchCall",
"date": "2023-11-07T05:31:56Z",
"description": "<string>"
}
],
"delivery": {
"status": 1,
"externalMessageId": "<string>",
"provider": "<string>",
"sentAt": "2023-11-07T05:31:56Z",
"deliveredAt": "2023-11-07T05:31:56Z",
"readAt": "2023-11-07T05:31:56Z",
"failedAt": "2023-11-07T05:31:56Z",
"errorCode": "<string>",
"errorTitle": "<string>",
"lastMessageIndex": 123,
"lastOrigin": 0,
"history": [
{
"origin": 0,
"messageIndex": 123,
"externalMessageId": "<string>",
"status": 1,
"sentAt": "2023-11-07T05:31:56Z",
"deliveredAt": "2023-11-07T05:31:56Z",
"readAt": "2023-11-07T05:31:56Z",
"failedAt": "2023-11-07T05:31:56Z",
"errorCode": "<string>",
"errorTitle": "<string>"
}
]
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}CampaignItem
Update an existing campaign item
Finds a campaign item matching the provided filters (phoneNumber, runningStatus, and optionally itemId) and partially updates it. The first matching item is updated.
PATCH
/
CampaignItem
/
{campaignId}
Update an existing campaign item
curl --request PATCH \
--url https://api.starleads.co/CampaignItem/{campaignId} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"phoneNumber": "<string>",
"itemId": "<string>",
"dataBag": {},
"nextTryDate": "<string>"
}
'import requests
url = "https://api.starleads.co/CampaignItem/{campaignId}"
payload = {
"phoneNumber": "<string>",
"itemId": "<string>",
"dataBag": {},
"nextTryDate": "<string>"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phoneNumber: '<string>',
itemId: '<string>',
dataBag: {},
nextTryDate: '<string>'
})
};
fetch('https://api.starleads.co/CampaignItem/{campaignId}', 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.starleads.co/CampaignItem/{campaignId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'phoneNumber' => '<string>',
'itemId' => '<string>',
'dataBag' => [
],
'nextTryDate' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$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.starleads.co/CampaignItem/{campaignId}"
payload := strings.NewReader("{\n \"phoneNumber\": \"<string>\",\n \"itemId\": \"<string>\",\n \"dataBag\": {},\n \"nextTryDate\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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.patch("https://api.starleads.co/CampaignItem/{campaignId}")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phoneNumber\": \"<string>\",\n \"itemId\": \"<string>\",\n \"dataBag\": {},\n \"nextTryDate\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.starleads.co/CampaignItem/{campaignId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phoneNumber\": \"<string>\",\n \"itemId\": \"<string>\",\n \"dataBag\": {},\n \"nextTryDate\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"campaignId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"processedAt": "2023-11-07T05:31:56Z",
"lastCallDate": "2023-11-07T05:31:56Z",
"runningStatus": "Pending",
"attemptCount": 123,
"channel": 0,
"phoneNumber": "<string>",
"businessId": "<string>",
"nextTryDate": "2023-11-07T05:31:56Z",
"dataBag": {},
"result": {
"tag": {
"id": "<string>",
"name": "<string>",
"color": "<string>"
},
"conversation": {
"id": "<string>",
"messages": [
{
"timestamp": "2023-11-07T05:31:56Z",
"role": "<string>",
"text": "<string>",
"rawText": "<string>",
"intent": "<string>",
"commands": [
"<string>"
],
"isConversationEnded": true,
"endReason": "<string>"
}
]
},
"summary": "<string>",
"isSystem": true,
"metadata": {}
},
"isArchived": true,
"eventList": [
{
"type": "LaunchCall",
"date": "2023-11-07T05:31:56Z",
"description": "<string>"
}
],
"delivery": {
"status": 1,
"externalMessageId": "<string>",
"provider": "<string>",
"sentAt": "2023-11-07T05:31:56Z",
"deliveredAt": "2023-11-07T05:31:56Z",
"readAt": "2023-11-07T05:31:56Z",
"failedAt": "2023-11-07T05:31:56Z",
"errorCode": "<string>",
"errorTitle": "<string>",
"lastMessageIndex": 123,
"lastOrigin": 0,
"history": [
{
"origin": 0,
"messageIndex": 123,
"externalMessageId": "<string>",
"status": 1,
"sentAt": "2023-11-07T05:31:56Z",
"deliveredAt": "2023-11-07T05:31:56Z",
"readAt": "2023-11-07T05:31:56Z",
"failedAt": "2023-11-07T05:31:56Z",
"errorCode": "<string>",
"errorTitle": "<string>"
}
]
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Authorizations
Headers
Path Parameters
ID of the campaign.
Body
application/jsontext/jsonapplication/*+json
Phone number of the item to update. Required if itemId is not provided.
Item ID of the item to update. Required if phoneNumber is not provided.
Available options:
Pending, Calling, Processed, ProcessingResult, Error The databag refer to the campaign fields. Only the provided keys will be updated.
Show child attributes
Show child attributes
The next date when the number will be called again by Starleads.
Response
Success
Available options:
Pending, Calling, Processed, ProcessingResult, Error Available options:
0, 1, 2, 3, 4 Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes

