curl --request POST \
--url https://api.trata.ai/v1/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "get_delivery_date",
"description": "Get the delivery date for a customer'\''s order. Call this whenever you need to know the delivery date, for example when a customer asks '\''Where is my package'\''",
"parameters": false,
"endpoint": {
"url": "http://example.com/api/action",
"method": "POST",
"headers": "application/json",
"payload": "123456"
},
"userWaitingText": "Please wait while we get the delivery date for your order",
"userSuccessText": "We have sent you an email with the delivery date",
"userErrorText": "We are unable to get the delivery date for your order",
"invocationTrigger": "user_query"
}'
{
"id": "act.1234567890",
"orgId": "org.1234567890",
"name": "Webhook on call completion.",
"description": "This action will be invoked when a call is completed. It will send a webhook to the specified url.",
"parameters": {},
"endpoint": {
"url": "https://webhook-endpoint.com",
"method": "POST"
},
"invocationTrigger": "webhook.conversation_en",
"userWaitingText": "Please wait...",
"userSuccessText": "Action completed successfully",
"userErrorText": "An error occurred",
"createdBy": "usr.1234567890",
"createdAt": "2024-12-06T19:23:38.616711",
"updatedBy": "usr.1234567890",
"updatedAt": "2024-12-06T19:23:38.616714"
}
Create a New Action
curl --request POST \
--url https://api.trata.ai/v1/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "get_delivery_date",
"description": "Get the delivery date for a customer'\''s order. Call this whenever you need to know the delivery date, for example when a customer asks '\''Where is my package'\''",
"parameters": false,
"endpoint": {
"url": "http://example.com/api/action",
"method": "POST",
"headers": "application/json",
"payload": "123456"
},
"userWaitingText": "Please wait while we get the delivery date for your order",
"userSuccessText": "We have sent you an email with the delivery date",
"userErrorText": "We are unable to get the delivery date for your order",
"invocationTrigger": "user_query"
}'
{
"id": "act.1234567890",
"orgId": "org.1234567890",
"name": "Webhook on call completion.",
"description": "This action will be invoked when a call is completed. It will send a webhook to the specified url.",
"parameters": {},
"endpoint": {
"url": "https://webhook-endpoint.com",
"method": "POST"
},
"invocationTrigger": "webhook.conversation_en",
"userWaitingText": "Please wait...",
"userSuccessText": "Action completed successfully",
"userErrorText": "An error occurred",
"createdBy": "usr.1234567890",
"createdAt": "2024-12-06T19:23:38.616711",
"updatedBy": "usr.1234567890",
"updatedAt": "2024-12-06T19:23:38.616714"
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Action created successfully
Action entity to store the actions which can be performed by ai agents