Getting Started
FREESTYLE API Reference
The FREESTYLE API gives you programmatic access to your FREESTYLE Telecom Technologies account — campaigns, agents, activity, and more. All API access is over HTTPS and all responses are JSON.
This reference covers every endpoint, parameter, and response schema. Contact your account manager with questions.
Early Access — The API is in early access. Endpoints may change before general availability. Breaking changes will be communicated in advance.
Base URL
All endpoints are relative to:
All requests must be made over HTTPS . Plain HTTP is not supported.
Authentication
API Keys
The FREESTYLE API authenticates requests using API keys. Your key is unique to your client account and carries full access to your data — never expose it in client-side code or version control .
Obtaining an API Key
API keys are provisioned by a FREESTYLE administrator from your client profile. Once generated, the full key is shown exactly once — store it immediately in a secure location such as an environment variable or secrets manager.
Treat your API key like a password. If you believe it has been compromised, contact your account manager to have it regenerated. The previous key is invalidated immediately upon regeneration.
Making Requests
Pass your API key in the X-API-Key header on every request:
🔑
X-API-Key: ft_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2
Required headers
Header Required Description
X-API-Key Required Your 64-character hex API key.
Content-Type Conditional Required for POST / PATCH requests. Value: application/json
Accept Optional Recommended: application/json
Errors
The API uses standard HTTP status codes. All error responses include a JSON body with a machine-readable code and a human-readable message.
Error response format
{
"error" : {
"code" : "unauthorized" ,
"message" : "Invalid or missing API key."
}
}
HTTP status codes
200 OK — Request succeeded.
400 Bad Request — Invalid parameters. See the error message for details.
401 Unauthorized — API key is missing or invalid.
403 Forbidden — API key does not have permission for this resource.
404 Not Found — The requested resource does not exist.
500 Server Error — Something went wrong on our side. Try again or contact support.
Error codes
Code Description
unauthorized API key is missing, malformed, or invalid.
api_disabled API access is disabled for this client account.
not_found The requested resource was not found.
invalid_parameter One or more parameters failed validation.
server_error An unexpected server-side error occurred.
Dial Campaigns
List Campaigns
Returns a paginated list of dial campaigns associated with your client account.
Query Parameters
Parameter Type Required Description
page integer Optional Page number. Defaults to 1.
per_page integer Optional Results per page. Default 25, max 100.
status string Optional Filter by status: active, paused, completed, draft.
Response
Returns an object with a data array of campaign objects and a meta pagination object.
{
"data" : [
{
"id" : "c_a1b2c3d4-e5f6-7890-abcd-ef1234567890" ,
"name" : "Q2 Outreach — Ontario" ,
"status" : "active" ,
"created_at" : "2026-03-15T14:22:00Z" ,
"updated_at" : "2026-05-01T09:10:00Z" ,
"total_leads" : 4820 ,
"dialed" : 3104 ,
"remaining" : 1716
}
],
"meta" : {
"page" : 1 ,
"per_page" : 25 ,
"total" : 8 ,
"total_pages" : 1
}
}
Campaign object fields
Field Type Description
id string Unique campaign identifier.
name string Campaign display name.
status string One of active, paused, completed, draft.
created_at string ISO 8601 creation timestamp (UTC).
updated_at string ISO 8601 last-modified timestamp (UTC).
total_leads integer Total leads in the campaign.
dialed integer Leads dialed at least once.
remaining integer Leads not yet dialed.
Response Codes
200 Campaign list returned successfully.
401 Invalid or missing API key.
403 API access is disabled for this account.
Dial Campaigns
Update Campaign Status
Start or pause a dial campaign. Only active and paused are settable — completed and draft are computed states derived from lead progress.
Path Parameters
Parameter Type Required Description
id string Required The campaign ID (e.g. c_a1b2c3d4-...).
Request Body
Send Content-Type: application/json.
Field Type Required Description
status string Required Target status. One of active, paused.
Response
Returns the updated campaign object under a data key.
Response Codes
200 Campaign updated successfully.
400 Invalid or missing status value.
401 Invalid or missing API key.
404 Campaign not found or does not belong to your account.
Dial Campaigns
Upload Campaign Data
Upload a batch of contact records to a dial campaign. Records are appended to the campaign's existing dataset and the campaign's total lead count is updated automatically. Up to 1,000 records per request.
Path Parameters
Parameter Type Required Description
id string Required The campaign ID (e.g. c_a1b2c3d4-...).
Request Body
Send Content-Type: application/json with a top-level records array. Each element is a contact object.
Contact Object Fields
Field Type Required Description
phone1 string Required Primary phone number. Digits only, 10-digit North American format. A leading country code 1 is stripped automatically.
phone2 – phone10 string Optional Additional phone numbers, same format as phone1.
account_id string Optional Primary account identifier (up to 100 chars).
account_name string Optional Contact display name (up to 50 chars).
email string Optional Email address.
street string Optional Street address.
city string Optional City.
province_state string Optional Province or state.
postal_zip string Optional Postal or ZIP code.
dob string Optional Date of birth.
amount number Optional Primary balance or amount.
amount_secondary number Optional Secondary balance or amount.
account_id_secondary string Optional Secondary account identifier.
datetime string Optional Primary date/time (ISO 8601 or Unix timestamp).
datetime_secondary string Optional Secondary date/time.
language string Optional Preferred language code: en, fr, etc.
external_name string Optional External reference name.
data1 – data6 string Optional Custom data fields (up to 120 chars each).
timezone_id integer Optional Timezone ID for scheduling.
client_name string Optional Client label for this record.
Response
Returns a summary of the operation — how many records were inserted, how many were skipped due to validation errors, and the campaign's updated total lead count.
Response Codes
200 Records uploaded successfully.
400 Missing or invalid fields; exceeds 1,000 record limit.
401 Invalid or missing API key.
404 Campaign not found or does not belong to your account.
Dial Campaigns
Get Call Results
Returns a paginated list of individual call result records for a campaign. Each record represents one call attempt, including the disposition, agent, timing, and lead details.
Path Parameters
Parameter Type Required Description
id string Required The campaign ID (e.g. c_a1b2c3d4-...).
Query Parameters
Parameter Type Required Description
from string Optional Start date filter (YYYY-MM-DD). Filters by call completion time.
to string Optional End date filter (YYYY-MM-DD). Inclusive.
disposition integer Optional Filter by disposition type ID.
page integer Optional Page number. Defaults to 1.
per_page integer Optional Records per page, max 200. Defaults to 50.
Response
Returns a data array of result objects and a meta object for pagination. Results are ordered by call completion time descending.
Result Object Fields
Field Type Description
result_id integer Unique identifier for this call result.
campaign_data_id integer ID of the lead record that was called.
account_id string Lead's account identifier.
account_name string Lead's name.
phone_dialed string The phone number that was dialed for this attempt.
phone_number_index integer Phone slot index (0 = phone1, 1 = phone2, …).
disposition object Disposition details: id, name, code, contacted (bool).
agent_id integer ID of the agent who handled the call.
dialed_at string RFC 3339 timestamp when the call was dialed.
connected_at string RFC 3339 timestamp when the call connected (null if no answer).
completed_at string RFC 3339 timestamp when the call was dispositioned.
talk_seconds integer Seconds from connection to completion. Null if not connected.
total_seconds integer Seconds from dial to completion.
amount number Amount collected or recorded during the call, if applicable.
dtmf string DTMF keypad input captured during the call.
recording_id string Call recording reference ID, if recorded.
new_phone string Updated phone number captured during the call.
new_email string Updated email address captured during the call.
Response Codes
200 Results returned successfully.
400 Invalid query parameter.
401 Invalid or missing API key.
404 Campaign not found or does not belong to your account.
Dial Campaigns
Results Summary
Returns aggregate call statistics for a campaign, broken down by disposition type. Useful for dashboards and reporting — includes total calls, contact rate, and talk time.
Path Parameters
Parameter Type Required Description
id string Required The campaign ID (e.g. c_a1b2c3d4-...).
Query Parameters
Parameter Type Required Description
from string Optional Start date filter (YYYY-MM-DD).
to string Optional End date filter (YYYY-MM-DD). Inclusive.
Response
Returns a single data object with top-level totals and a dispositions array ranked by call count.
Response Fields
Field Type Description
total_calls integer Total number of call attempts.
total_contacts integer Calls where a live contact was reached.
contact_rate number Contact rate as a percentage (0–100).
total_talk_seconds integer Sum of connected talk time across all calls.
total_dial_seconds integer Sum of total call duration (dial to completion) across all calls.
first_call_at string RFC 3339 timestamp of the earliest call in the result set.
last_call_at string RFC 3339 timestamp of the most recent call in the result set.
date_range object The from and to filters applied (null if not provided).
dispositions array Breakdown by disposition: id, name, code, contacted, count, percentage.
Response Codes
200 Summary returned successfully.
401 Invalid or missing API key.
404 Campaign not found or does not belong to your account.
Dial Campaigns
Activity Log
Returns a paginated log of campaign-level activity events: records imported, records recycled, and campaign started/stopped events. Corresponds to the Campaign Report in the admin portal.
Path Parameters
Parameter Type Required Description
id string Required The campaign ID (e.g. c_a1b2c3d4-...).
Query Parameters
Parameter Type Required Description
from string Optional Start date filter (YYYY-MM-DD).
to string Optional End date filter (YYYY-MM-DD). Inclusive.
type integer Optional Filter by activity type ID (see table below).
page integer Optional Page number. Defaults to 1.
per_page integer Optional Records per page, max 200. Defaults to 50.
Activity Types
ID Name Count Fields Included
1 Records Imported imported_count, recycled_count (duplicates), excluded_count, total_count
2 Campaign Stopped All counts are null
3 Campaign Started All counts are null
4 Records Recycled recycled_count (reset back to unworked), total_count (total evaluated); other counts are null
Response
Returns a data array of activity event objects and a meta object for pagination. Events are ordered by timestamp descending.
Activity Object Fields
Field Type Description
activity_id integer Unique identifier for this activity event.
type object Activity type: id and name.
imported_count integer Number of new records added. Null for non-import events.
recycled_count integer Duplicate records skipped on import, or records reset to unworked on a recycle run.
excluded_count integer Records excluded during import (invalid or suppressed). Null for non-import events.
total_count integer Total records processed in this event (imported + recycled + excluded for imports; total evaluated for recycle runs).
created_at string RFC 3339 timestamp when the event occurred.
Response Codes
200 Activity log returned successfully.
401 Invalid or missing API key.
404 Campaign not found or does not belong to your account.
SMS Campaigns
List SMS Campaigns
Returns a paginated list of SMS campaigns on your account, including run counts and latest scheduled run timestamp.
Query Parameters
Parameter Type Required Description
status string Optional Filter to campaigns that have at least one run in this status: scheduled, running, completed, cancelled.
page integer Optional Page number. Defaults to 1.
per_page integer Optional Records per page, max 100. Defaults to 50.
Response
Returns a data array of campaign objects and a meta object for pagination. Campaigns are ordered alphabetically by name.
Campaign Object Fields
Field Type Description
id string Unique campaign identifier (e.g. sc_uuid...).
name string Campaign display name.
from_number string Twilio sender phone number in E.164 format.
total_runs integer Total number of runs ever scheduled for this campaign.
running_count integer Runs currently in progress.
scheduled_count integer Runs scheduled and not yet started.
completed_count integer Runs that completed successfully.
cancelled_count integer Runs that were cancelled.
last_run_at string RFC 3339 timestamp of the most recently scheduled run. Null if no runs.
created_at string RFC 3339 timestamp when the campaign was created.
updated_at string RFC 3339 timestamp when the campaign template was last updated. Null if never updated.
Response Codes
200 List returned successfully.
400 Invalid query parameter.
401 Invalid or missing API key.
SMS Campaigns
Get SMS Campaign
Returns a single SMS campaign by ID, including its message template and full run summary counts.
Path Parameters
Parameter Type Required Description
id string Required The SMS campaign ID (e.g. sc_uuid...).
Additional Response Fields
Returns all fields from the list response, plus:
Field Type Description
template string The SMS message template text. Supports placeholders: {Name}, {Balance}, {DueDate}, {CompanyCode}, {Account}.
Response Codes
200 Campaign returned successfully.
401 Invalid or missing API key.
404 Campaign not found or does not belong to your account.
SMS Campaigns
Get Campaign Runs
Returns a paginated list of runs (scheduled send batches) for a given SMS campaign, ordered by scheduled time descending. Each run represents one CSV upload and its delivery progress.
Path Parameters
Parameter Type Required Description
id string Required The SMS campaign ID (e.g. sc_uuid...).
Query Parameters
Parameter Type Required Description
status string Optional Filter by run status: scheduled, running, completed, cancelled.
page integer Optional Page number. Defaults to 1.
per_page integer Optional Records per page, max 100. Defaults to 50.
Run Statuses
Status Meaning
scheduled Queued and waiting for the scheduled send time.
running Currently sending messages.
completed All messages have been processed.
cancelled Run was cancelled before completion.
Run Object Fields
Field Type Description
run_id integer Unique identifier for this run.
status string Current run status (see table above).
scheduled_at string RFC 3339 timestamp when the run was scheduled to begin.
started_at string RFC 3339 timestamp when sending started. Null if not yet started.
completed_at string RFC 3339 timestamp when the run completed. Null if still in progress.
total integer Total number of phone numbers in this run.
processed integer Number of numbers processed so far.
sent integer Messages delivered successfully.
failed integer Messages that failed to deliver.
progress_pct number Percentage of messages processed (0–100).
notes string Internal notes on this run. Null if none.
created_at string RFC 3339 timestamp when the run was created.
Response Codes
200 Runs returned successfully.
400 Invalid query parameter.
401 Invalid or missing API key.
404 Campaign not found or does not belong to your account.
SMS Campaigns
Get Campaign Messages
Returns a paginated log of individual SMS messages sent or received for a campaign, linked through campaign runs. Includes delivery status, error details, cost per message, and the reference ID from the original upload CSV. Corresponds to the SMS Report in the admin portal.
Path Parameters
Parameter Type Required Description
id string Required The SMS campaign ID (e.g. sc_uuid...).
Query Parameters
Parameter Type Required Description
from string Optional Start date filter (YYYY-MM-DD). Filters by message send time.
to string Optional End date filter (YYYY-MM-DD). Inclusive.
run_id integer Optional Filter to messages from a specific campaign run.
status string Optional Filter by Twilio delivery status (e.g. delivered, failed, undelivered, sent).
direction string Optional Filter by message direction: sent or received.
page integer Optional Page number. Defaults to 1.
per_page integer Optional Records per page, max 200. Defaults to 50.
Response
Returns a data array of message objects, a summary object with totals, and a meta object for pagination. Messages are ordered by send time descending.
Message Object Fields
Field Type Description
message_id integer Unique message identifier.
run_id integer The campaign run this message belongs to.
direction string sent or received.
phone_number string The other party's phone number.
from_number string Sender's number (Twilio E.164 format).
to_number string Recipient's number (Twilio E.164 format).
message string Full SMS message body.
status string Twilio delivery status: queued, sent, delivered, failed, undelivered.
error_code string Twilio error code if delivery failed. Null on success.
error_message string Human-readable error description. Null on success.
segments integer Number of SMS segments used (160 chars per segment).
cost number Billed cost for this message.
reference_id string Reference or account ID from the original upload CSV. Null if not provided.
sent_at string RFC 3339 timestamp when the message was sent.
Summary Object Fields
Field Type Description
total integer Total messages matching the current filters.
sent_count integer Outbound messages.
received_count integer Inbound replies.
total_cost number Sum of billed cost across all matching messages.
Response Codes
200 Messages returned successfully.
400 Invalid query parameter.
401 Invalid or missing API key.
404 Campaign not found or does not belong to your account.
Billing
Usage & Cost
Returns per-campaign call duration and billing cost for a given date range. Duration is summed from all conference calls on the campaign; cost is calculated from your account's gross hourly rate (GHR). Corresponds to the Cost Report in the admin portal.
Query Parameters
Parameter Type Required Description
from string Optional Start date filter (YYYY-MM-DD). Filters by conference start time.
to string Optional End date filter (YYYY-MM-DD). Inclusive.
campaign string Optional Filter to a specific campaign (e.g. c_a1b2c3d4-...). Defaults to all campaigns on your account.
Response
Returns a data array with one entry per campaign, and a summary object with account-level totals. Results are ordered by duration descending.
Campaign Object Fields
Field Type Description
campaign_id string Campaign identifier (e.g. c_a1b2c3d4-...).
campaign_name string Campaign display name.
duration_seconds integer Total conference call duration in seconds for the date range.
hourly_rate number Your account's gross hourly rate (GHR) applied to this campaign.
cost number Calculated cost: (duration_seconds / 3600) × hourly_rate.
Summary Object Fields
Field Type Description
total_duration_seconds integer Sum of duration across all campaigns in the response.
total_cost number Sum of cost across all campaigns in the response.
date_range object The from and to filters applied (null if not provided).
Response Codes
200 Usage data returned successfully.
401 Invalid or missing API key.
404 Campaign not found or does not belong to your account.
Account
Get Account
Returns the account profile associated with your API key, including contact information and location.
Response
Returns a single data object representing the authenticated client's account.
Account Object Fields
Field Type Description
id string Unique client identifier (UUID).
name string Account display name.
status string Account status. One of: prospect, onboarded, declined, qualified_lead, commitment.
description string Optional account description. Null if not set.
contacts object Contact details grouped by role: primary, technical, billing. Each has name, email, and phone.
location object Account location with country and province_state. Null if not set.
created_at string ISO 8601 timestamp when the account was created.
Response Codes
200 Account data returned successfully.
401 Invalid or missing API key.
403 API access is disabled for this account.
Account
Phone Numbers
Returns all phone numbers assigned to your account, including type and Neustar Branded Call Display status.
Response
Returns a data array with one entry per phone number and a meta object with the total count.
Phone Number Object Fields
Field Type Description
phone_number_id integer Unique phone number record ID.
phone_number string The phone number in E.164 format.
type object Phone number type with id (integer) and name (string).
description string Optional label or description. Null if not set.
neustar_branded_call_display boolean Whether this number is enrolled in Neustar Branded Call Display.
created_at string ISO 8601 timestamp when this number was added to the account.
Response Codes
200 Phone numbers returned successfully.
401 Invalid or missing API key.
403 API access is disabled for this account.
Authentication Example
cURL
PHP
Python
Node.js
Copy
curl -X GET \
https://api.freestyleteletech.com/v1/dial-campaigns \
-H "X-API-Key: YOUR_API_KEY" \
-H "Accept: application/json"
Copy $ch = curl_init();
curl_setopt_array($ch , [
CURLOPT_URL => 'https://api.freestyleteletech.com/v1/dial-campaigns' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_HTTPHEADER => [
'X-API-Key: YOUR_API_KEY' ,
'Accept: application/json' ,
],
]);
$data = json_decode(curl_exec($ch ), true );
curl_close($ch );
Copy import requests
response = requests.get(
"https://api.freestyleteletech.com/v1/dial-campaigns" ,
headers={
"X-API-Key" : "YOUR_API_KEY" ,
"Accept" : "application/json" ,
},
)
data = response.json()
Copy const response = await fetch(
"https://api.freestyleteletech.com/v1/dial-campaigns" ,
{
headers: {
"X-API-Key" : "YOUR_API_KEY" ,
"Accept" : "application/json" ,
},
}
);
const data = await response.json();
401 — Unauthorized
{
"error" : {
"code" : "unauthorized" ,
"message" : "Invalid or missing API key."
}
}
GET /dial-campaigns
cURL
PHP
Python
Node.js
Copy curl -X GET \
"https://api.freestyleteletech.com/v1/dial-campaigns?page=1&status=active" \
-H "X-API-Key: YOUR_API_KEY"
Copy $params = http_build_query(['page' =>1 ,'status' =>'active' ]);
$ch = curl_init();
curl_setopt_array($ch ,[
CURLOPT_URL=>"https://api.freestyleteletech.com/v1/dial-campaigns?{$params}" ,
CURLOPT_RETURNTRANSFER=>true ,
CURLOPT_HTTPHEADER=>['X-API-Key: YOUR_API_KEY' ],
]);
$data =json_decode(curl_exec($ch ),true );
curl_close($ch );
Copy response = requests.get(
"https://api.freestyleteletech.com/v1/dial-campaigns" ,
headers={"X-API-Key" :"YOUR_API_KEY" },
params={"page" :1 ,"status" :"active" },
)
campaigns = response.json()["data" ]
Copy const url = new URL("https://api.freestyleteletech.com/v1/dial-campaigns" );
url.searchParams.set("page" ,"1" );
url.searchParams.set("status" ,"active" );
const {data} = await fetch(url,{
headers:{"X-API-Key" :"YOUR_API_KEY" }
}).then(r=>r.json());
200 — Response
{
"data" : [
{
"id" : "c_a1b2c3d4-..." ,
"name" : "Q2 Outreach" ,
"status" : "active" ,
"total_leads" : 4820 ,
"dialed" : 3104 ,
"remaining" : 1716
}
],
"meta" : {
"page" : 1 ,
"per_page" : 25 ,
"total" : 8 ,
"total_pages" : 1
}
}
PATCH /dial-campaigns/{id}
cURL
PHP
Python
Node.js
Copy curl -X PATCH \
"https://api.freestyleteletech.com/v1/dial-campaigns/c_a1b2c3d4-..." \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"status":"active"}'
Copy $ch = curl_init();
curl_setopt_array($ch , [
CURLOPT_URL => 'https://api.freestyleteletech.com/v1/dial-campaigns/c_a1b2c3d4-...' ,
CURLOPT_CUSTOMREQUEST => 'PATCH' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_POSTFIELDS => json_encode(['status' => 'active' ]),
CURLOPT_HTTPHEADER => [
'X-API-Key: YOUR_API_KEY' ,
'Content-Type: application/json' ,
],
]);
$data = json_decode(curl_exec($ch ), true );
curl_close($ch );
Copy response = requests.patch(
"https://api.freestyleteletech.com/v1/dial-campaigns/c_a1b2c3d4-..." ,
headers={"X-API-Key" : "YOUR_API_KEY" },
json={"status" : "active" },
)
campaign = response.json()["data" ]
Copy const {data} = await fetch(
"https://api.freestyleteletech.com/v1/dial-campaigns/c_a1b2c3d4-..." ,
{
method: "PATCH" ,
headers: {
"X-API-Key" : "YOUR_API_KEY" ,
"Content-Type" : "application/json" ,
},
body: JSON.stringify({status: "active" }),
}
).then(r => r.json());
200 — Response
{
"data" : {
"id" : "c_a1b2c3d4-..." ,
"name" : "Q2 Outreach" ,
"status" : "active" ,
"total_leads" : 4820 ,
"dialed" : 3104 ,
"remaining" : 1716
}
}
POST /dial-campaigns/{id}/data
cURL
PHP
Python
Node.js
Copy curl -X POST \
"https://api.freestyleteletech.com/v1/dial-campaigns/c_a1b2c3d4-.../data" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"records":[
{
"phone1":"4165550100",
"account_name":"Jane Smith",
"account_id":"ACC-00123",
"email":"jane@example.com",
"amount":1250.00,
"language":"en"
}
]}'
Copy $records = [
[
'phone1' => '4165550100' ,
'account_name' => 'Jane Smith' ,
'account_id' => 'ACC-00123' ,
'email' => 'jane@example.com' ,
'amount' => 1250.00 ,
'language' => 'en' ,
],
];
$ch = curl_init();
curl_setopt_array($ch , [
CURLOPT_URL => 'https://api.freestyleteletech.com/v1/dial-campaigns/c_a1b2c3d4-.../data' ,
CURLOPT_POST => true ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_POSTFIELDS => json_encode(['records' => $records ]),
CURLOPT_HTTPHEADER => [
'X-API-Key: YOUR_API_KEY' ,
'Content-Type: application/json' ,
],
]);
$result = json_decode(curl_exec($ch ), true );
curl_close($ch );
Copy response = requests.post(
"https://api.freestyleteletech.com/v1/dial-campaigns/c_a1b2c3d4-.../data" ,
headers={"X-API-Key" : "YOUR_API_KEY" },
json={"records" : [
{
"phone1" : "4165550100" ,
"account_name" : "Jane Smith" ,
"account_id" : "ACC-00123" ,
"amount" : 1250.00 ,
"language" : "en" ,
}
]},
)
result = response.json()["data" ]
Copy const {data} = await fetch(
"https://api.freestyleteletech.com/v1/dial-campaigns/c_a1b2c3d4-.../data" ,
{
method: "POST" ,
headers: {
"X-API-Key" : "YOUR_API_KEY" ,
"Content-Type" : "application/json" ,
},
body: JSON.stringify({records: [
{phone1: "4165550100" , account_name: "Jane Smith" , amount: 1250.00 }
]}),
}
).then(r => r.json());
200 — Response
{
"data" : {
"inserted" : 150 ,
"skipped" : 2 ,
"total_leads" : 4970 ,
"errors" : [
"Record 3: phone1 is required." ,
"Record 7: phone1 is required."
]
}
}
GET /dial-campaigns/{id}/results
cURL
PHP
Python
Node.js
Copy curl \
"https://api.freestyleteletech.com/v1/dial-campaigns/c_a1b2c3d4-.../results?from=2025-01-01&to=2025-01-31&page=1" \
-H "X-API-Key: YOUR_API_KEY"
Copy $ch = curl_init();
curl_setopt_array($ch , [
CURLOPT_URL => 'https://api.freestyleteletech.com/v1/dial-campaigns/c_a1b2c3d4-.../results?from=2025-01-01&to=2025-01-31' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_HTTPHEADER => ['X-API-Key: YOUR_API_KEY' ],
]);
$data = json_decode(curl_exec($ch ), true )['data' ];
curl_close($ch );
Copy response = requests.get(
"https://api.freestyleteletech.com/v1/dial-campaigns/c_a1b2c3d4-.../results" ,
headers={"X-API-Key" : "YOUR_API_KEY" },
params={"from" : "2025-01-01" , "to" : "2025-01-31" , "page" : 1 },
)
results = response.json()["data" ]
Copy const url = new URL("https://api.freestyleteletech.com/v1/dial-campaigns/c_a1b2c3d4-.../results" );
url.searchParams.set("from" , "2025-01-01" );
url.searchParams.set("to" , "2025-01-31" );
const {data} = await fetch(url, {
headers: {"X-API-Key" : "YOUR_API_KEY" },
}).then(r => r.json());
200 — Response
{
"data" : [
{
"result_id" : 982341 ,
"campaign_data_id" : 10042 ,
"account_id" : "ACC-00123" ,
"account_name" : "Jane Smith" ,
"phone_dialed" : "4165550100" ,
"phone_number_index" : 0 ,
"disposition" : {
"id" : 3 ,
"name" : "Live Transfer" ,
"code" : "LT" ,
"contacted" : true
},
"agent_id" : 57 ,
"dialed_at" : "2025-01-15T14:32:00Z" ,
"connected_at" : "2025-01-15T14:32:08Z" ,
"completed_at" : "2025-01-15T14:35:47Z" ,
"talk_seconds" : 219 ,
"total_seconds" : 227 ,
"amount" : null ,
"dtmf" : null ,
"recording_id" : "RE1a2b3c4d..." ,
"new_phone" : null ,
"new_email" : null
}
],
"meta" : {
"page" : 1 ,
"per_page" : 50 ,
"total" : 4820 ,
"total_pages" : 97
}
}
GET /dial-campaigns/{id}/results/summary
cURL
PHP
Python
Node.js
Copy curl \
"https://api.freestyleteletech.com/v1/dial-campaigns/c_a1b2c3d4-.../results/summary" \
-H "X-API-Key: YOUR_API_KEY"
Copy $ch = curl_init();
curl_setopt_array($ch , [
CURLOPT_URL => 'https://api.freestyleteletech.com/v1/dial-campaigns/c_a1b2c3d4-.../results/summary' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_HTTPHEADER => ['X-API-Key: YOUR_API_KEY' ],
]);
$summary = json_decode(curl_exec($ch ), true )['data' ];
curl_close($ch );
Copy response = requests.get(
"https://api.freestyleteletech.com/v1/dial-campaigns/c_a1b2c3d4-.../results/summary" ,
headers={"X-API-Key" : "YOUR_API_KEY" },
)
summary = response.json()["data" ]
Copy const {data} = await fetch(
"https://api.freestyleteletech.com/v1/dial-campaigns/c_a1b2c3d4-.../results/summary" ,
{headers: {"X-API-Key" : "YOUR_API_KEY" }},
).then(r => r.json());
200 — Response
{
"data" : {
"total_calls" : 4820 ,
"total_contacts" : 1206 ,
"contact_rate" : 25.02 ,
"total_talk_seconds" : 284130 ,
"total_dial_seconds" : 301440 ,
"first_call_at" : "2025-01-02T08:14:00Z" ,
"last_call_at" : "2025-01-31T20:58:00Z" ,
"date_range" : {
"from" : null ,
"to" : null
},
"dispositions" : [
{
"id" : 5 ,
"name" : "No Answer" ,
"code" : "NA" ,
"contacted" : false ,
"count" : 2891 ,
"percentage" : 59.98
},
{
"id" : 3 ,
"name" : "Live Transfer" ,
"code" : "LT" ,
"contacted" : true ,
"count" : 1206 ,
"percentage" : 25.02
}
]
}
}
GET /dial-campaigns/{id}/activity
cURL
PHP
Python
Node.js
Copy curl \
"https://api.freestyleteletech.com/v1/dial-campaigns/c_a1b2c3d4-.../activity" \
-H "X-API-Key: YOUR_API_KEY"
Copy $ch = curl_init();
curl_setopt_array($ch , [
CURLOPT_URL => 'https://api.freestyleteletech.com/v1/dial-campaigns/c_a1b2c3d4-.../activity' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_HTTPHEADER => ['X-API-Key: YOUR_API_KEY' ],
]);
$events = json_decode(curl_exec($ch ), true )['data' ];
curl_close($ch );
Copy response = requests.get(
"https://api.freestyleteletech.com/v1/dial-campaigns/c_a1b2c3d4-.../activity" ,
headers={"X-API-Key" : "YOUR_API_KEY" },
)
events = response.json()["data" ]
Copy const {data} = await fetch(
"https://api.freestyleteletech.com/v1/dial-campaigns/c_a1b2c3d4-.../activity" ,
{headers: {"X-API-Key" : "YOUR_API_KEY" }},
).then(r => r.json());
200 — Response
{
"data" : [
{
"activity_id" : 412 ,
"type" : {
"id" : 1 ,
"name" : "Records Imported"
},
"imported_count" : 4820 ,
"recycled_count" : 42 ,
"excluded_count" : 138 ,
"total_count" : 5000 ,
"created_at" : "2025-01-02T14:30:00Z"
},
{
"activity_id" : 413 ,
"type" : {
"id" : 3 ,
"name" : "Campaign Started"
},
"imported_count" : null ,
"recycled_count" : null ,
"excluded_count" : null ,
"total_count" : null ,
"created_at" : "2025-01-02T14:35:00Z"
},
{
"activity_id" : 419 ,
"type" : {
"id" : 4 ,
"name" : "Records Recycled"
},
"imported_count" : null ,
"recycled_count" : 310 ,
"excluded_count" : null ,
"total_count" : 715 ,
"created_at" : "2025-01-15T08:00:00Z"
}
],
"meta" : {
"page" : 1 ,
"per_page" : 50 ,
"total" : 8 ,
"total_pages" : 1
}
}
GET /sms-campaigns
cURL
PHP
Python
Node.js
Copy curl \
"https://api.freestyleteletech.com/v1/sms-campaigns" \
-H "X-API-Key: YOUR_API_KEY"
Copy $ch = curl_init();
curl_setopt_array($ch , [
CURLOPT_URL => 'https://api.freestyleteletech.com/v1/sms-campaigns' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_HTTPHEADER => ['X-API-Key: YOUR_API_KEY' ],
]);
$campaigns = json_decode(curl_exec($ch ), true )['data' ];
curl_close($ch );
Copy response = requests.get(
"https://api.freestyleteletech.com/v1/sms-campaigns" ,
headers={"X-API-Key" : "YOUR_API_KEY" },
)
campaigns = response.json()["data" ]
Copy const {data} = await fetch(
"https://api.freestyleteletech.com/v1/sms-campaigns" ,
{headers: {"X-API-Key" : "YOUR_API_KEY" }},
).then(r => r.json());
200 — Response
{
"data" : [
{
"id" : "sc_a1b2c3d4-..." ,
"name" : "January SMS Blast" ,
"from_number" : "+14165550100" ,
"total_runs" : 5 ,
"running_count" : 0 ,
"scheduled_count" : 1 ,
"completed_count" : 4 ,
"cancelled_count" : 0 ,
"last_run_at" : "2025-01-20T18:00:00Z" ,
"created_at" : "2025-01-02T10:00:00Z" ,
"updated_at" : null
}
],
"meta" : {
"page" : 1 ,
"per_page" : 50 ,
"total" : 3 ,
"total_pages" : 1
}
}
GET /sms-campaigns/{id}
cURL
PHP
Python
Node.js
Copy curl \
"https://api.freestyleteletech.com/v1/sms-campaigns/sc_a1b2c3d4-..." \
-H "X-API-Key: YOUR_API_KEY"
Copy $ch = curl_init();
curl_setopt_array($ch , [
CURLOPT_URL => 'https://api.freestyleteletech.com/v1/sms-campaigns/sc_a1b2c3d4-...' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_HTTPHEADER => ['X-API-Key: YOUR_API_KEY' ],
]);
$campaign = json_decode(curl_exec($ch ), true )['data' ];
curl_close($ch );
Copy response = requests.get(
"https://api.freestyleteletech.com/v1/sms-campaigns/sc_a1b2c3d4-..." ,
headers={"X-API-Key" : "YOUR_API_KEY" },
)
campaign = response.json()["data" ]
Copy const {data} = await fetch(
"https://api.freestyleteletech.com/v1/sms-campaigns/sc_a1b2c3d4-..." ,
{headers: {"X-API-Key" : "YOUR_API_KEY" }},
).then(r => r.json());
200 — Response
{
"data" : {
"id" : "sc_a1b2c3d4-..." ,
"name" : "January SMS Blast" ,
"template" : "Hi {Name}, your balance of ${Balance} is due on {DueDate}." ,
"from_number" : "+14165550100" ,
"total_runs" : 5 ,
"running_count" : 0 ,
"scheduled_count" : 1 ,
"completed_count" : 4 ,
"cancelled_count" : 0 ,
"last_run_at" : "2025-01-20T18:00:00Z" ,
"created_at" : "2025-01-02T10:00:00Z" ,
"updated_at" : null
}
}
GET /sms-campaigns/{id}/runs
cURL
PHP
Python
Node.js
Copy curl \
"https://api.freestyleteletech.com/v1/sms-campaigns/sc_a1b2c3d4-.../runs" \
-H "X-API-Key: YOUR_API_KEY"
Copy $ch = curl_init();
curl_setopt_array($ch , [
CURLOPT_URL => 'https://api.freestyleteletech.com/v1/sms-campaigns/sc_a1b2c3d4-.../runs' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_HTTPHEADER => ['X-API-Key: YOUR_API_KEY' ],
]);
$runs = json_decode(curl_exec($ch ), true )['data' ];
curl_close($ch );
Copy response = requests.get(
"https://api.freestyleteletech.com/v1/sms-campaigns/sc_a1b2c3d4-.../runs" ,
headers={"X-API-Key" : "YOUR_API_KEY" },
params={"status" : "completed" },
)
runs = response.json()["data" ]
Copy const {data} = await fetch(
"https://api.freestyleteletech.com/v1/sms-campaigns/sc_a1b2c3d4-.../runs" ,
{headers: {"X-API-Key" : "YOUR_API_KEY" }},
).then(r => r.json());
200 — Response
{
"data" : [
{
"run_id" : 42 ,
"status" : "completed" ,
"scheduled_at" : "2025-01-15T18:00:00Z" ,
"started_at" : "2025-01-15T18:00:05Z" ,
"completed_at" : "2025-01-15T18:43:11Z" ,
"total" : 1500 ,
"processed" : 1500 ,
"sent" : 1472 ,
"failed" : 28 ,
"progress_pct" : 100.0 ,
"notes" : null ,
"created_at" : "2025-01-14T09:30:00Z"
}
],
"meta" : {
"page" : 1 ,
"per_page" : 50 ,
"total" : 4 ,
"total_pages" : 1
}
}
GET /sms-campaigns/{id}/messages
cURL
PHP
Python
Node.js
Copy curl \
"https://api.freestyleteletech.com/v1/sms-campaigns/sc_a1b2c3d4-.../messages?from=2025-01-01&to=2025-01-31" \
-H "X-API-Key: YOUR_API_KEY"
Copy $ch = curl_init();
curl_setopt_array($ch , [
CURLOPT_URL => 'https://api.freestyleteletech.com/v1/sms-campaigns/sc_a1b2c3d4-.../messages?status=delivered' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_HTTPHEADER => ['X-API-Key: YOUR_API_KEY' ],
]);
$result = json_decode(curl_exec($ch ), true );
curl_close($ch );
Copy response = requests.get(
"https://api.freestyleteletech.com/v1/sms-campaigns/sc_a1b2c3d4-.../messages" ,
headers={"X-API-Key" : "YOUR_API_KEY" },
params={"from" : "2025-01-01" , "to" : "2025-01-31" , "status" : "delivered" },
)
result = response.json()
Copy const url = new URL("https://api.freestyleteletech.com/v1/sms-campaigns/sc_a1b2c3d4-.../messages" );
url.searchParams.set("from" , "2025-01-01" );
url.searchParams.set("to" , "2025-01-31" );
const result = await fetch(url, {
headers: {"X-API-Key" : "YOUR_API_KEY" },
}).then(r => r.json());
200 — Response
{
"data" : [
{
"message_id" : 80241 ,
"run_id" : 42 ,
"direction" : "sent" ,
"phone_number" : "4165550100" ,
"from_number" : "+14165559999" ,
"to_number" : "+14165550100" ,
"message" : "Hi Jane, your balance of $1,250.00 is due Jan 31." ,
"status" : "delivered" ,
"error_code" : null ,
"error_message" : null ,
"segments" : 1 ,
"cost" : 0.0075 ,
"reference_id" : "ACC-00123" ,
"sent_at" : "2025-01-15T18:02:14Z"
}
],
"summary" : {
"total" : 1472 ,
"sent_count" : 1472 ,
"received_count" : 0 ,
"total_cost" : 11.04
},
"meta" : {
"page" : 1 ,
"per_page" : 50 ,
"total" : 1472 ,
"total_pages" : 30
}
}
GET /billing
cURL
PHP
Python
Node.js
Copy curl \
"https://api.freestyleteletech.com/v1/billing?from=2025-01-01&to=2025-01-31" \
-H "X-API-Key: YOUR_API_KEY"
Copy $ch = curl_init();
curl_setopt_array($ch , [
CURLOPT_URL => 'https://api.freestyleteletech.com/v1/billing?from=2025-01-01&to=2025-01-31' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_HTTPHEADER => ['X-API-Key: YOUR_API_KEY' ],
]);
$result = json_decode(curl_exec($ch ), true );
curl_close($ch );
Copy response = requests.get(
"https://api.freestyleteletech.com/v1/billing" ,
headers={"X-API-Key" : "YOUR_API_KEY" },
params={"from" : "2025-01-01" , "to" : "2025-01-31" },
)
result = response.json()
Copy const url = new URL("https://api.freestyleteletech.com/v1/billing" );
url.searchParams.set("from" , "2025-01-01" );
url.searchParams.set("to" , "2025-01-31" );
const result = await fetch(url, {
headers: {"X-API-Key" : "YOUR_API_KEY" },
}).then(r => r.json());
200 — Response
{
"data" : [
{
"campaign_id" : "c_a1b2c3d4-..." ,
"campaign_name" : "January Collections" ,
"duration_seconds" : 284130 ,
"hourly_rate" : 12.50 ,
"cost" : 986.56
},
{
"campaign_id" : "c_e5f6a7b8-..." ,
"campaign_name" : "February Outreach" ,
"duration_seconds" : 91800 ,
"hourly_rate" : 12.50 ,
"cost" : 318.75
}
],
"summary" : {
"total_duration_seconds" : 375930 ,
"total_cost" : 1305.31 ,
"date_range" : {
"from" : "2025-01-01" ,
"to" : "2025-01-31"
}
}
}
GET /account
cURL
PHP
Python
Node.js
Copy curl \
"https://api.freestyleteletech.com/v1/account" \
-H "X-API-Key: YOUR_API_KEY"
Copy $ch = curl_init();
curl_setopt_array($ch , [
CURLOPT_URL => 'https://api.freestyleteletech.com/v1/account' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_HTTPHEADER => ['X-API-Key: YOUR_API_KEY' ],
]);
$result = json_decode(curl_exec($ch ), true );
curl_close($ch );
Copy response = requests.get(
"https://api.freestyleteletech.com/v1/account" ,
headers={"X-API-Key" : "YOUR_API_KEY" },
)
result = response.json()
Copy const result = await fetch("https://api.freestyleteletech.com/v1/account" , {
headers: {"X-API-Key" : "YOUR_API_KEY" },
}).then(r => r.json());
200 — Response
{
"data" : {
"id" : "a1b2c3d4-e5f6-7890-abcd-ef1234567890" ,
"name" : "Acme Collections" ,
"status" : "onboarded" ,
"description" : null ,
"contacts" : {
"primary" : {
"name" : "Jane Smith" ,
"email" : "jane@example.com" ,
"phone" : "555-0100"
},
"technical" : {
"name" : "Dev Team" ,
"email" : "dev@example.com" ,
"phone" : null
},
"billing" : {
"name" : "Finance Dept" ,
"email" : "billing@example.com" ,
"phone" : "555-0199"
}
},
"location" : {
"country" : "Canada" ,
"province_state" : "British Columbia"
},
"created_at" : "2024-03-15T09:00:00+00:00"
}
}
GET /account/phone-numbers
cURL
PHP
Python
Node.js
Copy curl \
"https://api.freestyleteletech.com/v1/account/phone-numbers" \
-H "X-API-Key: YOUR_API_KEY"
Copy $ch = curl_init();
curl_setopt_array($ch , [
CURLOPT_URL => 'https://api.freestyleteletech.com/v1/account/phone-numbers' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_HTTPHEADER => ['X-API-Key: YOUR_API_KEY' ],
]);
$result = json_decode(curl_exec($ch ), true );
curl_close($ch );
Copy response = requests.get(
"https://api.freestyleteletech.com/v1/account/phone-numbers" ,
headers={"X-API-Key" : "YOUR_API_KEY" },
)
result = response.json()
Copy const result = await fetch("https://api.freestyleteletech.com/v1/account/phone-numbers" , {
headers: {"X-API-Key" : "YOUR_API_KEY" },
}).then(r => r.json());
200 — Response
{
"data" : [
{
"phone_number_id" : 42 ,
"phone_number" : "+16045550100" ,
"type" : {
"id" : 1 ,
"name" : "Outbound Caller ID"
},
"description" : "Main outbound line" ,
"neustar_branded_call_display" : true ,
"created_at" : "2024-06-01T14:30:00+00:00"
}
],
"meta" : {
"total" : 1
}
}