Skip to main content
POST
https://prod-contactswing-fastapi-962560522883.us-central1.run.app
/
v2
/
_new_assistants
Create Chat 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>"
  },
  "kb_id": "<string>",
  "additional_settings": {
    "ChatbotCustomization": {
      "brandName": "<string>",
      "logoUrl": "<string>",
      "greetingText": "<string>",
      "tagline": "<string>",
      "initialMessage": "<string>",
      "finalCloseMessage": "<string>",
      "checkInMessage": "<string>"
    }
  },
  "action_ids": [
    {}
  ]
}
'
{
  "ctx_id": "<string>",
  "data": {
    "assistant_id": "<string>",
    "name": "<string>"
  }
}

Authorizations

Authorization
string
required
Enter your ContactSwing JWT Bearer token.

Request Body

name
string
required
Assistant display name. Example: "My Chat Assistant"
type
string
required
Assistant type: "CHAT"
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
kb_id
string
Knowledge base ID

Chat Customization

additional_settings
object
Brand name. Example: "ContactSwing AI"
ChatbotCustomization
object
Brand name. Example: "ContactSwing AI"
brandName
string
Brand name. Example: "ContactSwing AI"
logoUrl
string
Logo URL
greetingText
string
Welcome message. Example: "Hello welcome back"
tagline
string
Tagline. Example: "Contactswing"
initialMessage
string
First message. Example: "Hi, I'm Ashley 👋 Welcome to ContactSwing AI!"
finalCloseMessage
string
checkInMessage
string
Example: Just checking in — are you still there?
action_ids
array
Linked action IDs []

Response

201 Created - Chat 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 chat configuration 401 Unauthorized - Invalid token