Agent Management→Create Agent
Create Agent
Create a new AI agent with specific purpose and instructions.
POST
https://api.sparkco.ai/api/v1/agents
Body Parameters
Name | Type | Description |
---|---|---|
agent_name Required | string | The name of the agent |
agent_purpose Required | string | The primary purpose or role of the agent |
initial_instructions Required | string | Initial setup instructions for the agent |
agent_instructions Required | string | Ongoing behavioral instructions for the agent |
agent_type Required | string | Type of agent (professional/companion/custom) |
communication_type Required | string | Primary communication method (phonecall/sms) |
gender Required | string | Agent's voice gender (male/female) |
Example Request
curl -X POST https://api.sparkco.ai/api/v1/agents \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"agent_name": "Customer Service Bot",
"agent_purpose": "Handle customer inquiries",
"initial_instructions": "You are a helpful customer service agent",
"agent_instructions": "Always greet customers warmly",
"agent_type": "professional",
"communication_type": "phonecall",
"gender": "female"
}'
Response
{
"success": true,
"data": {
"message": "Agent created successfully",
"agent": {
"id": 1,
"agent_name": "Customer Service Bot",
"agent_purpose": "Handle customer inquiries",
"initial_instructions": "You are a helpful customer service agent",
"agent_instructions": "Always greet customers warmly",
"agent_type": "professional",
"communication_type": "phonecall",
"gender": "female",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z",
"created_by": "user_id",
"updated_by": "user_id"
}
}
}