Skip to main content
POST
/
v1
/
agents
Create agent
curl --request POST \
  --url https://api.nixflex.com/v1/agents

Documentation Index

Fetch the complete documentation index at: https://docs.nixflex.com/llms.txt

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

Creates a new AI agent. The agent immediately becomes available to attach to phone numbers and use for outbound calls.

Request

curl -X POST https://api.nixflex.com/v1/agents \
  -H "Authorization: Bearer KEY_ID:KEY_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Dental Receptionist",
    "system_prompt": "You are the friendly front-desk assistant at Acme Dental in Croydon...",
    "welcome_message": "Hello, Acme Dental, how can I help?",
    "voice_id": "Dennis",
    "language": "en",
    "response_length": "short",
    "transfer_number": "+442087601234",
    "webhook_url": "https://api.acmedental.com/nixflex/calls"
  }'

Body parameters

FieldTypeRequiredDefaultNotes
namestringYesDisplay name (max 100 chars)
system_promptstringYesClaude’s instructions (max ~10k chars)
welcome_messagestringNogenericFirst line spoken on inbound calls
voice_idstringNo"Dennis"Inworld TTS voice
languagestringNo"en"Default language code
response_lengthenumNo"medium"short, medium, long
interruption_sensitivityenumNo"medium"low, medium, high
max_call_duration_secondsintNo300Hard cap on call length
silence_hangup_secondsintNo30Hang up if caller silent this long
record_callboolNotrueSave call audio
webhook_urlstringNonullWhere to POST post-call data
transfer_numberstringNonullDefault destination for [TRANSFER:]
post_call_sms_templatestringNonullAuto-SMS after every call
voicemail_messagestringNonullIf set, agent leaves this on voicemail
enable_sms_replyboolNotrueAuto-reply to inbound SMS
extraction_schemaobjectNonullCustom data to extract post-call
functionsarrayNo[]Custom function definitions

Response

201 Created:
{
  "agent_id": "agent_125207e452f8714a",
  "api_key_id": "nxf_a1b2c3d4...",
  "name": "Acme Dental Receptionist",
  "system_prompt": "You are the friendly front-desk assistant...",
  "welcome_message": "Hello, Acme Dental, how can I help?",
  "voice_id": "Dennis",
  "language": "en",
  "response_length": "short",
  "interruption_sensitivity": "medium",
  "max_call_duration_seconds": 300,
  "silence_hangup_seconds": 30,
  "record_call": true,
  "transfer_number": "+442087601234",
  "webhook_url": "https://api.acmedental.com/nixflex/calls",
  "is_active": true,
  "created_at": "2026-05-17T03:45:12Z",
  "updated_at": "2026-05-17T03:45:12Z"
}
Save the agent_id — you’ll use it for every subsequent operation.

Errors

CodeCause
prompt_too_longsystem_prompt exceeds 10,000 characters
invalid_voice_idVoice not in supported list
invalid_languageLanguage code not supported
invalid_requestMissing required field or bad format
See Errors for handling patterns.