Agents in Neuratel are versioned resources. Every configuration change increments the version number, giving you a full history of every state the agent has ever been in. This guide covers the complete lifecycle from creation through deletion.
Prerequisites: Neuratel account, API key
Create an Agent
POST /v1/agents returns the agent object with version: 1.
PATCH /v1/agents/{id} performs a partial update. Only the fields you send are changed.
Code
curl -X PATCH https://api.neuratel.ai/v1/agents/agent_abc123 \ -H "Authorization: Bearer nk_live_your_api_key" \ -H "Content-Type: application/json" \ -d '{ "brain": { "instructions": "You are a friendly sales agent for Acme Corp. Qualify leads and book demos. Always offer a 14-day free trial.", "temperature": 0.5 } }'
Code
updated = client.patch("/v1/agents/agent_abc123", json={ "brain": { "instructions": ( "You are a friendly sales agent for Acme Corp. " "Qualify leads and book demos. Always offer a 14-day free trial." ), "temperature": 0.5, },}).json()print(updated["version"]) # 2
Code
const updated = await fetch("https://api.neuratel.ai/v1/agents/agent_abc123", { method: "PATCH", headers: { "Authorization": "Bearer nk_live_your_api_key", "Content-Type": "application/json", }, body: JSON.stringify({ brain: { instructions: "You are a friendly sales agent for Acme Corp. " + "Qualify leads and book demos. Always offer a 14-day free trial.", temperature: 0.5, }, }),}).then((r) => r.json());console.log(updated.version); // 2
Each successful update increments version by one. In-progress calls always run on the version that was active when the call connected — updates only affect new calls.
Optimistic Concurrency
When multiple team members or automated systems update the same agent simultaneously, one write can silently overwrite another. Neuratel prevents this with the expected_version field.
Pass the version number you read before making changes. If someone else has updated the agent in the meantime, the API returns 409 Conflict instead of silently overwriting their work.
Duplication is the recommended way to create language or region variants of an existing agent without starting from scratch.
Delete an Agent
Deleting an agent is a soft delete. Historical call data, transcripts, and analytics are preserved. The agent is removed from all active lists and can no longer receive calls.