Login / Register
POST
/api/public/v1/call-scripts

Create 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 with the node endpoints, or in one write with the tree endpoint.

Required scope

The access token must carry this scope. A token missing it gets 403 Forbidden. Grant them to an API client under Dev Tools → API, to an assistant or CLI sign-in when you approve or edit it under Dev Tools, and to a teammate under Employee → Permissions.

call-scripts:write

Request Body

PropertyTypeDescription
locationIdstringThe location.
namestring
descriptionstringWhen to use it.
firstStatementstringWhat 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.

xRM → Scripts
/xrm/scripts
  1. Open Scripts.
  2. New script.