PUT
/
v1
/
actions
/
{action_id}
curl --request PUT \
  --url https://api.trata.ai/v1/actions/{action_id} \
  --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"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

action_id
string
required

ID of the action

Body

application/json

Response

200
application/json

Action updated successfully

Action entity to store the actions which can be performed by ai agents