Campaigns
Update a campaign
PATCH
/
v1
/
campaigns
/
{id}
Update a campaign
curl --request PATCH \
--url https://api-us.larynth.com/v1/campaigns/{id} \
--header 'Content-Type: application/json' \
--cookie lx_session= \
--data '
{
"amd_profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"assistant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cps": 49,
"end_at": "2023-11-07T05:31:56Z",
"max_attempts": 5,
"max_concurrent": 500,
"name": "<string>",
"number_ids": [
"<string>"
],
"retry_policy": {
"busy": "<string>",
"failed": "<string>",
"no_answer": "<string>",
"voicemail_left": "<string>"
},
"ring_timeout_s": 37,
"start_at": "2023-11-07T05:31:56Z",
"voicemail_message": "<string>",
"windows": [
{
"days": [
123
],
"end_minute": 720,
"start_minute": 719
}
]
}
'import requests
url = "https://api-us.larynth.com/v1/campaigns/{id}"
payload = {
"amd_profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"assistant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cps": 49,
"end_at": "2023-11-07T05:31:56Z",
"max_attempts": 5,
"max_concurrent": 500,
"name": "<string>",
"number_ids": ["<string>"],
"retry_policy": {
"busy": "<string>",
"failed": "<string>",
"no_answer": "<string>",
"voicemail_left": "<string>"
},
"ring_timeout_s": 37,
"start_at": "2023-11-07T05:31:56Z",
"voicemail_message": "<string>",
"windows": [
{
"days": [123],
"end_minute": 720,
"start_minute": 719
}
]
}
headers = {
"cookie": "lx_session=",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {cookie: 'lx_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
amd_profile_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
assistant_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
cps: 49,
end_at: '2023-11-07T05:31:56Z',
max_attempts: 5,
max_concurrent: 500,
name: '<string>',
number_ids: ['<string>'],
retry_policy: {
busy: '<string>',
failed: '<string>',
no_answer: '<string>',
voicemail_left: '<string>'
},
ring_timeout_s: 37,
start_at: '2023-11-07T05:31:56Z',
voicemail_message: '<string>',
windows: [{days: [123], end_minute: 720, start_minute: 719}]
})
};
fetch('https://api-us.larynth.com/v1/campaigns/{id}', 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-us.larynth.com/v1/campaigns/{id}",
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([
'amd_profile_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'assistant_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'cps' => 49,
'end_at' => '2023-11-07T05:31:56Z',
'max_attempts' => 5,
'max_concurrent' => 500,
'name' => '<string>',
'number_ids' => [
'<string>'
],
'retry_policy' => [
'busy' => '<string>',
'failed' => '<string>',
'no_answer' => '<string>',
'voicemail_left' => '<string>'
],
'ring_timeout_s' => 37,
'start_at' => '2023-11-07T05:31:56Z',
'voicemail_message' => '<string>',
'windows' => [
[
'days' => [
123
],
'end_minute' => 720,
'start_minute' => 719
]
]
]),
CURLOPT_COOKIE => "lx_session=",
CURLOPT_HTTPHEADER => [
"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-us.larynth.com/v1/campaigns/{id}"
payload := strings.NewReader("{\n \"amd_profile_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"assistant_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cps\": 49,\n \"end_at\": \"2023-11-07T05:31:56Z\",\n \"max_attempts\": 5,\n \"max_concurrent\": 500,\n \"name\": \"<string>\",\n \"number_ids\": [\n \"<string>\"\n ],\n \"retry_policy\": {\n \"busy\": \"<string>\",\n \"failed\": \"<string>\",\n \"no_answer\": \"<string>\",\n \"voicemail_left\": \"<string>\"\n },\n \"ring_timeout_s\": 37,\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"voicemail_message\": \"<string>\",\n \"windows\": [\n {\n \"days\": [\n 123\n ],\n \"end_minute\": 720,\n \"start_minute\": 719\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("cookie", "lx_session=")
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-us.larynth.com/v1/campaigns/{id}")
.header("cookie", "lx_session=")
.header("Content-Type", "application/json")
.body("{\n \"amd_profile_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"assistant_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cps\": 49,\n \"end_at\": \"2023-11-07T05:31:56Z\",\n \"max_attempts\": 5,\n \"max_concurrent\": 500,\n \"name\": \"<string>\",\n \"number_ids\": [\n \"<string>\"\n ],\n \"retry_policy\": {\n \"busy\": \"<string>\",\n \"failed\": \"<string>\",\n \"no_answer\": \"<string>\",\n \"voicemail_left\": \"<string>\"\n },\n \"ring_timeout_s\": 37,\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"voicemail_message\": \"<string>\",\n \"windows\": [\n {\n \"days\": [\n 123\n ],\n \"end_minute\": 720,\n \"start_minute\": 719\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-us.larynth.com/v1/campaigns/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["cookie"] = 'lx_session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"amd_profile_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"assistant_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cps\": 49,\n \"end_at\": \"2023-11-07T05:31:56Z\",\n \"max_attempts\": 5,\n \"max_concurrent\": 500,\n \"name\": \"<string>\",\n \"number_ids\": [\n \"<string>\"\n ],\n \"retry_policy\": {\n \"busy\": \"<string>\",\n \"failed\": \"<string>\",\n \"no_answer\": \"<string>\",\n \"voicemail_left\": \"<string>\"\n },\n \"ring_timeout_s\": 37,\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"voicemail_message\": \"<string>\",\n \"windows\": [\n {\n \"days\": [\n 123\n ],\n \"end_minute\": 720,\n \"start_minute\": 719\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"amd_mode": "off",
"assistant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cps": 123,
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"max_attempts": 123,
"max_concurrent": 123,
"name": "<string>",
"number_ids": [
"<string>"
],
"purpose": "informational",
"retry_policy": {
"busy": "<string>",
"failed": "<string>",
"no_answer": "<string>",
"voicemail_left": "<string>"
},
"ring_timeout_s": 123,
"status": "draft",
"updated_at": "2023-11-07T05:31:56Z",
"windows": [
{
"days": [
123
],
"end_minute": 720,
"start_minute": 719
}
],
"amd_profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"archived_at": "2023-11-07T05:31:56Z",
"end_at": "2023-11-07T05:31:56Z",
"informational_category": "<string>",
"paused_reason": "user",
"start_at": "2023-11-07T05:31:56Z",
"voicemail_message": "<string>"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}Authorizations
sessionapiKey
Dashboard session cookie
Path Parameters
Body
application/json
Available options:
off, hangup_on_machine, voicemail Required range:
x <= 50Required range:
1 <= x <= 10Required range:
1 <= x <= 1000Required string length:
1 - 200Caller-ID pool
Maximum array length:
100Show child attributes
Show child attributes
Required range:
15 <= x <= 60Required string length:
1 - 1000Further restricts the legal calling windows
Maximum array length:
14Show child attributes
Show child attributes
Response
OK
Available options:
off, hangup_on_machine, voicemail Available options:
informational, telemarketing Show child attributes
Show child attributes
Available options:
draft, running, paused, completed, archived Show child attributes
Show child attributes
Available options:
user, credits_exhausted, window_closed, no_caller_id, compliance, operator ⌘I
Update a campaign
curl --request PATCH \
--url https://api-us.larynth.com/v1/campaigns/{id} \
--header 'Content-Type: application/json' \
--cookie lx_session= \
--data '
{
"amd_profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"assistant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cps": 49,
"end_at": "2023-11-07T05:31:56Z",
"max_attempts": 5,
"max_concurrent": 500,
"name": "<string>",
"number_ids": [
"<string>"
],
"retry_policy": {
"busy": "<string>",
"failed": "<string>",
"no_answer": "<string>",
"voicemail_left": "<string>"
},
"ring_timeout_s": 37,
"start_at": "2023-11-07T05:31:56Z",
"voicemail_message": "<string>",
"windows": [
{
"days": [
123
],
"end_minute": 720,
"start_minute": 719
}
]
}
'import requests
url = "https://api-us.larynth.com/v1/campaigns/{id}"
payload = {
"amd_profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"assistant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cps": 49,
"end_at": "2023-11-07T05:31:56Z",
"max_attempts": 5,
"max_concurrent": 500,
"name": "<string>",
"number_ids": ["<string>"],
"retry_policy": {
"busy": "<string>",
"failed": "<string>",
"no_answer": "<string>",
"voicemail_left": "<string>"
},
"ring_timeout_s": 37,
"start_at": "2023-11-07T05:31:56Z",
"voicemail_message": "<string>",
"windows": [
{
"days": [123],
"end_minute": 720,
"start_minute": 719
}
]
}
headers = {
"cookie": "lx_session=",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {cookie: 'lx_session=', 'Content-Type': 'application/json'},
body: JSON.stringify({
amd_profile_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
assistant_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
cps: 49,
end_at: '2023-11-07T05:31:56Z',
max_attempts: 5,
max_concurrent: 500,
name: '<string>',
number_ids: ['<string>'],
retry_policy: {
busy: '<string>',
failed: '<string>',
no_answer: '<string>',
voicemail_left: '<string>'
},
ring_timeout_s: 37,
start_at: '2023-11-07T05:31:56Z',
voicemail_message: '<string>',
windows: [{days: [123], end_minute: 720, start_minute: 719}]
})
};
fetch('https://api-us.larynth.com/v1/campaigns/{id}', 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-us.larynth.com/v1/campaigns/{id}",
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([
'amd_profile_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'assistant_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'cps' => 49,
'end_at' => '2023-11-07T05:31:56Z',
'max_attempts' => 5,
'max_concurrent' => 500,
'name' => '<string>',
'number_ids' => [
'<string>'
],
'retry_policy' => [
'busy' => '<string>',
'failed' => '<string>',
'no_answer' => '<string>',
'voicemail_left' => '<string>'
],
'ring_timeout_s' => 37,
'start_at' => '2023-11-07T05:31:56Z',
'voicemail_message' => '<string>',
'windows' => [
[
'days' => [
123
],
'end_minute' => 720,
'start_minute' => 719
]
]
]),
CURLOPT_COOKIE => "lx_session=",
CURLOPT_HTTPHEADER => [
"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-us.larynth.com/v1/campaigns/{id}"
payload := strings.NewReader("{\n \"amd_profile_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"assistant_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cps\": 49,\n \"end_at\": \"2023-11-07T05:31:56Z\",\n \"max_attempts\": 5,\n \"max_concurrent\": 500,\n \"name\": \"<string>\",\n \"number_ids\": [\n \"<string>\"\n ],\n \"retry_policy\": {\n \"busy\": \"<string>\",\n \"failed\": \"<string>\",\n \"no_answer\": \"<string>\",\n \"voicemail_left\": \"<string>\"\n },\n \"ring_timeout_s\": 37,\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"voicemail_message\": \"<string>\",\n \"windows\": [\n {\n \"days\": [\n 123\n ],\n \"end_minute\": 720,\n \"start_minute\": 719\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("cookie", "lx_session=")
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-us.larynth.com/v1/campaigns/{id}")
.header("cookie", "lx_session=")
.header("Content-Type", "application/json")
.body("{\n \"amd_profile_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"assistant_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cps\": 49,\n \"end_at\": \"2023-11-07T05:31:56Z\",\n \"max_attempts\": 5,\n \"max_concurrent\": 500,\n \"name\": \"<string>\",\n \"number_ids\": [\n \"<string>\"\n ],\n \"retry_policy\": {\n \"busy\": \"<string>\",\n \"failed\": \"<string>\",\n \"no_answer\": \"<string>\",\n \"voicemail_left\": \"<string>\"\n },\n \"ring_timeout_s\": 37,\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"voicemail_message\": \"<string>\",\n \"windows\": [\n {\n \"days\": [\n 123\n ],\n \"end_minute\": 720,\n \"start_minute\": 719\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-us.larynth.com/v1/campaigns/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["cookie"] = 'lx_session='
request["Content-Type"] = 'application/json'
request.body = "{\n \"amd_profile_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"assistant_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"cps\": 49,\n \"end_at\": \"2023-11-07T05:31:56Z\",\n \"max_attempts\": 5,\n \"max_concurrent\": 500,\n \"name\": \"<string>\",\n \"number_ids\": [\n \"<string>\"\n ],\n \"retry_policy\": {\n \"busy\": \"<string>\",\n \"failed\": \"<string>\",\n \"no_answer\": \"<string>\",\n \"voicemail_left\": \"<string>\"\n },\n \"ring_timeout_s\": 37,\n \"start_at\": \"2023-11-07T05:31:56Z\",\n \"voicemail_message\": \"<string>\",\n \"windows\": [\n {\n \"days\": [\n 123\n ],\n \"end_minute\": 720,\n \"start_minute\": 719\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"amd_mode": "off",
"assistant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cps": 123,
"created_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"max_attempts": 123,
"max_concurrent": 123,
"name": "<string>",
"number_ids": [
"<string>"
],
"purpose": "informational",
"retry_policy": {
"busy": "<string>",
"failed": "<string>",
"no_answer": "<string>",
"voicemail_left": "<string>"
},
"ring_timeout_s": 123,
"status": "draft",
"updated_at": "2023-11-07T05:31:56Z",
"windows": [
{
"days": [
123
],
"end_minute": 720,
"start_minute": 719
}
],
"amd_profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"archived_at": "2023-11-07T05:31:56Z",
"end_at": "2023-11-07T05:31:56Z",
"informational_category": "<string>",
"paused_reason": "user",
"start_at": "2023-11-07T05:31:56Z",
"voicemail_message": "<string>"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}{
"code": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"retry_at": "2023-11-07T05:31:56Z"
}