Skip to main content
POST
Create a procedure

Authorizations

Authorization
string
header
required

API key from your account settings

Path Parameters

agentId
string
required

The agent ID

Minimum string length: 1
Example:

"5QHA6VB-DIAbBhxwqxfdi"

Body

application/json
name
string
required

Name: 1 to 100 characters, no line breaks, unique within the agent

Required string length: 1 - 100
Pattern: ^[^\n\r]+$
Example:

"Refund a recent order"

trigger
string
required

When the agent should start the procedure, up to 500 characters

Required string length: 1 - 500
Example:

"The customer asks for a refund"

steps
object[]
required

The steps in order. An instruction step is one line; in it @ plus an action name in lowercase, with - written as _, mentions that action (Order-Issue becomes @order_issue), and {{variable}} inserts one of the agent's variables. A branch step runs the instructions of its first matching condition (1 to 5), or else otherwise; a branch cannot contain another branch. Up to 15 instruction steps in total, counting those inside branches.

Minimum array length: 1

Response

The created procedure

id
string
required

Procedure ID

name
string
required

Procedure name, unique within the agent

status
enum<string>
required

Whether the agent can run the procedure.

Available options:
enabled,
disabled
trigger
string
required

When the agent should start the procedure

Example:

"The customer asks for a refund"

unavailableActions
string[]
required

Action mentions in the steps, such as @refund_payment, whose action is missing or disabled. While any is listed, the agent skips the procedure. It also skips the procedure on a channel where a mentioned action is switched off.

Example:
steps
object[]
required

The steps in order.