Agent Management→Update Agent
Update Agent
Update the details of an existing agent. Only provide the fields you want to update.
PUT
https://api.sparkco.ai/api/v1/agents/:id
Path Parameters
Name | Type | Description |
---|---|---|
id Required | integer | The unique identifier of the agent to update |
Body Parameters
Name | Type | Description |
---|---|---|
agent_name | string | The updated name of the agent |
agent_purpose | string | The updated primary purpose or role of the agent |
initial_instructions | string | Updated initial setup instructions for the agent |
agent_instructions | string | Updated ongoing behavioral instructions for the agent |
agent_type | string | Updated type of agent (professional/companion/custom) |
communication_type | string | Updated primary communication method (phonecall/sms) |
gender | string | Updated agent's voice gender (male/female) |
Example Request
curl -X PUT https://api.sparkco.ai/api/v1/agents/1 \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"agent_name": "Updated Bot Name",
"agent_purpose": "Updated purpose",
"initial_instructions": "Updated instructions",
"agent_instructions": "Updated agent instructions",
"agent_type": "professional",
"communication_type": "phonecall",
"gender": "female"
}'
Response
{
"success": true,
"data": {
"message": "Agent updated successfully",
"agent": {
"id": 1,
"agent_name": "Updated Bot Name",
"agent_purpose": "Updated purpose",
"initial_instructions": "Updated instructions",
"agent_instructions": "Updated agent instructions",
"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"
}
}
}