AI Actions API
List All Actions
curl -X GET \
'https://a.messageflow.ai/api/v1/ai_actions?tenant_id=123' \
-H 'Authorization: Bearer YOUR_AUTH_TOKEN'
[
{
"id": 1,
"name": "Example Action",
"action_type": 1,
"initial_announcement": "Starting action",
"initial_response": "Action completed",
"voice": "echo",
"speak": "Speaking text",
"forward_number": "+1234567890",
"integration_id": 1
}
]
Get Action Details
curl -X GET \
'https://a.messageflow.ai/api/v1/ai_actions/1?tenant_id=123' \
-H 'Authorization: Bearer YOUR_AUTH_TOKEN'
{
"id": 1,
"name": "Example Action",
"action_type": 1,
"initial_announcement": "Starting action",
"initial_response": "Action completed",
"voice": "echo",
"speak": "Speaking text",
"forward_number": "+1234567890",
"integration_id": 1,
"say_before": "Before action text",
"result_prompt": "Result prompt text",
"tenant_id": 123
}
Create New Action
ai_action[initial_announcement]
Initial announcement text
ai_action[initial_response]
Initial response text
ai_action[forward_number]
Number to forward to
ai_action[integration_id]
ID of the integration
curl -X POST \
'https://a.messageflow.ai/api/v1/ai_actions?tenant_id=123' \
-H 'Authorization: Bearer YOUR_AUTH_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"ai_action": {
"name": "New Action",
"action_type": 1,
"initial_announcement": "Starting new action",
"initial_response": "New action completed",
"voice": "echo",
"speak": "New speaking text",
"forward_number": "+1234567890",
"integration_id": 1
}
}'
{
"id": 2,
"name": "New Action",
"action_type": 1,
"initial_announcement": "Starting new action",
"initial_response": "New action completed",
"voice": "echo",
"speak": "New speaking text",
"forward_number": "+1234567890",
"integration_id": 1,
"tenant_id": 123
}
Update Action
curl -X PUT \
'https://a.messageflow.ai/api/v1/ai_actions/1?tenant_id=123' \
-H 'Authorization: Bearer YOUR_AUTH_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"ai_action": {
"name": "Updated Action",
"action_type": 1,
"initial_announcement": "Updated announcement",
"initial_response": "Updated response",
"voice": "echo",
"speak": "Updated speaking text",
"forward_number": "+1234567890",
"integration_id": 1
}
}'
{
"id": 1,
"name": "Updated Action",
"action_type": 1,
"initial_announcement": "Updated announcement",
"initial_response": "Updated response",
"voice": "echo",
"speak": "Updated speaking text",
"forward_number": "+1234567890",
"integration_id": 1,
"tenant_id": 123
}
Delete Action
curl -X DELETE \
'https://a.messageflow.ai/api/v1/ai_actions/1?tenant_id=123' \
-H 'Authorization: Bearer YOUR_AUTH_TOKEN'
{
"status": "Action 1 deleted"
}
HTTP Status Codes
- 200: Success
- 201: Created
- 400: Bad Request
- 401: Unauthorized
- 404: Not Found
- 422: Unprocessable Entity
Action Configuration
The action configuration includes:
- Name and action type
- Initial announcement and response
- Voice settings
- Speaking text
- Forward number
- Integration settings
- Say before text
- Result prompt
Action Types
- 1: Standard Action
- 2: Forward Action
- 3: Integration Action
- 4: Custom Action