Serve dashboard at /, version the REST API under /api/v1
The SvelteKit build was always made for the root (no base path); it now mounts at / — registered last so /api/v1, /ws, /health, and /mcp match first — and the JSON root endpoint is gone (its info lives in /health and gateway_status). REST routers move from /api/* to /api/v1/*; /ws and /health stay put; /mcp/ unchanged. Dashboard API client, tests, README, and docs updated; dashboard rebuilt (build/ is gitignored). Verified live: / serves the UI, /api/v1 answers 200/401, the old /api paths 404, MCP still lists 15 tools. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -11,7 +11,7 @@ Base URL: `http://localhost:8000/api`
|
||||
#### Place an Outbound Call
|
||||
|
||||
```
|
||||
POST /api/calls/outbound
|
||||
POST /api/v1/calls/outbound
|
||||
```
|
||||
|
||||
**Request:**
|
||||
@@ -53,7 +53,7 @@ POST /api/calls/outbound
|
||||
#### Launch Hold Slayer
|
||||
|
||||
```
|
||||
POST /api/calls/hold-slayer
|
||||
POST /api/v1/calls/hold-slayer
|
||||
```
|
||||
|
||||
Convenience endpoint — equivalent to `POST /outbound` with `mode=hold_slayer`.
|
||||
@@ -72,7 +72,7 @@ Convenience endpoint — equivalent to `POST /outbound` with `mode=hold_slayer`.
|
||||
#### Get Call Status
|
||||
|
||||
```
|
||||
GET /api/calls/{call_id}
|
||||
GET /api/v1/calls/{call_id}
|
||||
```
|
||||
|
||||
**Response:**
|
||||
@@ -99,7 +99,7 @@ GET /api/calls/{call_id}
|
||||
#### List Active Calls
|
||||
|
||||
```
|
||||
GET /api/calls
|
||||
GET /api/v1/calls
|
||||
```
|
||||
|
||||
**Response:**
|
||||
@@ -117,13 +117,13 @@ GET /api/calls
|
||||
#### End a Call
|
||||
|
||||
```
|
||||
POST /api/calls/{call_id}/hangup
|
||||
POST /api/v1/calls/{call_id}/hangup
|
||||
```
|
||||
|
||||
#### Transfer a Call
|
||||
|
||||
```
|
||||
POST /api/calls/{call_id}/transfer
|
||||
POST /api/v1/calls/{call_id}/transfer
|
||||
```
|
||||
|
||||
**Request:**
|
||||
@@ -139,9 +139,9 @@ POST /api/calls/{call_id}/transfer
|
||||
#### List Call Flows
|
||||
|
||||
```
|
||||
GET /api/call-flows
|
||||
GET /api/call-flows?company=Chase+Bank
|
||||
GET /api/call-flows?tag=banking
|
||||
GET /api/v1/call-flows
|
||||
GET /api/v1/call-flows?company=Chase+Bank
|
||||
GET /api/v1/call-flows?tag=banking
|
||||
```
|
||||
|
||||
**Response:**
|
||||
@@ -166,7 +166,7 @@ GET /api/call-flows?tag=banking
|
||||
#### Get Call Flow
|
||||
|
||||
```
|
||||
GET /api/call-flows/{flow_id}
|
||||
GET /api/v1/call-flows/{flow_id}
|
||||
```
|
||||
|
||||
Returns the full call flow with all steps.
|
||||
@@ -174,7 +174,7 @@ Returns the full call flow with all steps.
|
||||
#### Create Call Flow
|
||||
|
||||
```
|
||||
POST /api/call-flows
|
||||
POST /api/v1/call-flows
|
||||
```
|
||||
|
||||
**Request:**
|
||||
@@ -197,13 +197,13 @@ POST /api/call-flows
|
||||
#### Update Call Flow
|
||||
|
||||
```
|
||||
PUT /api/call-flows/{flow_id}
|
||||
PUT /api/v1/call-flows/{flow_id}
|
||||
```
|
||||
|
||||
#### Delete Call Flow
|
||||
|
||||
```
|
||||
DELETE /api/call-flows/{flow_id}
|
||||
DELETE /api/v1/call-flows/{flow_id}
|
||||
```
|
||||
|
||||
### Devices
|
||||
@@ -211,7 +211,7 @@ DELETE /api/call-flows/{flow_id}
|
||||
#### List Registered Devices
|
||||
|
||||
```
|
||||
GET /api/devices
|
||||
GET /api/v1/devices
|
||||
```
|
||||
|
||||
**Response:**
|
||||
@@ -234,7 +234,7 @@ GET /api/devices
|
||||
#### Register a Device
|
||||
|
||||
```
|
||||
POST /api/devices
|
||||
POST /api/v1/devices
|
||||
```
|
||||
|
||||
**Request:**
|
||||
@@ -252,13 +252,13 @@ POST /api/devices
|
||||
#### Update Device
|
||||
|
||||
```
|
||||
PUT /api/devices/{device_id}
|
||||
PUT /api/v1/devices/{device_id}
|
||||
```
|
||||
|
||||
#### Remove Device
|
||||
|
||||
```
|
||||
DELETE /api/devices/{device_id}
|
||||
DELETE /api/v1/devices/{device_id}
|
||||
```
|
||||
|
||||
### Error Responses
|
||||
|
||||
@@ -10,7 +10,7 @@ Hold Slayer is a single-process async Python application built on FastAPI. It ac
|
||||
│ │
|
||||
│ ┌──────────┐ ┌──────────┐ ┌───────────┐ ┌──────────────┐ │
|
||||
│ │ REST API │ │WebSocket │ │MCP Server │ │ Dashboard │ │
|
||||
│ │ /api/* │ │ /ws/* │ │ (HTTP) │ │ /dashboard │ │
|
||||
│ │ /api/v1/*│ │ /ws/* │ │ (HTTP) │ │ / │ │
|
||||
│ └────┬─────┘ └────┬─────┘ └─────┬─────┘ └──────────────┘ │
|
||||
│ │ │ │ │
|
||||
│ ┌────┴──────────────┴──────────────┴────┐ │
|
||||
@@ -81,7 +81,7 @@ Hold Slayer is a single-process async Python application built on FastAPI. It ac
|
||||
|
||||
```
|
||||
1. User Request
|
||||
POST /api/calls/hold-slayer { number, intent, call_flow_id }
|
||||
POST /api/v1/calls/hold-slayer { number, intent, call_flow_id }
|
||||
│
|
||||
2. Gateway.make_call()
|
||||
├── CallManager.create_call() → track state
|
||||
|
||||
@@ -177,21 +177,21 @@ This handles:
|
||||
### List Call Flows
|
||||
|
||||
```
|
||||
GET /api/call-flows
|
||||
GET /api/call-flows?company=Chase+Bank
|
||||
GET /api/call-flows?tag=banking
|
||||
GET /api/v1/call-flows
|
||||
GET /api/v1/call-flows?company=Chase+Bank
|
||||
GET /api/v1/call-flows?tag=banking
|
||||
```
|
||||
|
||||
### Get Call Flow
|
||||
|
||||
```
|
||||
GET /api/call-flows/{flow_id}
|
||||
GET /api/v1/call-flows/{flow_id}
|
||||
```
|
||||
|
||||
### Create Call Flow
|
||||
|
||||
```
|
||||
POST /api/call-flows
|
||||
POST /api/v1/call-flows
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
@@ -205,7 +205,7 @@ Content-Type: application/json
|
||||
### Update Call Flow
|
||||
|
||||
```
|
||||
PUT /api/call-flows/{flow_id}
|
||||
PUT /api/v1/call-flows/{flow_id}
|
||||
Content-Type: application/json
|
||||
|
||||
{ ... updated flow ... }
|
||||
@@ -214,13 +214,13 @@ Content-Type: application/json
|
||||
### Delete Call Flow
|
||||
|
||||
```
|
||||
DELETE /api/call-flows/{flow_id}
|
||||
DELETE /api/v1/call-flows/{flow_id}
|
||||
```
|
||||
|
||||
### Learn Flow from Exploration
|
||||
|
||||
```
|
||||
POST /api/call-flows/learn
|
||||
POST /api/v1/call-flows/learn
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ All routing is pattern-matched in order; the first match wins.
|
||||
## 2XX — Endpoint Extensions
|
||||
|
||||
Extensions are auto-assigned from **221** upward when a SIP device
|
||||
registers (`SIP REGISTER`) with the gateway or via `POST /api/devices`.
|
||||
registers (`SIP REGISTER`) with the gateway or via `POST /api/v1/devices`.
|
||||
|
||||
| Extension | Format | Example |
|
||||
|-----------|---------------------------------|--------------------------------|
|
||||
|
||||
Reference in New Issue
Block a user