Skip to main content
POST
/
v2
/
_new_assistants
Create WhatsApp 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": [
    "<string>"
  ],
  "instructions": "<string>",
  "prompts": {
    "agent": "<string>",
    "goal": "<string>"
  },
  "phone_number": "<string>",
  "kb_id": "<string>",
  "action_ids": [
    "<string>"
  ],
  "additional_settings": {
    "idle_time": 123,
    "max_messages": 123
  },
  "incoming_call_greeting": "<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: "My WhatsApp AI Agent"
type
string
required
Assistant type: "WHATSAPP"
model
string
required
LLM model: "cw-llm-1"
api_keys
string[]
API key configuration []
instructions
string
required
Detailed agent instructions and restaurant ordering guidelines
prompts
object
Agent prompts with agent and goal fields
agent
string
goal
string
phone_number
string
required
WhatsApp number ID. Example: "650175178190170"
kb_id
string
Knowledge base ID

WhatsApp Settings

action_ids
string[]
Linked action IDs []
additional_settings
object
Idle timeout in hours. Example: 24
idle_time
integer
Idle timeout in hours. Example: 24
max_messages
integer
Maximum messages per conversation. Example: 10
incoming_call_greeting
string
WhatsApp greeting message

Response

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