Chatbot Operations
Add an action
Adds a new action to the specified chatbot. Top-level fields are checked (see the 400 response); headers, pathParams, queryParams and bodyParams items are stored as sent, without schema checks. An api action is also tested before it is saved: Chat Data sends a request to its url, filling each parameter with its example value, and rejects the action if that request fails.
mcp actions cannot be added with this endpoint. A new action is enabled unless enabled is false; enabled actions count toward your plan's action limit.
post/add-action
Request
- Base URL: https://api.chat-data.com/api/v2
- URL: https://api.chat-data.com/api/v2/add-action
- Auth: HTTP bearer
Request body
Example request
{
"chatbotId": "6650f1c2a9e4b83d2c7a1f05",
"action": {
"name": "stockPriceLookup",
"description": "The user wants to know the current stock price of a company",
"type": "api",
"url": "https://api.example.com/stocks/{symbol}/price",
"method": "GET",
"headers": [
{
"name": "Authorization",
"value": "Bearer stk_live_3f9a2c7d1e"
}
],
"pathParams": [
{
"name": "symbol",
"type": "string",
"description": "The stock ticker symbol to look up.",
"required": true,
"example": "AAPL"
}
]
}
}Response
Action successfully added.
Example response
{
"status": "success",
"action": {
"index": 0,
"name": "stockPriceLookup",
"description": "The user wants to know the current stock price of a company",
"type": "api",
"url": "https://api.example.com/stocks/{symbol}/price",
"method": "GET",
"headers": [
{
"name": "Authorization",
"value": "Bearer stk_live_3f9a2c7d1e"
}
],
"pathParams": [
{
"name": "symbol",
"type": "string",
"description": "The stock ticker symbol to look up.",
"required": true,
"example": "AAPL"
}
],
"return_file": false
}
}Changes
No recorded changes to this operation across all 1 revision of this API.