Documentation
API Reference

Actions API

Define and trigger custom action tools.

Register action#

Declare a new custom action schema that your agent can trigger when matching user intents are detected:

POST/v1/actions

Request

BASH
curl -X POST \
  -H "Authorization: Bearer tc_live_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "shopify.getOrderStatus",
    "description": "Fetch status details for a customer order",
    "url": "https://api.yourstore.com/orders/status",
    "parameters": {
      "type": "object",
      "properties": {
        "orderId": { "type": "number" }
      },
      "required": ["orderId"]
    }
  }' \
  https://api.trained.chat/v1/actions

Response

JSON
{
  "id": "action_order_status_check",
  "name": "shopify.getOrderStatus",
  "status": "active"
}