Create a task script

Create a task script for a copilot.

Required fields:

  • product_id
  • event
  • script (required when enabled is 1)

A copilot has one script per event. Creating a second one for the same event returns 400; update the existing script instead.

enabled defaults to 0, so the script does not run until it is enabled.

Scripts can use account secrets by name. Saving a script that uses one does not require access to view secrets.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
integer
enum

1 runs the script, 0 keeps it stored but off. Defaults to 0 on create.

Allowed:
string
enum

When the script runs. Set on create only.

  • task_started: a task session starts
  • task_finished: a task session is finished
Allowed:
integer

Product ID

string

JavaScript run on the script server

Responses

403

The caller can't edit this copilot

Language
Credentials
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json