Create Agent API

Create a new AI agent with specified configurations.

API Endpoint

MethodEndpoint
POSThttps://new-prod.vocera.ai/test_framework/v1/aiagents-external/

Authentication

Include your API key in the request headers:

HeaderDescription
X-VOCERA-API-KEYYour API key obtained from the dashboard

Request Parameters

ParameterTypeRequiredDescription
agent_namestringYesName of the agent
contact_numberstringYesPhone number in E.164 format
inboundbooleanYesIf true, agent will call you
descriptionstringYesDescription of the agent’s purpose
languagestringYesISO 639-1 language code (e.g., “en”)
assistant_idstringNoVapi or Retell assistant ID
websocket_urlstringNoURL for LLM websocket
predefined_metricsarray|stringNoCodes of predefined metrics to add or ‘all’ to add all (See predefined metrics)

Example Request Body

{

    "agent_name": "Agent A",

    "contact_number": "+11234567890",

    "inbound": true,

    "description": "Customer service agent for product inquiries",

    "language": "en",

    "assistant_id": "",

    "websocket_url": ""

}

Response

A successful request returns the created agent details.

Response Fields

FieldTypeDescription
idintegerUnique identifier for the agent
agent_namestringName of the agent
contact_numberstringPhone number in E.164 format
inboundbooleanIf true, agent will call you
descriptionstringDescription of the agent’s purpose
languagestringISO 639-1 language code (e.g., “en”)
assistant_idstringVapi or Retell assistant ID
websocket_urlstringURL for LLM websocket

Example Response

{

    "id": 7,

    "agent_name": "Agent A",

    "contact_number": "+11234567890",

    "inbound": true,

    "description": "Customer service agent for product inquiries",

    "language": "en",

    "assistant_id": "",

    "websocket_url": ""

}

Code Examples

curl -X POST https://new-prod.vocera.ai/test_framework/v1/aiagents-external/ \

  -H "X-VOCERA-API-KEY: <your-api-key-here>" \

  -H "Content-Type: application/json" \

  -d '{

    "agent_name": "Agent A",

    "contact_number": "+11234567890",

    "inbound": true,

    "description": "Customer service agent",

    "language": "en",

    "assistant_id": "",

    "websocket_url": ""

  }'