Skip to main content
POST
/
v2
/
_new_assistants
Create Voice AI Agent
curl --request POST \
  --url https://prod-contactswing-fastapi-962560522883.us-central1.run.app/v2/_new_assistants \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "type": "<string>",
  "model": "<string>",
  "api_keys": [
    {
      "api_key_id": 123,
      "type": "<string>"
    }
  ],
  "instructions": "<string>",
  "prompts": {
    "agent": "<string>",
    "goal": "<string>"
  },
  "phone_number": "<string>",
  "incoming_call_greeting": "<string>",
  "outgoing_call_greeting": "<string>",
  "synthesizer": "<string>",
  "voice_id": "<string>",
  "language": "<string>",
  "enable_recordings": true,
  "behaviour": {
    "speed": "<string>",
    "emotions": {
      "anger": "<string>",
      "curiosity": "<string>",
      "positivity": "<string>",
      "surprise": "<string>",
      "sadness": "<string>"
    }
  },
  "kb_id": "<string>",
  "additional_settings": {
    "Synthesizer": {
      "Azure": {
        "voice_name": "<string>",
        "rate": "<string>",
        "language_code": "<string>"
      },
      "Cartesia": {
        "speed": "<string>",
        "emotion": {}
      },
      "ElevenLabs": {
        "stability": "<string>",
        "style_exaggeration": "<string>",
        "similarity": "<string>",
        "optimize_latency": "<string>"
      }
    },
    "Transcriber": {
      "Deepgram": {
        "language": "<string>",
        "keywords": [
          "<string>"
        ]
      }
    },
    "Agent": {
      "OpenAI": {
        "temperature": 123,
        "max_tokens": 123,
        "backchannel_probability": 123
      },
      "model": "<string>",
      "temperature": 123,
      "max_tokens": 123,
      "allow_incoming_messages": true,
      "time_zone": "<string>",
      "initial_message": "<string>",
      "initial_message_delay": 123,
      "interrupt_sensitivity": "<string>",
      "max_call_duration": 123,
      "end_conversation_on_goodbye": true,
      "goodbye_phrases": [
        "<string>"
      ],
      "reminder": {
        "allowed_idle_time_seconds": 123,
        "num_check_human_present_times": 123,
        "reminder_messages": [
          "<string>"
        ],
        "message_before_termination": "<string>"
      }
    },
    "SynthesizerUsed": "<string>",
    "TranscriberUsed": "<string>",
    "AgentUsed": "<string>",
    "save_transcripts": true,
    "enable_voicemail_detection": true,
    "voicemail_message": "<string>",
    "check_idle_time": true
  },
  "action_ids": [
    "<string>"
  ],
  "response_time": 123,
  "version": "<string>"
}
'
{
  "ctx_id": "<string>",
  "data": {
    "assistant_id": "<string>",
    "name": "<string>"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.contactswing.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
required
Enter your ContactSwing JWT Bearer token.

Request Body

name
string
required
Assistant display name. Example: "Insurance Darren"
type
string
required
Assistant type. Example: "VOICE_INCOMING"
model
string
required
LLM model. Example: "cw-llm-1"

API Keys

api_keys
array
API key configuration
api_key_id
number
API key ID
type
string
Key type: MODEL | CALL | DEEPGRAM | VOICE

Instructions

instructions
string
required
Detailed agent instructions and behavior rules

Prompts

prompts
object
required
Agent prompt configuration
agent
string
Agent system prompt
goal
string
Primary agent goal

Phone & Greetings

phone_number
string
Assigned phone number. Example: "+13465842882"
incoming_call_greeting
string
Greeting played on incoming calls
outgoing_call_greeting
string
Greeting played on outgoing calls

Voice & Language

synthesizer
string
Voice synthesizer. Example: "AZURE"
voice_id
string
Voice ID. Example: "en-US-LunaNeural"
language
string
Language. Example: "english"
enable_recordings
boolean
Enable call recordings

Behaviour Settings

behaviour
object
Agent speaking behavior
speed
string
Speech speed. Example: "medium"
emotions
object
Emotional tone levels
anger
string
default:"medium"
curiosity
string
default:"medium"
positivity
string
default:"medium"
surprise
string
default:"medium"
sadness
string
default:"medium"

Knowledge Base

kb_id
string
Knowledge base ID (nullable)

Additional Settings

additional_settings
object
Synthesizer
object
Azure
object
voice_name
string
rate
string
language_code
string
Cartesia
object
speed
string
emotion
object
ElevenLabs
object
stability
string
style_exaggeration
string
similarity
string
optimize_latency
string
Transcriber
object
Deepgram
object
language
string
keywords
string[]
Agent
object
OpenAI
object
temperature
number
max_tokens
number
backchannel_probability
number
model
string
temperature
number
max_tokens
number
allow_incoming_messages
boolean
time_zone
string
initial_message
string
initial_message_delay
number
interrupt_sensitivity
string
max_call_duration
number
end_conversation_on_goodbye
boolean
goodbye_phrases
string[]
reminder
object
allowed_idle_time_seconds
number
num_check_human_present_times
number
reminder_messages
string[]
message_before_termination
string
SynthesizerUsed
string
TranscriberUsed
string
AgentUsed
string
save_transcripts
boolean
enable_voicemail_detection
boolean
voicemail_message
string
check_idle_time
boolean

Actions & Meta

action_ids
string[]
Linked action IDs
response_time
number
version
string
Example: "v1"

Response

201 Created
ctx_id
string
Request context ID
data
object
assistant_id
string
New assistant ID
name
string
Assistant name
400 Bad Request – Invalid configuration
401 Unauthorized – Invalid token