Skip to main content
POST
https://prod-contactswing-fastapi-962560522883.us-central1.run.app
/
v2
/
_new_assistants
Create SMS 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>"
  },
  "sms_type": "<string>",
  "phone_number": "<string>",
  "kb_id": "<string>",
  "action_ids": [
    {}
  ],
  "additional_settings": {
    "additional_settings.idle_time": 123,
    "additional_settings.max_messages": 123
  }
}
'
{
  "ctx_id": "<string>",
  "data": {
    "assistant_id": "<string>",
    "name": "<string>"
  }
}

Authorizations

Authorization
string
required
Enter your ContactSwing JWT Bearer token.
force
boolean
Force recreate (overwrite existing). Example: true

Request Body

name
string
required
Assistant display name. Example: "My SMS Assistant"
type
string
required
Assistant type: "SMS"
model
string
required
LLM model: "cw-llm-1"
api_keys
array
required
SMS API configuration [{"api_key_id":134,"type":"SMS"}]
api_key_id
number
API key ID
type
string
Key type: SMS
instructions
string
required
Detailed recruiter instructions and candidate profiles
prompts
object
Agent prompts with agent and goal
agent
string
goal
string

SMS-Specific Settings

sms_type
string
required
SMS direction: "OUTBOUND"
phone_number
string
Assigned phone number. Example: "+13465507166"
kb_id
string
Knowledge base ID
action_ids
array
Linked action IDs []
additional_settings
object
additional_settings.idle_time
integer
Idle timeout in seconds. Example: 86400
additional_settings.max_messages
integer
Maximum messages per conversation. Example: 10

Response

201 Created - SMS 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 SMS configuration or missing API keys 401 Unauthorized - Invalid token