POST
/api/public/v1/call-scriptsCreate a call script
Creates a script with a single opening node so the runner has somewhere to begin — `firstStatement` becomes that node’s label. The rest of the branching tree is built node by node in the console.
Required scope
The access token must carry this scope. A token missing it gets 403 Forbidden. Grant them to an API client under Settings → Company → API, and to a teammate under Employee → Permissions.
call-scripts:write
Request Body
| Property | Type | Description |
|---|---|---|
locationId | string | The location. |
name | string | |
description | string | When to use it. |
firstStatement | string | What the rep opens with. Defaults to "Opening line". |
POSTExample request
curl
curl -X POST "https://www.pxb.app/api/public/v1/call-scripts" \
-H "Authorization: Bearer your_access_token" \
-H "Content-Type: application/json" \
-d '{
"locationId": "loc_abc123",
"name": "Outbound — cold",
"firstStatement": "Hi, is now a bad time?"
}'200Example response
json
{
"message": "Call script created successfully!",
"content": {
"script": {
"id": "scr_6620",
"locationId": "loc_abc123",
"name": "Outbound — cold",
"description": "For a first call to a list lead.",
"isDefault": true,
"archivedAt": null,
"createdAt": "2026-06-30T08:00:00.000Z",
"updatedAt": "2026-08-04T08:00:00.000Z"
}
}
}In the console
The same thing done by hand, for anyone comparing the API against the screen they already use.