Core Actions API¶
User-facing endpoints under /api/v1/actions.
Base Configuration¶
const API_BASE_URL = process.env.NEXT_PUBLIC_API_BASE_URL || "http://localhost:8080";
const ACTIONS_PATH = "/api/v1/actions";
Sessions¶
List Sessions¶
Query params:
- organizationSlug - Filter by organization
- teamId - Filter by team
- status - Filter by status (Draft, InProgress, Completed)
Response:
{
"sessions": [
{
"id": "session-123",
"name": "Practice - Jan 15",
"status": "Completed",
"formId": "form-456",
"createdAt": "2024-01-15T10:00:00Z",
"startedAt": "2024-01-15T10:05:00Z",
"endedAt": "2024-01-15T12:00:00Z"
}
]
}
Create Session¶
Body:
Get Session¶
Start Session¶
End Session¶
Delete Session¶
Session Logs¶
Create body:
Session Clips¶
Create body:
{
"startTime": "2024-01-15T10:30:00Z",
"endTime": "2024-01-15T10:30:30Z",
"cameraId": "camera-123"
}
Session Timeline¶
Response:
{
"timeline": [
{
"id": "item-1",
"type": "log",
"timestamp": "2024-01-15T10:15:00Z",
"data": { ... }
},
{
"id": "item-2",
"type": "clip",
"timestamp": "2024-01-15T10:30:00Z",
"data": { ... }
}
]
}
Forms¶
List Forms¶
Query params:
- organizationSlug - Filter by organization
Create Form¶
Body:
{
"name": "Game Log Template",
"schema": {
"fields": [
{
"name": "player",
"type": "text",
"required": true
},
{
"name": "action",
"type": "select",
"options": ["touchdown", "field goal", "turnover"]
}
]
}
}
Get Form¶
Update Form¶
Delete Form¶
Chats¶
List Chats¶
List Pinned Chats¶
Create Chat¶
Body:
Get Chat with Messages¶
Response:
{
"chat": {
"id": "chat-123",
"title": "Chat Title",
"pinned": false,
"archived": false,
"createdAt": "2024-01-15T10:00:00Z"
},
"messages": [
{
"id": "msg-1",
"role": "user",
"content": "Hello"
},
{
"id": "msg-2",
"role": "assistant",
"content": "Hi there!"
}
]
}
Send Message (SSE Stream)¶
Body:
Response: Server-Sent Events stream
data: {"type": "chunk", "text": "Based on"}
data: {"type": "chunk", "text": " your session"}
data: {"type": "chunk", "text": " data..."}
data: {"type": "done"}
Pin/Unpin Chat¶
Archive Chat¶
Update Chat Title¶
Body:
Delete Chat¶
Embeddings¶
List Embeddings¶
Query params:
- limit - Max results (default: 100)
- offset - Pagination offset
Upload Embedding¶
Form data:
- file - File to upload
Search by Text¶
Query params:
- query - Search text
Search by Filename¶
Query params:
- filename - Filename to match
- limit - Max results
Search Similar Content¶
Query params:
- contentType - Content type filter
- footballRelated - Boolean filter
Get Embedding¶
Get Embedding Media¶
Returns: Binary blob (image, video, etc.)
Delete Embedding¶
Training¶
List Jobs¶
Response:
{
"jobs": [
{
"id": "job-123",
"name": "Q1 Analysis Model",
"status": "completed",
"createdAt": "2024-01-15T10:00:00Z"
}
]
}
Start Training¶
Body:
{
"name": "Q1 Analysis Model",
"description": "Training on Q1 game data",
"epochs": 10,
"learningRate": 0.001,
"batchSize": 32
}
Get Job¶
Get Job Status¶
Response:
Cancel Job¶
Rollback Job¶
Vision¶
List Cameras¶
Get Connected Cameras¶
Get Active Camera¶
Change Active Camera¶
Body:
Get Detection Status¶
Enable Detection¶
Disable Detection¶
Send Stream Frame¶
Query params:
- streamName - Stream identifier (e.g., "webcam")
- streamType - Type (e.g., "frame")
Body: