Skip to main content
POST
/
api
/
v1
/
agents
Create Agent
curl --request POST \
  --url https://api.example.com/api/v1/agents
Create a new AI agent configuration for testing.

Request

POST /api/v1/agents
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Body Parameters

ParameterTypeRequiredDescription
providerstringYesProvider type (see below)
namestringYesDisplay name for the agent
descriptionstringNoOptional description
configobjectYesProvider-specific configuration

Supported Providers

ProviderDescription
vapiVapi voice AI platform
livekitLiveKit real-time communication
pipecatPipecat Cloud voice agents
openaiOpenAI-compatible endpoints
retellRetell AI voice agents
elevenlabsElevenLabs conversational AI

Response (201)

FieldTypeDescription
idstringAgent UUID
providerstringProvider type
namestringDisplay name
descriptionstringDescription (or null)
is_activebooleanWhether the agent is active
created_atstringISO-8601 creation timestamp
updated_atstringISO-8601 last update timestamp

Examples

curl -X POST "https://app.preclinical.dev/api/v1/agents" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "vapi",
    "name": "Healthcare Assistant",
    "description": "Production voice agent for patient triage",
    "config": {
      "assistant_id": "asst_abc123",
      "api_key": "va_xxx"
    }
  }'

Success Response

{
  "id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
  "provider": "vapi",
  "name": "Healthcare Assistant",
  "description": "Production voice agent for patient triage",
  "is_active": true,
  "created_at": "2026-01-30T10:00:00Z",
  "updated_at": "2026-01-30T10:00:00Z"
}

Errors

CodeDescription
MISSING_REQUIRED_FIELDRequired field missing (provider, name, or config)
INVALID_FIELD_VALUEInvalid provider type
ALREADY_EXISTSAn agent with this name already exists