v45

latestOpenAPI 3.0.0raw.githubusercontent.com2026-08-0114775543.6 KB
Agents

Create agent with AI

Creates a new agent using AI generation. Accepts either a guided questionnaire (array of Q&A pairs) or a free-text description. The AI generates the agent's prompt and configuration. A security check is run on the generated prompt before the agent is persisted. Deducts credits on success.

Rules:

  • Either questions (non-empty array) or description must be provided — not both.
  • emotiveToggle, voiceId, and voiceModel must either all be present or all be absent.
  • When emotiveToggle=true, voiceModel must be GPT_REALTIME.
  • When emotiveToggle=false, voiceModel cannot be GPT_REALTIME.
post/agent/with-ai

Request body

namestring

Agent name. Auto-generated if omitted.

descriptionstring

Free-text description. Required if questions not given.

type'single_prompt'

Workflow type. Only single_prompt is supported.

emotiveToggleboolean

Enable emotive (GPT Realtime) mode. Must be given with voiceId and voiceModel.

voiceIdstring

Voice ID. Must be given together with emotiveToggle and voiceModel.

voiceModelstring

Voice model. Must be given together with emotiveToggle and voiceId.

knowledgeBaseIdstring

Knowledge base to attach (must belong to the organization).

Response

Agent created — returns the new agent's ObjectId

successboolean
datastring

MongoDB ObjectId of the created agent

Example response

{
  "success": true
}