Skip to main content

Intents API

List All Intents

tenant_id
string
required
The ID of the tenant
curl -X GET \
  'https://a.messageflow.ai/api/v1/intents?tenant_id=123' \
  -H 'Authorization: Bearer YOUR_AUTH_TOKEN'
[
  {
    "id": 1,
    "name": "Example Intent",
    "display_name": "Example Intent Display",
    "intent_type": 1,
    "parent_id": null,
    "ai_prompt_id": 1,
    "forward_number": "+1234567890",
    "speak": "Speaking text"
  }
]

Get Intent Details

id
string
required
The ID of the intent
tenant_id
string
required
The ID of the tenant
curl -X GET \
  'https://a.messageflow.ai/api/v1/intents/1?tenant_id=123' \
  -H 'Authorization: Bearer YOUR_AUTH_TOKEN'
{
  "id": 1,
  "name": "Example Intent",
  "display_name": "Example Intent Display",
  "intent_type": 1,
  "parent_id": null,
  "ai_prompt_id": 1,
  "forward_number": "+1234567890",
  "speak": "Speaking text",
  "ai_actions": [
    {
      "id": 1,
      "name": "Example Action",
      "action_type": 1
    }
  ],
  "tenant_id": 123
}

Create New Intent

tenant_id
string
required
The ID of the tenant
intent[name]
string
required
Name of the intent
intent[display_name]
string
Display name of the intent
intent[intent_type]
number
required
Type of intent
intent[parent_id]
number
ID of the parent intent
intent[ai_prompt_id]
number
ID of the AI prompt
intent[forward_number]
string
Number to forward to
intent[speak]
string
Text to speak
curl -X POST \
  'https://a.messageflow.ai/api/v1/intents?tenant_id=123' \
  -H 'Authorization: Bearer YOUR_AUTH_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "intent": {
      "name": "New Intent",
      "display_name": "New Intent Display",
      "intent_type": 1,
      "ai_prompt_id": 1,
      "forward_number": "+1234567890",
      "speak": "New speaking text"
    }
  }'
{
  "id": 2,
  "name": "New Intent",
  "display_name": "New Intent Display",
  "intent_type": 1,
  "parent_id": null,
  "ai_prompt_id": 1,
  "forward_number": "+1234567890",
  "speak": "New speaking text",
  "tenant_id": 123
}

Update Intent

id
string
required
The ID of the intent
tenant_id
string
required
The ID of the tenant
curl -X PUT \
  'https://a.messageflow.ai/api/v1/intents/1?tenant_id=123' \
  -H 'Authorization: Bearer YOUR_AUTH_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "intent": {
      "name": "Updated Intent",
      "display_name": "Updated Intent Display",
      "intent_type": 1,
      "ai_prompt_id": 1,
      "forward_number": "+1234567890",
      "speak": "Updated speaking text"
    }
  }'
{
  "id": 1,
  "name": "Updated Intent",
  "display_name": "Updated Intent Display",
  "intent_type": 1,
  "parent_id": null,
  "ai_prompt_id": 1,
  "forward_number": "+1234567890",
  "speak": "Updated speaking text",
  "tenant_id": 123
}

Delete Intent

id
string
required
The ID of the intent
tenant_id
string
required
The ID of the tenant
curl -X DELETE \
  'https://a.messageflow.ai/api/v1/intents/1?tenant_id=123' \
  -H 'Authorization: Bearer YOUR_AUTH_TOKEN'
{
  "status": "Intent 1 deleted"
}

HTTP Status Codes

  • 200: Success
  • 201: Created
  • 400: Bad Request
  • 401: Unauthorized
  • 404: Not Found
  • 422: Unprocessable Entity

Intent Configuration

The intent configuration includes:
  • Name and display name
  • Intent type
  • Parent intent (for hierarchical structure)
  • AI prompt association
  • Forward number
  • Speaking text
  • Associated AI actions

Intent Types

  • 1: Standard Intent
  • 2: Group Intent