AI Prompts API
List All Prompts
The ID of the tenant. If you leave it blank, it will use the tenant id of the user you are logged in as.
curl -X GET \
'https://a.messageflow.ai/api/v1/ai_prompts?tenant_id=123' \
-H 'Authorization: Bearer YOUR_AUTH_TOKEN'
[
{
"name": "Example Prompt",
"id": 1,
"description": "A sample prompt",
"prompt_type": 1,
"group": "General",
"mode": 1
}
]
Get Prompt Details
curl -X GET \
'https://a.messageflow.ai/api/v1/ai_prompts/1?tenant_id=123' \
-H 'Authorization: Bearer YOUR_AUTH_TOKEN'
{
"name": "Example Prompt",
"id": 1,
"description": "A sample prompt",
"prompt_type": 1,
"group": "General",
"mode": 1,
"user_prompt": "Your prompt text here",
"system": "System instructions",
"assistant": "Assistant response template",
"user_name": "User name",
"temparature": 0.7,
"max_tokens": 1000,
"ai_model": "gpt-4o",
"settings": "{}",
"function_defs": "[]",
"next_prompt_id": null,
"exit_prompt_id": null,
"prompt_mode": 1,
"voice": "echo",
"initial_announcement": null,
"initial_response": "Initial response text"
}
Create New Prompt
Description of the prompt
Type of prompt (default: 1)
Assistant response template
curl -X POST \
'https://a.messageflow.ai/api/v1/ai_prompts?tenant_id=123' \
-H 'Authorization: Bearer YOUR_AUTH_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"prompt": {
"name": "New Prompt",
"description": "A new prompt",
"prompt_type": 1,
"group": "General",
"mode": 1,
"user_prompt": "Your prompt text",
"system": "System instructions",
"assistant": "Assistant template",
"temparature": 0.7,
"max_tokens": 1000,
"ai_model": "gpt-4o"
}
}'
{
"id": 2,
"name": "New Prompt",
"status": "created"
}
Update Prompt
curl -X PUT \
'https://a.messageflow.ai/api/v1/ai_prompts/1?tenant_id=123' \
-H 'Authorization: Bearer YOUR_AUTH_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"prompt": {
"name": "Updated Prompt",
"description": "Updated description",
"temparature": 0.8
}
}'
{
"name": "Updated Prompt",
"id": 1,
"description": "Updated description",
"prompt_type": 1,
"group": "General",
"mode": 1,
"user_prompt": "Your prompt text here",
"system": "System instructions",
"assistant": "Assistant response template",
"user_name": "User name",
"temparature": 0.8,
"max_tokens": 1000,
"ai_model": "gpt-4o",
"settings": "{}",
"function_defs": "[]",
"next_prompt_id": null,
"exit_prompt_id": null,
"prompt_mode": 1,
"voice": "echo",
"initial_announcement": null,
"initial_response": "Initial response text"
}
Delete Prompt
curl -X DELETE \
'https://a.messageflow.ai/api/v1/ai_prompts/1?tenant_id=123' \
-H 'Authorization: Bearer YOUR_AUTH_TOKEN'
{
"status": "Prompt deleted successfully"
}
Test Prompt
The text to test with the prompt
Additional parameters for the prompt
curl -X POST \
'https://a.messageflow.ai/api/v1/ai_prompts/1/test_prompt?tenant_id=123' \
-H 'Authorization: Bearer YOUR_AUTH_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"prompt_text": "Your test question here",
"prompt_params": {
"param1": "value1",
"param2": "value2"
}
}'
{
"response": "AI response text",
"altered_prompt": "Modified prompt text",
"next_prompt_id": 2,
"next_prompt_params": {
"param1": "value1",
"param2": "value2"
}
}
HTTP Status Codes
- 200: Success
- 201: Created
- 400: Bad Request
- 401: Unauthorized
- 404: Not Found
- 422: Unprocessable Entity
Prompt Types
- 1: Standard prompt (PROMPT_TYPE_PROMPT)
- 2: Group prompt (PROMPT_TYPE_GROUP)
- 3: API prompt (PROMPT_TYPE_API)
- 4: Data analysis prompt (PROMPT_TYPE_DATA)
- 5: Data summary analysis prompt (PROMPT_TYPE_DATA_SUMMARY)
Prompt Modes
- 1: Activated (PROMPT_MODE_ACTIVATED)
- 2: Deactivated (PROMPT_MODE_DEACTIVATED)
- 3: Simulated (PROMPT_MODE_SIMULATED)
Voice Options
- alloy
- ash
- ballad
- coral
- echo
- sage
- shimmer
- verse