API Endpoints

Overview & Getting Started
Agent ManagementUpdate 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

NameTypeDescription
id
Required
integerThe unique identifier of the agent to update

Body Parameters

NameTypeDescription
agent_name
stringThe updated name of the agent
agent_purpose
stringThe updated primary purpose or role of the agent
initial_instructions
stringUpdated initial setup instructions for the agent
agent_instructions
stringUpdated ongoing behavioral instructions for the agent
agent_type
stringUpdated type of agent (professional/companion/custom)
communication_type
stringUpdated primary communication method (phonecall/sms)
gender
stringUpdated 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"
    }
  }
}