Create Agent
POST/api/v1/agents/
Overview#
Create a new AI agent with custom configuration. Agents can be set up as chatbots or assistants with tailored prompts, models, and appearance settings.
Request Header
Authorizationapi key
Your 7en API key. Example: Api-Key 43NKLN3LKN4nlkn
Content-Typestring
Must be application/json
Request#
Request Body
namestringrequired
Display name of the agent. Example: "Support Bot"
agent_categorystringrequired
Category of the agent. Accepted values: "chatbot", "assistant"
Optional Fields
agentTypestring
Type of agent. Accepted values: "General Assistant", "Tech Expert"
descriptionstringoptional
Short description of the agent's purpose. Example: "Handles tier-1 customer support queries."
systemPromptstringoptional
System-level instructions that define the agent's behavior and persona.
modelobjectoptional
LLM model configuration.
appearanceobjectoptional
Visual customization for the chat widget.
behaviorobjectoptional
Behavioral settings for the agent.
Validations#
| Rule | Details |
|---|---|
| Agent limit | The number of agents you can create is capped by your subscription plan. Exceeding the limit returns 403 Forbidden with code agent_limit_reached. |
| Model permissions | Certain models (e.g. GPT-4o, Claude) require a Pro or Enterprise plan. Requesting an unavailable model returns 403 Forbidden with code model_not_permitted. |
| Payment status | Requests are blocked if your account has an outstanding payment issue. Returns 403 Forbidden with code payment_required. |
Error Responses#
400
{
"error": {
"code": "name_required",
"message": "The name field is required.",
"status": 400
}
}403
{
"error": {
"code": "invalid_api_key",
"message": "The provided API key is invalid or has been revoked.",
"status": 403
}
}400
{
"error": {
"code": "agent_limit_reached",
"message": "Agent limit reached. Upgrade your plan or add seats.",
"status": 400
}
}Best Practices#
- System prompts: Be specific and concise. A well-scoped system prompt produces more consistent agent behavior.
- Temperature: Use
0.1–0.3for factual/support agents,0.7–1.0for creative tasks. - Required fields first: Always include
nameandagent_category— omitting any returns a400error. - Retrain after adding knowledge: Creating an agent does not trigger training. Add knowledge sources and call Train Agent to activate them.
Request
curl -X POST 'https://api.7en.ai/api/v1/agents/' \
-H 'Authorization: Api-Key YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"name": "Support Bot",
"agent_category": "chatbot"
}'Response201
{
"message": "Resource created successfully",
"status": "success",
"data": {
"id": 689,
"owner": 2,
"name": "Customer Support Agents",
"description": null,
"status": "Idle",
"appearance": {},
"behavior": {},
"model": {
"display_model": null
},
"agentType": "General Assistant",
"agent_category": null,
"systemPrompt": "",
"knowledge_sources": [],
"created_at": "2026-03-09T07:28:11.656646Z",
"updated_at": "2026-03-09T07:28:11.656660Z",
"conversations": 0,
"ticketing_providers": [],
"default_ticketing_provider": null,
"is_slack_enabled": false,
"privacy_url": null,
"gdpr_settings": {
"data_retention_days": null,
"data_retention_message": null,
"gdpr_message_display": false
},
"is_white_label": true,
"total_training_usage_bytes": 0,
"max_training_usage_bytes": 51200000,
"character_limit": 200000
}
}