Login / Register
POST
/api/public/v1/call-scripts/{scriptId}/nodes

Add a step to a call script

Adds one step under `parentId`, or as a new root step when it is null or left out, placed after its siblings. A branch is built by adding a RESPONSE (or BRANCH_IF / BRANCH_ELSE) and then the steps under it. To write a whole script at once, use the tree endpoint instead.

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

Path Parameters

NameTypeRequiredDescription
scriptIdstringRequiredScript ID.

Request Body

PropertyTypeDescription
parentIdstringThe step this goes under, from the same script. Null for a root step.
typestringSTATEMENT, ACTION and NOTE are content — what the rep says, does, or is told. RESPONSE (what the prospect said back), BRANCH_IF and BRANCH_ELSE (a situation the rep is in) are the forks, drawn as the buttons the rep clicks to go on. A content step with no children shows inline under its parent; one with children becomes a "Continue" step.
labelstringThe short line the rep scans mid-call — the branch button’s text or the step’s heading. One line, 500 characters at most.
bodystringThe full talk track, said verbatim. Optional: a RESPONSE’s label is usually the whole thing. Send null to clear.
notestringA coaching aside shown to the rep and never spoken. Send null to clear.
outcomestringOn a step that ends the call: how it ended, which pre-fills the wrap-up. Send null to clear.
actionstringA tool the step puts in the rep’s hand: SCHEDULE_MEETING, SEND_PRICING (sends `actionUrl` to an email the rep collects) or CAPTURE_NOTE. Send null for none.
actionUrlstringThe link the action works with — the pricing page for SEND_PRICING. http or https.
POSTExample request
curl
curl -X POST "https://www.pxb.app/api/public/v1/call-scripts/{scriptId}/nodes" \
  -H "Authorization: Bearer your_access_token" \
  -H "Content-Type: application/json" \
  -d '{
    "parentId": "nod_1",
    "type": "RESPONSE",
    "label": "Yeah, what is this about?",
    "note": "Keep it light."
  }'
200Example response
json
{
  "message": "Step added successfully!",
  "content": {
    "node": {
      "id": "nod_1",
      "scriptId": "scr_6620",
      "parentId": null,
      "type": "STATEMENT",
      "order": 0,
      "label": "Hi, is now a bad time?",
      "body": null,
      "note": null,
      "outcome": null,
      "action": null,
      "actionUrl": null,
      "createdAt": "2026-06-30T08:00:00.000Z",
      "updatedAt": "2026-06-30T08:00:00.000Z"
    }
  }
}
400Example response
json
{
  "message": "Parent step not found in this script."
}

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 a script.
  2. Add a step.