API Documentation¶
Backend API reference for the Huh platform.
Base URL¶
All API endpoints are prefixed with /api.
Authentication¶
Most endpoints require JWT authentication. Include the token in the Authorization header:
Endpoints¶
Authentication¶
POST /api/auth/register¶
Register a new user account.
Request Body:
Response: 201 Created
POST /api/auth/login¶
Authenticate and receive JWT token.
Request Body:
Response: 200 OK
{
"accessToken": "string",
"tokenType": "Bearer",
"user": {
"id": "string",
"username": "string",
"email": "string",
"roles": ["ROLE_USER"],
"approved": true,
"approvedAt": "2024-01-01T00:00:00"
}
}
GET /api/auth/me¶
Get current authenticated user information.
Response: 200 OK
{
"id": "string",
"username": "string",
"email": "string",
"roles": ["ROLE_USER"],
"approved": true
}
Transcriptions¶
GET /api/transcriptions¶
Get all transcriptions (filtered by ACL permissions).
Response: 200 OK
[
{
"id": "string",
"title": "string",
"fileName": "string",
"status": "pending|processing|completed|error",
"segments": [],
"language": "string",
"createdAt": "2024-01-01T00:00:00"
}
]
GET /api/transcriptions/{id}¶
Get transcription by ID (requires READ permission).
Response: 200 OK
POST /api/transcriptions¶
Create new transcription.
Request: multipart/form-data
- file: File (optional if sourceUrl provided)
- sourceUrl: String (optional if file provided)
- language: String
- modelSize: String
- device: String
- deleteAt: String (ISO datetime, optional)
Response: 201 Created
POST /api/transcriptions/{id}/video-token¶
Get video access token (sets HTTP-only cookie).
Response: 200 OK
ACL¶
GET /api/acl/transcriptions/{transcriptionId}¶
Get ACL entries for a transcription.
Response: 200 OK
{
"entries": [
{
"sid": "string",
"principal": true,
"permission": "READ|WRITE",
"permissionValue": 1
}
]
}
POST /api/acl/transcriptions/{transcriptionId}/grant¶
Grant permission to user/role.
Request Body:
DELETE /api/acl/transcriptions/{transcriptionId}/revoke¶
Revoke permission from user/role.
Request Body:
Users (Admin Only)¶
GET /api/users¶
Get all users (requires ROLE_ADMIN).
Response: 200 OK
[
{
"id": "string",
"username": "string",
"email": "string",
"roles": ["ROLE_USER"],
"approved": true
}
]
POST /api/users/invite¶
Invite a new user (requires ROLE_ADMIN).
Request Body:
Instance Settings (Admin Only)¶
GET /api/instance-settings¶
Get instance settings (requires ROLE_ADMIN).
Response: 200 OK
PUT /api/instance-settings¶
Update instance settings (requires ROLE_ADMIN).
WebSocket¶
Endpoint: /ws/transcriptions¶
Subscribe to real-time transcription updates.
Message Format:
Error Responses¶
400 Bad Request¶
401 Unauthorized¶
403 Forbidden¶
404 Not Found¶
Empty response body