Skip to main content
POST
/
api
/
v1
/
outbound
/
batches
/
{batch_id}
/
requests
Typescript (SDK)
import { SyllableSDK } from "syllable-sdk";

const syllableSDK = new SyllableSDK({
  apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});

async function run() {
  const result = await syllableSDK.outbound.batches.add({
    batchId: "<id>",
    communicationRequest: {
      referenceId: "12345",
      target: "512-555-1234",
      requestVariables: {

      },
    },
  });

  console.log(result);
}

run();
import os
from syllable_sdk import SyllableSDK


with SyllableSDK(
api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
) as ss_client:

res = ss_client.outbound.batches.add(batch_id="<id>", communication_request={
"reference_id": "12345",
"target": "512-555-1234",
"request_variables": {

},
})

# Handle response
print(res)
curl --request POST \
--url https://api.syllable.cloud/api/v1/outbound/batches/{batch_id}/requests \
--header 'Content-Type: application/json' \
--header 'Syllable-API-Key: <api-key>' \
--data '
{
"reference_id": "<string>",
"target": "<string>",
"request_variables": {}
}
'
const options = {
method: 'POST',
headers: {'Syllable-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({reference_id: '<string>', target: '<string>', request_variables: {}})
};

fetch('https://api.syllable.cloud/api/v1/outbound/batches/{batch_id}/requests', 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.syllable.cloud/api/v1/outbound/batches/{batch_id}/requests",
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([
'reference_id' => '<string>',
'target' => '<string>',
'request_variables' => [

]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Syllable-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.syllable.cloud/api/v1/outbound/batches/{batch_id}/requests"

payload := strings.NewReader("{\n \"reference_id\": \"<string>\",\n \"target\": \"<string>\",\n \"request_variables\": {}\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Syllable-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.post("https://api.syllable.cloud/api/v1/outbound/batches/{batch_id}/requests")
.header("Syllable-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reference_id\": \"<string>\",\n \"target\": \"<string>\",\n \"request_variables\": {}\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.syllable.cloud/api/v1/outbound/batches/{batch_id}/requests")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Syllable-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reference_id\": \"<string>\",\n \"target\": \"<string>\",\n \"request_variables\": {}\n}"

response = http.request(request)
puts response.read_body
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}

Authorizations

Syllable-API-Key
string
header
required

Path Parameters

batch_id
string
required

Body

application/json
reference_id
string
required

ID for target outreach (unique within batch)

Example:

"12345"

target
string
required

Target phone number

Examples:

"512-555-1234"

"+15125551234"

request_variables
Request Variables · object
required

Variables for request

Response

Successful Response