Skip to main content

AI API

AI endpoints exposed by the Devotel CPaaS API Base path: /api/v1/ai Endpoint count: 13

title: “AI Knowledge Base endpoints (ingest, refresh, search)” description: “Curated note covering the embedded org-wide knowledge base in the AI API, with endpoints for document ingest, staleness scoring, and grounded search.”

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
Run the platform LLM over a block of text to extract its sentiment, intent, detected language, and key topics in a single call. Use it to triage an inbound message or enrich a contact record before routing. Like every /ai endpoint it counts against the AI rate limit and deducts credits per call.
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}
Analyze a stored message by its ID — sentiment, intent, language, and topics — and persist the result on the message so downstream automations and reporting can read it. Use it to enrich messages already in the inbox. Like every /ai endpoint it counts against the AI rate limit and deducts credits per call.
string
required

OpenAI-compatible chat completion (general inference)

POST /api/v1/ai/chat/completions
Run an OpenAI-compatible chat completion for general-purpose inference over a list of conversation turns. Use it as a drop-in building block for custom AI features; supports temperature, max_tokens, and JSON response formatting. Like every /ai endpoint it counts against the AI rate limit and deducts credits per call.
string
Optional model id. OpenAI ids are remapped to the platform fast tier.
object[]
required
Conversation turns (1-50).
number
integer
object

Classify the customer’s intent from a conversation

POST /api/v1/ai/classify-intent
Classify the customer’s primary intent from a conversation — for example sales, support, billing, or cancellation — so you can route or automate on it. Use it to drive inbox triage or workflow branching. Like every /ai endpoint it counts against the AI rate limit and deducts credits per call.
string
required
Conversation ID to analyze.

Draft a full campaign blueprint from a plain-English goal

POST /api/v1/ai/compose-campaign
Draft a full multi-channel campaign blueprint — audience, channels, tone, and per-channel copy — from a plain-English goal. Use it to bootstrap a campaign in the create wizard. Like every /ai endpoint it counts against the AI rate limit and deducts credits per call.
string
required
Plain-English campaign goal (5-2,000 chars).
string (enum: champion|high_value_engaged|engaged|new|passive|at_risk|…)
string
string (enum: sms|whatsapp|email|voice)[]
string (enum: professional|casual|urgent|friendly|empathetic)
string
string

Generate AI-powered dashboard insights from stats

POST /api/v1/ai/dashboard-insights
Turn a blob of dashboard stats into a short set of AI-written insights and recommended next actions. Use it to surface a plain-English summary of account performance on the dashboard. Like every /ai endpoint it counts against the AI rate limit and deducts credits per call.

Generate embedding vectors for one or more input strings

POST /api/v1/ai/embeddings
Generate embedding vectors for a single string or a batch of up to 96 strings, for semantic search, clustering, or retrieval-augmented generation. The OpenAI-style request shape lets existing SDKs drop in unchanged. Like every /ai endpoint it counts against the AI rate limit and deducts credits per call.
any
required
Text (or array of texts) to embed.

Generate channel-appropriate message content from a prompt

POST /api/v1/ai/generate-content
Generate channel-appropriate message copy from a plain-English prompt, honoring an optional tone and target channel. Use it to draft SMS, WhatsApp, or email content in the campaign composer. Like every /ai endpoint it counts against the AI rate limit and deducts credits per call.
string
required
Plain-English prompt (1-2,000 chars).
string (enum: professional|casual|urgent|friendly)
string

Improve, shorten, lengthen, or rephrase existing text

POST /api/v1/ai/improve-text
Rewrite existing text to improve it, make it shorter or longer, change its tone, fix grammar, or rephrase it. Use it to polish a draft reply or campaign copy before sending on any channel. Like every /ai endpoint it counts against the AI rate limit and deducts credits per call.
string
required
Text to improve (1-10,000 chars).
string (enum: improve|shorter|longer|change_tone|fix_grammar|rephrase)
required
string

Recommend the optimal channel + fallbacks for a recipient

POST /api/v1/ai/optimize-channel
Recommend the best channel and fallbacks for reaching a recipient given the message type and your goal — cheapest, fastest, highest engagement, or balanced. Use it to route a single send to the optimal channel. Like every /ai endpoint it counts against the AI rate limit and deducts credits per call.
string
required
Recipient identifier (E.164 phone or email).
string (enum: marketing|transactional|otp)
string (enum: cheapest|fastest|highest_engagement|balanced)
string[]

Generate AI-suggested replies for a conversation

POST /api/v1/ai/suggest-reply
Generate AI-suggested agent replies for an open conversation, grounded in the thread history and your knowledge base. Use it to power a Copilot reply picker in the inbox. Like every /ai endpoint it counts against the AI rate limit and deducts credits per call.
string
required
Conversation ID to analyze.

Summarize a conversation thread

POST /api/v1/ai/summarize-conversation
Summarize a conversation thread into a short recap of what the customer needs and what has happened so far. Use it to brief an agent on handoff or to store a wrap-up note. Like every /ai endpoint it counts against the AI rate limit and deducts credits per call.
string
required
Conversation ID to analyze.

Translate text to a target language

POST /api/v1/ai/translate
Translate a block of text into a target language using the platform LLM, returning the translated text plus the detected source language. Use it to localize a draft reply, an inbound message, or campaign copy before sending on any channel. Set target_language to an ISO 639-1 code (es, fr, pt-BR) or a language name (Spanish). Like every /ai endpoint it counts against the AI rate limit and deducts credits per call.
string
required
Text to translate (1-10,000 chars).
string
required
Target language name or ISO 639-1 code.