|
| 1 | +# Bolna API Documentation |
| 2 | + |
| 3 | +## Endpoints |
| 4 | + |
| 5 | +### Get Agent |
| 6 | +Retrieves an agent's information by agent id. |
| 7 | + |
| 8 | +**Endpoint:** `GET /agent/{agent_id}` |
| 9 | + |
| 10 | +**Parameters:** |
| 11 | +- `agent_id` (path) - string, required: Unique identifier of the agent |
| 12 | + |
| 13 | +### Create Agent |
| 14 | +Creates a new agent with specified configuration. |
| 15 | + |
| 16 | +**Endpoint:** `POST /agent` |
| 17 | + |
| 18 | +**Request Body:** |
| 19 | +```json |
| 20 | +{ |
| 21 | +{ |
| 22 | + "agent_config": { |
| 23 | + "agent_name": "Alfred", |
| 24 | + "agent_type": "other", |
| 25 | + "agent_welcome_message": "How are you doing Bruce?", |
| 26 | + "tasks": [ |
| 27 | + { |
| 28 | + "task_type": "conversation", |
| 29 | + "toolchain": { |
| 30 | + "execution": "parallel", |
| 31 | + "pipelines": [ |
| 32 | + [ |
| 33 | + "transcriber", |
| 34 | + "llm", |
| 35 | + "synthesizer" |
| 36 | + ] |
| 37 | + ] |
| 38 | + }, |
| 39 | + "tools_config": { |
| 40 | + "input": { |
| 41 | + "format": "wav", |
| 42 | + "provider": "twilio" |
| 43 | + }, |
| 44 | + "llm_agent": { |
| 45 | + "agent_type": "simple_llm_agent", |
| 46 | + "agent_flow_type": "streaming", |
| 47 | + "routes": null, |
| 48 | + "llm_config": { |
| 49 | + "agent_flow_type": "streaming", |
| 50 | + "provider": "openai", |
| 51 | + "request_json": true, |
| 52 | + "model": "gpt-4o-mini" |
| 53 | + } |
| 54 | + }, |
| 55 | + "output": { |
| 56 | + "format": "wav", |
| 57 | + "provider": "twilio" |
| 58 | + }, |
| 59 | + "synthesizer": { |
| 60 | + "audio_format": "wav", |
| 61 | + "provider": "elevenlabs", |
| 62 | + "stream": true, |
| 63 | + "provider_config": { |
| 64 | + "voice": "George", |
| 65 | + "model": "eleven_turbo_v2_5", |
| 66 | + "voice_id": "JBFqnCBsd6RMkjVDRZzb" |
| 67 | + }, |
| 68 | + "buffer_size": 100.0 |
| 69 | + }, |
| 70 | + "transcriber": { |
| 71 | + "encoding": "linear16", |
| 72 | + "language": "en", |
| 73 | + "provider": "deepgram", |
| 74 | + "stream": true |
| 75 | + } |
| 76 | + }, |
| 77 | + "task_config": { |
| 78 | + "hangup_after_silence": 30.0 |
| 79 | + } |
| 80 | + } |
| 81 | + ] |
| 82 | + }, |
| 83 | + "agent_prompts": { |
| 84 | + "task_1": { |
| 85 | + "system_prompt": "Why Do We Fall, Sir? So That We Can Learn To Pick Ourselves Up." |
| 86 | + } |
| 87 | + } |
| 88 | +} |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | +} |
| 93 | +``` |
| 94 | + |
| 95 | +**Response:** |
| 96 | +```json |
| 97 | +200 OK |
| 98 | +{ |
| 99 | + "agent_id": "uuid-string", |
| 100 | + "state": "created" |
| 101 | +} |
| 102 | +``` |
| 103 | + |
| 104 | +### Edit Agent |
| 105 | +Updates an existing agent's configuration. |
| 106 | + |
| 107 | +**Endpoint:** `PUT /agent/{agent_id}` |
| 108 | + |
| 109 | +**Parameters:** |
| 110 | +- `agent_id` (path) - string, required: Unique identifier of the agent |
| 111 | + |
| 112 | +**Request Body:** |
| 113 | +Same as Create Agent endpoint |
| 114 | + |
| 115 | + |
| 116 | +### Delete Agent |
| 117 | +Deletes an agent from the system. |
| 118 | + |
| 119 | +**Endpoint:** `DELETE /agent/{agent_id}` |
| 120 | + |
| 121 | +**Parameters:** |
| 122 | +- `agent_id` (path) - string, required: Unique identifier of the agent |
| 123 | + |
| 124 | +**Response:** |
| 125 | +```json |
| 126 | +200 OK |
| 127 | +{ |
| 128 | + "agent_id": "string", |
| 129 | + "state": "deleted" |
| 130 | +} |
| 131 | +``` |
| 132 | + |
| 133 | + |
| 134 | +### Get All Agents |
| 135 | +Retrieves all agents from the system. |
| 136 | + |
| 137 | +**Endpoint:** `GET /all` |
| 138 | + |
| 139 | +**Response:** |
| 140 | +```json |
| 141 | +200 OK |
| 142 | +{ |
| 143 | + "agents": [ |
| 144 | + { |
| 145 | + "agent_id": "string", |
| 146 | + "data": { |
| 147 | + // Agent configuration object |
| 148 | + } |
| 149 | + } |
| 150 | + ] |
| 151 | +} |
| 152 | +``` |
0 commit comments