Replace the calls an agent may make
Replaces the agent's actions whole: an action the body leaves out is deleted. Always send
actions, even when it is empty. To add one, read the list, add to its actions and send that
object back, not the data it came in.
Live. Actions have no draft and need no publishing. A conversation uses the actions the agent had when the conversation entered it: one already talking to the agent keeps the previous ones until it enters the agent again.
Credentials are never answered in clear. To keep a stored credential, send its mask back
unchanged; any other value replaces it. The stored action is found by name. A renamed one is
found by url and method instead, among the stored actions whose name the list no longer
uses, and only when exactly one matches. A mask is kept only while the action calls the same
scheme, host and port: a new path or query keeps it, and an action moved to another origin needs
the real value. A mask that stands for no stored value is refused. A blank value is kept blank,
and the action is called with that header empty until someone fills it in.
A person can type them instead. GET /ai-agents/{agent_id}/rest_api_actions/credentials
answers a link where they fill in or replace each credential, so that no value has to pass
through you.
The builder writes the list whole too. While someone has the agent open in the builder, their next change to its actions sends the list they loaded, and can undo yours.
Needs the permission to edit bots. Counts against your brand's write limit.
Path Parameters
- Type: stringFormat: uuidagent
_id requiredThe agent, as
assistantIdnames it in anai_agentblock, in lowercase.
Body·
- Type:actionsrequiredProperties: 8
Every action the agent may call.
Responses
- application/json
- application/json
- application/json
- application/json
- application/json
- application/json
- application/json
- application/json
curl https://api.landbot.io/v3/ai-agents/123e4567-e89b-12d3-a456-426614174000/rest_api_actions \
--request PUT \
--header 'Content-Type: application/json' \
--cookie 'sessionid=YOUR_SECRET_TOKEN' \
--data '{
"actions": [
{
"name": "",
"description": "",
"parameters": {
"properties": {}
},
"url": "https://api.example.com/orders/{order_id}",
"method": "GET",
"headers": {
"additionalProperty": ""
},
"credential_headers": {
"additionalProperty": ""
},
"timeout_seconds": 10
}
]
}'
{
"data": {
"actions": [
{
"name": "string",
"description": "string",
"parameters": {
"properties": {}
},
"url": "https://api.example.com/orders/{order_id}",
"method": "GET",
"headers": {
"additionalProperty": "string"
},
"credential_headers": {
"additionalProperty": "string"
},
"timeout_seconds": 10
}
]
}
}