Skip to main content
POST
Create a new agent (structured response)
Legacy endpoint - deprecated. Unversioned endpoints are scheduled for removal on July 31, 2026. Use the /v1 version for new integrations. This endpoint remains available for existing integrations until then.
Agents are the core building block in DialNexa. Each agent defines how an AI-powered call should sound and behave, including what it says, how it responds, and what it can do.

When to use this

Use this endpoint to programmatically create agents as part of your onboarding flow, template system, or multi-tenant setup. For example, if each of your customers needs their own agent pre-configured with their business details, this lets you spin them up automatically.

Key fields

  • pipeline_type: Use Cascaded for the standard STT, LLM, and TTS pipeline. Use Speech_To_Speech for realtime speech models such as GPT realtime.
  • prompts.prompt_text: The system prompt that shapes the agent’s personality, instructions, and scope. Write it clearly; the LLM follows this closely.
  • voice: Pass a voice id from List Voices, or configure it inline.
  • speech.transcriber_id: Selects the primary STT provider for cascaded agents. Speech to Speech agents do not use a separate transcriber.
  • speech.fallback_stt_enabled: Enables a backup STT provider for cascaded agents. When enabled, also send speech.stt_fallback_transcriber_id.
  • speech.audio_cache_enabled: Caches repeated TTS phrases for lower latency on cascaded agents. Speech to Speech agents do not use TTS audio cache.
  • telephony.call_limits: Set how long a call can run, how long to wait before ending on silence, and how long to ring before giving up.
  • functions: Tools the agent can invoke mid-call, such as calendar booking, CRM lookups, or custom webhooks.
  • analysis.postcall_analysis: Fields to extract from the transcript after each call (e.g., CSAT score, intent, outcome).
  • metadata via dynamic variables: You can reference {{variable_name}} in your prompt; values are injected at call time from the call’s metadata object.

Pipeline Types

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-organization-id
string
required

RSA encrypted organization ID (base64 format)

Example:

"BASE64_ENCRYPTED_ORG_ID_HERE"

Body

application/json

Grouped request body. Fallback LLM: set llm.fallback.fallback_llm_enabled and llm.fallback.llm_fallback_model (or fall_back_llm_id). PCA: set analysis.postcall_analysis with field_name, field_type, field_description, and optional additional_fields.

title
string
Example:

"Customer Support Agent"

llm
object
fallback_llm_enabled
boolean

Enable fallback LLM (flat alias; prefer llm.fallback.fallback_llm_enabled)

Example:

false

llm_fallback_model
string | null

Fallback LLM id (flat alias; prefer llm.fallback.llm_fallback_model)

Example:

"abc123xyz789ab"

llm_fallback_delay_ms
number | null

Fallback delay ms (flat alias; prefer llm.fallback.llm_fallback_delay_ms)

Example:

500

analysis
object

Post-call analysis (PCA) fields for the agent version

Response

201 - application/json

Agent created; current_version includes llm.fallback and flat fallback fields

number
number
required
Example:

0

is_published
boolean
required
Example:

false

llm
object
fallback_llm_enabled
boolean
Example:

false

llm_fallback_model
string | null
Example:

"llm_abc123xyz789ab"

fall_back_llm_id
string | null
Example:

"llm_abc123xyz789ab"

llm_fallback_delay_ms
number | null
Example:

500

transcriber_id
string | null
Example:

"tr0deepnova3xx"

analysis
object