Create a retry policy
curl --request POST \
--url https://platform-api.sarj.ai/api/v1/schedule-configs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expire_after": "P3D",
"max_retries": 2,
"retry_window": {
"end_edge": {
"hour": 17,
"minute": 0
},
"start_edge": {
"hour": 9,
"minute": 0
}
},
"timezone": "Asia/Riyadh",
"wait_between": "PT2H"
}
'import requests
url = "https://platform-api.sarj.ai/api/v1/schedule-configs"
payload = {
"expire_after": "P3D",
"max_retries": 2,
"retry_window": {
"end_edge": {
"hour": 17,
"minute": 0
},
"start_edge": {
"hour": 9,
"minute": 0
}
},
"timezone": "Asia/Riyadh",
"wait_between": "PT2H"
}
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({
expire_after: 'P3D',
max_retries: 2,
retry_window: {end_edge: {hour: 17, minute: 0}, start_edge: {hour: 9, minute: 0}},
timezone: 'Asia/Riyadh',
wait_between: 'PT2H'
})
};
fetch('https://platform-api.sarj.ai/api/v1/schedule-configs', 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://platform-api.sarj.ai/api/v1/schedule-configs",
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([
'expire_after' => 'P3D',
'max_retries' => 2,
'retry_window' => [
'end_edge' => [
'hour' => 17,
'minute' => 0
],
'start_edge' => [
'hour' => 9,
'minute' => 0
]
],
'timezone' => 'Asia/Riyadh',
'wait_between' => 'PT2H'
]),
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://platform-api.sarj.ai/api/v1/schedule-configs"
payload := strings.NewReader("{\n \"expire_after\": \"P3D\",\n \"max_retries\": 2,\n \"retry_window\": {\n \"end_edge\": {\n \"hour\": 17,\n \"minute\": 0\n },\n \"start_edge\": {\n \"hour\": 9,\n \"minute\": 0\n }\n },\n \"timezone\": \"Asia/Riyadh\",\n \"wait_between\": \"PT2H\"\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://platform-api.sarj.ai/api/v1/schedule-configs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expire_after\": \"P3D\",\n \"max_retries\": 2,\n \"retry_window\": {\n \"end_edge\": {\n \"hour\": 17,\n \"minute\": 0\n },\n \"start_edge\": {\n \"hour\": 9,\n \"minute\": 0\n }\n },\n \"timezone\": \"Asia/Riyadh\",\n \"wait_between\": \"PT2H\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform-api.sarj.ai/api/v1/schedule-configs")
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 \"expire_after\": \"P3D\",\n \"max_retries\": 2,\n \"retry_window\": {\n \"end_edge\": {\n \"hour\": 17,\n \"minute\": 0\n },\n \"start_edge\": {\n \"hour\": 9,\n \"minute\": 0\n }\n },\n \"timezone\": \"Asia/Riyadh\",\n \"wait_between\": \"PT2H\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "01890000-0000-7000-8000-000000000000",
"created_at": "2023-11-07T05:31:56Z",
"enabled": true,
"max_retries": 123,
"wait_between": "<string>",
"retry_window": {
"start_edge": {
"hour": 11,
"minute": 29
},
"end_edge": {
"hour": 11,
"minute": 29
}
},
"timezone": "<string>",
"expire_after": "<string>"
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"message": "<string>",
"type": "validation_error",
"field_violations": [
{
"field": "phone_number.country_code",
"message": "Must start with +"
}
]
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"message": "<string>",
"type": "validation_error",
"field_violations": [
{
"field": "phone_number.country_code",
"message": "Must start with +"
}
]
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"message": "<string>",
"type": "validation_error",
"field_violations": [
{
"field": "phone_number.country_code",
"message": "Must start with +"
}
]
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"message": "<string>",
"type": "validation_error",
"field_violations": [
{
"field": "phone_number.country_code",
"message": "Must start with +"
}
]
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"message": "<string>",
"type": "validation_error",
"field_violations": [
{
"field": "phone_number.country_code",
"message": "Must start with +"
}
]
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}Schedule Configs
Create a retry policy
Create a reusable dial-retry policy. This API is create-only.
POST
/
schedule-configs
Create a retry policy
curl --request POST \
--url https://platform-api.sarj.ai/api/v1/schedule-configs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expire_after": "P3D",
"max_retries": 2,
"retry_window": {
"end_edge": {
"hour": 17,
"minute": 0
},
"start_edge": {
"hour": 9,
"minute": 0
}
},
"timezone": "Asia/Riyadh",
"wait_between": "PT2H"
}
'import requests
url = "https://platform-api.sarj.ai/api/v1/schedule-configs"
payload = {
"expire_after": "P3D",
"max_retries": 2,
"retry_window": {
"end_edge": {
"hour": 17,
"minute": 0
},
"start_edge": {
"hour": 9,
"minute": 0
}
},
"timezone": "Asia/Riyadh",
"wait_between": "PT2H"
}
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({
expire_after: 'P3D',
max_retries: 2,
retry_window: {end_edge: {hour: 17, minute: 0}, start_edge: {hour: 9, minute: 0}},
timezone: 'Asia/Riyadh',
wait_between: 'PT2H'
})
};
fetch('https://platform-api.sarj.ai/api/v1/schedule-configs', 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://platform-api.sarj.ai/api/v1/schedule-configs",
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([
'expire_after' => 'P3D',
'max_retries' => 2,
'retry_window' => [
'end_edge' => [
'hour' => 17,
'minute' => 0
],
'start_edge' => [
'hour' => 9,
'minute' => 0
]
],
'timezone' => 'Asia/Riyadh',
'wait_between' => 'PT2H'
]),
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://platform-api.sarj.ai/api/v1/schedule-configs"
payload := strings.NewReader("{\n \"expire_after\": \"P3D\",\n \"max_retries\": 2,\n \"retry_window\": {\n \"end_edge\": {\n \"hour\": 17,\n \"minute\": 0\n },\n \"start_edge\": {\n \"hour\": 9,\n \"minute\": 0\n }\n },\n \"timezone\": \"Asia/Riyadh\",\n \"wait_between\": \"PT2H\"\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://platform-api.sarj.ai/api/v1/schedule-configs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"expire_after\": \"P3D\",\n \"max_retries\": 2,\n \"retry_window\": {\n \"end_edge\": {\n \"hour\": 17,\n \"minute\": 0\n },\n \"start_edge\": {\n \"hour\": 9,\n \"minute\": 0\n }\n },\n \"timezone\": \"Asia/Riyadh\",\n \"wait_between\": \"PT2H\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platform-api.sarj.ai/api/v1/schedule-configs")
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 \"expire_after\": \"P3D\",\n \"max_retries\": 2,\n \"retry_window\": {\n \"end_edge\": {\n \"hour\": 17,\n \"minute\": 0\n },\n \"start_edge\": {\n \"hour\": 9,\n \"minute\": 0\n }\n },\n \"timezone\": \"Asia/Riyadh\",\n \"wait_between\": \"PT2H\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "01890000-0000-7000-8000-000000000000",
"created_at": "2023-11-07T05:31:56Z",
"enabled": true,
"max_retries": 123,
"wait_between": "<string>",
"retry_window": {
"start_edge": {
"hour": 11,
"minute": 29
},
"end_edge": {
"hour": 11,
"minute": 29
}
},
"timezone": "<string>",
"expire_after": "<string>"
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"message": "<string>",
"type": "validation_error",
"field_violations": [
{
"field": "phone_number.country_code",
"message": "Must start with +"
}
]
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"message": "<string>",
"type": "validation_error",
"field_violations": [
{
"field": "phone_number.country_code",
"message": "Must start with +"
}
]
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"message": "<string>",
"type": "validation_error",
"field_violations": [
{
"field": "phone_number.country_code",
"message": "Must start with +"
}
]
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"message": "<string>",
"type": "validation_error",
"field_violations": [
{
"field": "phone_number.country_code",
"message": "Must start with +"
}
]
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"message": "<string>",
"type": "validation_error",
"field_violations": [
{
"field": "phone_number.country_code",
"message": "Must start with +"
}
]
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}Body
application/json
Policy retries after eligible unsuccessful calls.
Infrastructure failure redials use separate rules; the 7-day platform expiry applies to both.
Response
The schedule config was created.

