Agents

Duplicate an agent

Clone an existing agent into a new agent owned by your organization. By default only the agent config is copied; set include_associations to also copy its metric and test-set associations. Returns the new agent in the same shape as create. If an organization-owned metric association contains invalid regex syntax, duplication returns INVALID_ARGUMENT identifying the source metric to correct.

post/agents/{agent_id}/duplicate

Request

  • Base URL
    https://api.coval.dev/v1
  • Auth
    API key in header x-api-key

Path parameters

agent_idstring required

ID of the agent to duplicate

Request body

include_associationsboolean

Also copy the source agent's metric and test-set associations.

Example request

{
  "include_associations": true
}

Response

Agent duplicated successfully

Example response

{
  "agent": {
    "id": "abc123def456ghi789jklm",
    "customer_agent_id": "my-support-agent",
    "display_name": "Customer Support Agent",
    "model_type": "MODEL_TYPE_VOICE",
    "phone_number": "+1234567890",
    "endpoint": "https://api.example.com/agent",
    "prompt": "You are a helpful customer support agent...",
    "language": "en",
    "attributes": {
      "company_name": "Acme Corp",
      "tier": "enterprise"
    },
    "metadata": {
      "voice": "alloy",
      "model": "gpt-realtime-2"
    },
    "workflows": {},
    "metric_ids": [
      "abc123def456ghi789jklm",
      "def456ghi789jklmabc123"
    ],
    "test_set_ids": [
      "gT5wq2Hn"
    ],
    "knowledge_base_ids": [],
    "tags": [
      "production",
      "voice"
    ],
    "create_time": "2025-10-14T12:00:00Z",
    "update_time": "2025-10-15T14:30:00Z"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.