API reference

Call Scripts

The contact centre's call scripts: Markdown guides for the people taking calls, with their files and who they are shared with. List and read them with their version history, create, change, copy and delete them. A change employees should notice raises the script's version, which marks it as updated in their portal. 7 endpoints. Add your API key in the authentication panel to send test requests from this page.

List call scripts

GET/api/external/v1/call-scripts

The workspace's call scripts, most recently changed first. Each item: id, name, description, words, attachments (files: id, name, contentType, size, url), who it is shared with (subUserIds, teamIds, teamNames, groupIds, groupNames), audience (people the shares reach) and readers (those of them who opened the current version), tasks (trainings showing it), version (what employees see; raised by content, name, description or file changes), historyVersion (the latest saved version, the baseVersion of a next change), contentUpdatedAt, createdAt, updatedAt. The list leaves content and people out; read one script for them.

Answers {items}.

Responses

  • 200OK

Create a call script

POST/api/external/v1/call-scripts

Adds a script: one more against the plan's call-script limit, as on the page.

Fields: name (required), description, content (Markdown, up to 200,000 characters), attachments (files already uploaded to the workspace, each {url, name} with url an /api/uploads/... address of the workspace's own; up to 20), and who it is shared with: subUserIds (employees), teamIds (Performance teams). Ids that are not the workspace's are dropped.

Answers 201 with the script.

Errors: 400 INVALID_CALL_SCRIPT (no name, content too long, a file that is not the workspace's); 409 PLAN_LIMIT_REACHED.

Request body application/json

  • namestring
  • descriptionstring
  • contentstring
  • attachmentsarray of AttachmentInput
  • subUserIdsarray of string (uuid)
  • groupIdsarray of string (uuid)
  • teamIdsarray of string (uuid)
  • baseVersioninteger (int32)
  • notestring

Responses

  • 200OK

Read a call script

GET/api/external/v1/call-scripts/{scriptId}

One script with its Markdown content and people (the employees it is shared with directly), besides the fields of the list.

Errors: 404 CALL_SCRIPT_NOT_FOUND.

Parameters

  • scriptIdstring (uuid)pathRequired

Responses

  • 200OK

Change a call script

PATCH/api/external/v1/call-scripts/{scriptId}

Changes the fields sent; a field left out (or null) keeps its value, and a list sent replaces the script's (send [] to empty it). Fields as in create, plus baseVersion (the historyVersion the change was made from) and note (why this version exists, kept in the history).

A save over a newer version than baseVersion is refused (someone else saved meanwhile) unless force=true. A change to the content, name, description or files raises version, which shows the script as updated to the employees it is shared with.

Answers 200 with the script.

Errors: 404 CALL_SCRIPT_NOT_FOUND; 400 INVALID_CALL_SCRIPT; 409 VERSION_CONFLICT.

Parameters

  • scriptIdstring (uuid)pathRequired
  • forcebooleanquery

    Save even when the script was saved after baseVersion.

Request body application/json

  • namestring
  • descriptionstring
  • contentstring
  • attachmentsarray of AttachmentInput
  • subUserIdsarray of string (uuid)
  • groupIdsarray of string (uuid)
  • teamIdsarray of string (uuid)
  • baseVersioninteger (int32)
  • notestring

Responses

  • 200OK

Delete a call script

DELETE/api/external/v1/call-scripts/{scriptId}

Deletes the script with its history; its files are removed once no other script uses them. Trainings that showed it keep working without it.

Answers 204.

Errors: 404 CALL_SCRIPT_NOT_FOUND.

Parameters

  • scriptIdstring (uuid)pathRequired

Responses

  • 200OK

Copy a call script

POST/api/external/v1/call-scripts/{scriptId}/duplicate

Makes a copy named "Copy of " with the same content and files, shared with no one: one more against the plan's call-script limit.

Answers 201 with the copy.

Errors: 404 CALL_SCRIPT_NOT_FOUND; 409 PLAN_LIMIT_REACHED.

Parameters

  • scriptIdstring (uuid)pathRequired

Responses

  • 200OK

Read a call script's history

GET/api/external/v1/call-scripts/{scriptId}/versions

Every saved version of the script, newest first: versionNumber, createdAt, editedByUserId and editedByEmail, note ("Created", "Restored from version 3"), snapshot (the script as it was then), changedElements (what changed against the version before) and newForEmployees (whether it raised the version employees see).

Answers {items}.

Errors: 404 CALL_SCRIPT_NOT_FOUND.

Parameters

  • scriptIdstring (uuid)pathRequired

Responses

  • 200OK