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 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

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.