Skip to main content

AI API

AI endpoints exposed by the Devotel CPaaS API Base path: /api/v1/ai Endpoint count: 13
The AI API also includes an embedded, org-wide Knowledge Base — not shown in the auto-generated endpoint list below. Ingest documents by upload, URL, markdown, or bulk help-center import (POST /api/v1/ai/kb/documents, POST /api/v1/ai/kb/import/help-center), keep them fresh with a staleness scorecard and per-document verification (GET /api/v1/ai/kb/staleness, POST /api/v1/ai/kb/documents/{id}/verify), and query them with raw semantic search (POST /api/v1/ai/kb/search) or a grounded answer with citations (POST /api/v1/ai/kb/answers). See the full AI Knowledge Base reference. For a separately provisioned, per-knowledge-base store, use the Knowledge Bases API.

Analyze text (sentiment / intent / language / topics)

POST /api/v1/ai/analyze
text
string
required
Text to analyze (1-10,000 chars).

Analyze a stored message by ID and persist the analysis

POST /api/v1/ai/analyze-message/{id}
id
string
required

OpenAI-compatible chat completion (general inference)

POST /api/v1/ai/chat/completions
model
string
Optional model id. OpenAI ids are remapped to the platform fast tier.
messages
object[]
required
Conversation turns (1-50).
temperature
number
max_tokens
integer
response_format
object

Classify the customer’s intent from a conversation

POST /api/v1/ai/classify-intent
conversation_id
string
required
Conversation ID to analyze.

Draft a full campaign blueprint from a plain-English goal

POST /api/v1/ai/compose-campaign
goal
string
required
Plain-English campaign goal (5-2,000 chars).
audience_segment
string (enum: champion|high_value_engaged|engaged|new|passive|at_risk|…)
audience_description
string
channels
string (enum: sms|whatsapp|email|voice)[]
tone
string (enum: professional|casual|urgent|friendly|empathetic)
brand_name
string
locale
string

Generate AI-powered dashboard insights from stats

POST /api/v1/ai/dashboard-insights

Generate embedding vectors for one or more input strings

POST /api/v1/ai/embeddings
input
any
required
Text (or array of texts) to embed.

Generate channel-appropriate message content from a prompt

POST /api/v1/ai/generate-content
prompt
string
required
Plain-English prompt (1-2,000 chars).
tone
string (enum: professional|casual|urgent|friendly)
channel
string

Improve, shorten, lengthen, or rephrase existing text

POST /api/v1/ai/improve-text
text
string
required
Text to improve (1-10,000 chars).
action
string (enum: improve|shorter|longer|change_tone|fix_grammar|rephrase)
required
tone
string

Recommend the optimal channel + fallbacks for a recipient

POST /api/v1/ai/optimize-channel
to
string
required
Recipient identifier (E.164 phone or email).
message_type
string (enum: marketing|transactional|otp)
goal
string (enum: cheapest|fastest|highest_engagement|balanced)
available_channels
string[]

Generate AI-suggested replies for a conversation

POST /api/v1/ai/suggest-reply
conversation_id
string
required
Conversation ID to analyze.

Summarize a conversation thread

POST /api/v1/ai/summarize-conversation
conversation_id
string
required
Conversation ID to analyze.

Translate text to a target language

POST /api/v1/ai/translate
text
string
required
Text to translate (1-10,000 chars).
target_language
string
required
Target language name or ISO 639-1 code.