Skip to main content
POST
/
v1
/
add-agent
Add Agent
curl --request POST \
  --url https://api.getbluejay.ai/v1/add-agent \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <x-api-key>' \
  --data '
{
  "name": "<string>",
  "system_prompt": "<string>",
  "knowledge_base": "<string>",
  "goals": [
    "<string>"
  ],
  "phone_number": "<string>",
  "type": "INBOUND",
  "connection_type": "SMS",
  "mode": "VOICE",
  "keyterms": [
    "<string>"
  ],
  "external_agent_id": "<string>",
  "folder": "<string>",
  "websocket_url": "<string>",
  "websocket_username": "<string>",
  "websocket_password": "<string>",
  "sip_uri": "<string>",
  "sip_username": "<string>",
  "sip_password": "<string>",
  "custom_sip_headers": {},
  "redact_pii": false,
  "livekit_agent_name": "<string>",
  "livekit_metadata": {},
  "livekit_customer_tool_topic": "<string>",
  "pipecat_agent_name": "<string>",
  "pipecat_agent_configuration": {},
  "pipecat_room_properties": {},
  "http_webhook": "<string>",
  "voice_provider": "<string>",
  "provider_id": "<string>",
  "enable_outbound_call_auto_start": true
}
'
{
  "agent_id": 123,
  "status": "200",
  "http_webhook_key": "<string>"
}
Integration Prompt for AI Agents
# Bluejay — Testing & Monitoring Platform for Conversational AI Agents

You are a senior backend engineer integrating the Bluejay API. Think step-by-step: first understand the endpoint, then plan the integration, then implement with minimal changes.

## Add Agent — POST /v1/add-agent

> **What this endpoint does:** Add a new agent to the system. Returns the agent id and a status code.

**Endpoint:** POST `https://api.getbluejay.ai/v1/add-agent`
**Auth:** `X-API-Key` header
**Content-Type:** application/json

### Required Parameters
| Name | Type | Description |
|------|------|-------------|
| X-API-Key | string | API key required to authenticate requests. |
| name | string | Name of the agent |
| system_prompt | string | System prompt for the agent |
| knowledge_base | string | Knowledge base of the agent |
| goals | array[string] | List of goals for the agent |

Review the full parameter list at https://docs.getbluejay.ai/api-reference/endpoint/add-agent and include any optional parameters (e.g., `phone_number`, `type`, `connection_type`, `mode`, `keyterms`, `external_agent_id`) that serve your integration's use case and align with Bluejay's testing and monitoring capabilities.

### Request Body (required fields)
```json
{
  "name": "example_name",
  "system_prompt": "You are a helpful assistant.",
  "knowledge_base": "string",
  "goals": [
    "string"
  ]
}
```

Refer to the full schema at https://docs.getbluejay.ai/api-reference/endpoint/add-agent. Include optional fields that serve the goal of setting up for testing and monitoring on Bluejay.

### Example
**POST with body:**
```python
import requests

def add_agent(payload: dict, api_key: str) -> dict:
    url = "https://api.getbluejay.ai/v1/add-agent"
    headers = {"X-API-Key": api_key}
    response = requests.post(url, headers=headers, json=payload)
    response.raise_for_status()
    return response.json()
```

### Constraints
- Minimal changes — only add/change files needed for this integration.
- Match existing codebase patterns (naming, file structure, error handling).
- Include error handling for 422: Validation Error.

### Integration Checklist
Before writing code, verify:
1. Which module/service owns this API domain in the codebase?
2. What HTTP client and error-handling patterns does the project use?
3. Are there existing types/interfaces to extend?

Then implement the integration, export it, and confirm it compiles/passes lint.
Given the name, system prompt, knowledge base, phone number, and goals, this endpoint adds your agent and returns the agent ID.

Headers

X-API-Key
string
required

API key required to authenticate requests.

Body

application/json
name
string
required

Name of the agent

system_prompt
string
required

System prompt for the agent

knowledge_base
string
required

Knowledge base of the agent

goals
string[]
required

List of goals for the agent

phone_number
string | null

Phone number associated with the agent

type
enum<string> | null
default:INBOUND

INBOUND: Agent receives incoming calls from customers OUTBOUND: Agent makes outgoing calls to customers

Available options:
INBOUND,
OUTBOUND
connection_type
enum<string> | null

Connection type of the agent (Livekit, Websocket, etc.)

Available options:
SMS,
HTTP_WEBHOOK,
PHONE,
SIP,
WEBSOCKET,
LIVEKIT,
PIPECAT
mode
enum<string> | null
default:VOICE

Modality of the agent

Available options:
VOICE,
TEXT
keyterms
string[] | null

List of keyterms for the agent

external_agent_id
string | null

External agent ID for the agent

folder
string | null

Name of the folder to put the agent in

websocket_url
string | null

WebSocket URL for real-time communication

websocket_username
string | null

Username for WebSocket authentication

websocket_password
string | null

Password for WebSocket authentication

sip_uri
string | null

SIP URI for VoIP calls

sip_username
string | null

Username for SIP authentication

sip_password
string | null

Password for SIP authentication

custom_sip_headers
Custom Sip Headers · object

Custom headers for SIP requests (Do not include X- prefix for the headers, these get added automatically)

redact_pii
boolean | null
default:false

Enable/disable PII redaction

livekit_agent_name
string | null

LiveKit agent name

livekit_metadata
Livekit Metadata · object

LiveKit metadata

livekit_customer_tool_topic
string | null

LiveKit customer tool topic

pipecat_agent_name
string | null

Pipecat agent name

pipecat_agent_configuration
Pipecat Agent Configuration · object

Pipecat agent configuration

pipecat_room_properties
Pipecat Room Properties · object

Pipecat room properties

http_webhook
string | null

HTTP webhook URL for text agent communication

voice_provider
string | null

Voice provider for the agent

provider_id
string | null

Provider ID for the agent

enable_outbound_call_auto_start
boolean | null

Automatically initiate an outbound call when a test result reaches READY state

Response

Successful Response

agent_id
integer
required

ID of the created agent

status
string
default:200

Status of the response

http_webhook_key
string | null

Signing key for HTTP webhook (only provided if http_webhook was set)