Skip to main content
POST
https://jwhite.tail8bf327.ts.net
/
api
/
v1
/
agents
Create Agent
curl --request POST \
  --url https://jwhite.tail8bf327.ts.net/api/v1/agents \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "name": "<string>",
  "avatar_id": 123,
  "language": "<string>",
  "custom_greeting": "<string>",
  "context": "<string>"
}
'
{
  "success": true,
  "agent": {
    "agent_id": 123,
    "name": "Sales Support Agent",
    "avatar_id": 1,
    "language": "en",
    "custom_greeting": "Welcome! How can I assist you today?",
    "context": "You are a helpful sales assistant specializing in software products.",
    "status": "active",
    "created_at": "2024-01-15T10:30:00Z"
  },
  "message": "Agent created successfully"
}

Authentication

Requires JWT authentication (cookie-based) or API key authentication.
Authorization: Bearer <jwt_token>

Request Body

name
string
required
Agent name
avatar_id
integer
Avatar ID for the AI assistant
language
string
default:"en"
Language code (e.g., ‘en’, ‘es’, ‘fr’)
custom_greeting
string
Custom greeting message for the AI assistant
context
string
Additional context or instructions for the AI

Request

POST https://jwhite.tail8bf327.ts.net/api/v1/agents
Authorization: Bearer <jwt_token>
Content-Type: application/json

{
  "name": "Sales Support Agent",
  "avatar_id": 1,
  "language": "en",
  "custom_greeting": "Welcome! How can I assist you today?",
  "context": "You are a helpful sales assistant specializing in software products.",
  "properties": {
    "department": "sales"
  }
}

Response

{
  "success": true,
  "agent": {
    "agent_id": 123,
    "name": "Sales Support Agent",
    "avatar_id": 1,
    "language": "en",
    "custom_greeting": "Welcome! How can I assist you today?",
    "context": "You are a helpful sales assistant specializing in software products.",
    "status": "active",
    "created_at": "2024-01-15T10:30:00Z"
  },
  "message": "Agent created successfully"
}
{
  "success": false,
  "error": "Agent name is required"
}

Notes

  • The user_id is automatically taken from the authenticated user (JWT token or API key)
  • You don’t need to provide user_id in the request body
  • The agent will be created under your user account automatically