Skip to content

Speakr is a personal, self-hosted web application designed for transcribing audio recordings

Python

Docs: document v0.9.0 API endpoints (folders CRUD, users/me, webhooks, connector discovery, per-request transcribe overrides, new recording fields)

Murtaza Nasir664e83603c24
diff --git a/docs/user-guide/api-reference.md b/docs/user-guide/api-reference.md
index 30f5cc0c..7393ed05 100644
--- a/docs/user-guide/api-reference.md
+++ b/docs/user-guide/api-reference.md
@@ -128,6 +128,55 @@ GET /api/v1/stats
---
+## Current User
+
+### Get Current User
+
+```http
+GET /api/v1/users/me
+```
+
+Returns the authenticated user's profile, preferences, and group memberships. Useful for companion apps and automation flows that need to display the current user's identity.
+
+**Response:**
+
+```json
+{
+ "id": 42,
+ "username": "alice",
+ "email": "[email protected]",
+ "name": "Alice Johnson",
+ "job_title": "Product Manager",
+ "company": "Acme Inc",
+ "is_admin": false,
+ "email_verified": true,
+ "sso_provider": null,
+ "can_share_publicly": true,
+ "preferences": {
+ "ui_language": "en",
+ "transcription_language": "en",
+ "output_language": "en",
+ "extract_events": true,
+ "auto_speaker_labelling": true,
+ "auto_speaker_labelling_threshold": 0.75,
+ "auto_summarization": true,
+ "show_timestamps_simple_view": false,
+ "editor_autosave": true,
+ "diarize": true
+ },
+ "group_memberships": [
+ {
+ "group_id": 3,
+ "group_name": "Engineering",
+ "role": "admin",
+ "joined_at": "2024-01-10T08:00:00Z"
+ }
+ ]
+}
+```
+
+---
+
## Recordings
### Upload Recording
@@ -201,6 +250,7 @@ GET /api/v1/recordings
| `q` | string | - | Search query (title, participants) |
| `inbox` | boolean | - | Filter by inbox status |
| `starred` | boolean | - | Filter by starred status |
+| `folder_id` | string | - | Filter by folder. Pass an integer folder ID to list recordings in that folder, or the literal `none` to list recordings not in any folder. Requires folders to be enabled. |
**Response:**
@@ -212,6 +262,7 @@ GET /api/v1/recordings
"title": "Team Meeting",
"status": "COMPLETED",
"created_at": "2024-01-15T10:00:00Z",
+ "completed_at": "2024-01-15T10:05:00Z",
"meeting_date": "2024-01-15T09:00:00Z",
"file_size": 15728640,
"original_filename": "meeting.mp3",
@@ -219,8 +270,17 @@ GET /api/v1/recordings
"is_inbox": false,
"is_highlighted": true,
"audio_available": true,
+ "audio_duration": 1830.5,
"has_transcription": true,
"has_summary": true,
+ "processing_time_seconds": 45.2,
+ "transcription_duration_seconds": 38.1,
+ "summarization_duration_seconds": 7.1,
+ "folder_id": 5,
+ "folder": {"id": 5, "name": "Client Calls"},
+ "deletion_exempt": false,
+ "error_message": null,
+ "keep_audio_only": false,
"tags": [
{"id": 1, "name": "Work", "color": "#3B82F6"}
]
@@ -267,14 +327,35 @@ GET /api/v1/recordings/{id}
"is_inbox": false,
"is_highlighted": true,
"audio_available": true,
+ "audio_duration": 1830.5,
"processing_time_seconds": 45.2,
+ "transcription_duration_seconds": 38.1,
+ "summarization_duration_seconds": 7.1,
+ "folder_id": 5,
+ "folder": {"id": 5, "name": "Client Calls"},
+ "deletion_exempt": false,
+ "events": [
+ {
+ "id": 1,
+ "title": "Follow-up Meeting",
+ "start_datetime": "2024-01-22T10:00:00Z",
+ "end_datetime": "2024-01-22T11:00:00Z",
+ "description": "Discuss project progress",
+ "location": "Conference Room A"
+ }
+ ],
+ "error_message": null,
+ "duplicate_info": null,
+ "keep_audio_only": false,
"transcription": "Alice: Hello everyone...",
"summary": "## Meeting Summary\n- Key point 1...",
- "notes": "Personal notes...",
- "tags": [{"id": 1, "name": "Work", "color": "#3B82F6"}]
+ "notes": "Personal notes..."
}
```
+!!! note "Field notes"
+ `audio_duration` is in seconds. The `*_duration_seconds` fields report how long each processing stage took. `events` is only populated when calendar-event extraction is enabled. `error_message` is non-null only when `status` is `FAILED`. `folder` / `folder_id` are populated when folders are enabled and the recording is assigned to one.
+
!!! note "Transcript Formatting"
The `transcription` field is automatically formatted using your default transcript template. Configure templates in Account Settings → Transcript Templates.
@@ -404,11 +485,12 @@ PATCH /api/v1/recordings/{id}
"summary": "Updated summary...",
"meeting_date": "2024-01-15T09:00:00Z",
"is_inbox": false,
- "is_highlighted": true
+ "is_highlighted": true,
+ "folder_id": 5
}
```
-All fields are optional.
+All fields are optional. Set `folder_id` to an integer to move the recording into that folder (you must have access to the target folder), or to `null` to remove it from any folder. `folder_id` requires folders to be enabled.
### Replace Notes
@@ -656,12 +738,24 @@ POST /api/v1/recordings/{id}/transcribe
{
"language": "en",
"min_speakers": 1,
- "max_speakers": 5
+ "max_speakers": 5,
+ "hotwords": "Speakr, WhisperX, diarization",
+ "initial_prompt": "Technical discussion about audio transcription.",
+ "transcription_model": "gpt-4o-transcribe-diarize"
}
```
All parameters are optional.
+| Parameter | Type | Description |
+|-----------|------|-------------|
+| `language` | string | Language hint (ISO 639-1). Empty string forces auto-detect. |
+| `min_speakers` | integer | Minimum speaker count for diarization. |
+| `max_speakers` | integer | Maximum speaker count for diarization. |
+| `hotwords` | string | Word-biasing hint. Connectors that accept biasing route this to their native parameter (WhisperX hotwords, Mistral context bias, OpenAI prompt). Connectors that ignore it drop it silently. |
+| `initial_prompt` | string | Free-text context hint. Same per-connector behavior as `hotwords`. |
+| `transcription_model` | string | Per-request model override. Validated against the admin-curated visible-models list; falls back to the configured default if absent or invalid. Use [`GET /api/v1/transcription`](#transcription-connector) to discover valid values. |
+
**Response:**
```json
@@ -794,11 +888,14 @@ PATCH /api/v1/recordings/batch
"is_inbox": false,
"is_highlighted": true,
"add_tag_ids": [5],
- "remove_tag_ids": [2]
+ "remove_tag_ids": [2],
+ "folder_id": 5
}
}
```
+Supported `updates` fields: `is_inbox`, `is_highlighted`, `add_tag_ids`, `remove_tag_ids`, and `folder_id` (move all selected recordings into that folder, or `null` to remove them from their folders; you must have access to the target folder, and folders must be enabled). A `403` is returned if you lack access to the target folder, and `404` if it does not exist.
+
**Response:**
```json
@@ -844,6 +941,374 @@ POST /api/v1/recordings/batch/transcribe
---
+## Folders
+
+Folders organize recordings into a one-to-many structure (a recording belongs to at most one folder).
+
+!!! note "Folders must be enabled"
+ The folders feature is off by default. An administrator must enable it under **System Settings → `enable_folders`**. While disabled, `GET /api/v1/folders` returns an empty list and the create/update/delete endpoints return `403 {"error": "Folders feature is not enabled"}`.
+
+Folders can be personal or group-scoped. Personal folders are editable only by their owner. Group folders are visible to all members of the group but editable only by group admins. Each folder's `to_dict()` includes a `can_edit` flag indicating whether the calling user may modify it.
+
+### List Folders
+
+```http
+GET /api/v1/folders
+```
+
+Returns personal folders plus any group folders you have access to.
+
+**Response:**
+
+```json
+[
+ {
+ "id": 5,
+ "name": "Client Calls",
+ "color": "#10B981",
+ "group_id": null,
+ "is_group_folder": false,
+ "group_name": null,
+ "custom_prompt": "Focus on action items...",
+ "default_language": "en",
+ "default_min_speakers": 2,
+ "default_max_speakers": 5,
+ "default_hotwords": null,
+ "default_initial_prompt": null,
+ "default_transcription_model": null,
+ "protect_from_deletion": false,
+ "retention_days": null,
+ "auto_share_on_apply": true,
+ "share_with_group_lead": true,
+ "naming_template_id": null,
+ "naming_template_name": null,
+ "export_template_id": null,
+ "export_template_name": null,
+ "created_at": "2024-01-10T08:00:00Z",
+ "recording_count": 12,
+ "can_edit": true,
+ "user_role": null
+ }
+]
+```
+
+### Get Folder
+
+```http
+GET /api/v1/folders/{id}
+```
+
+Returns a single folder. You must own a personal folder, or be a member of the group for a group folder. The response is the folder object above (with `can_edit`).
+
+### Create Folder
+
+```http
+POST /api/v1/folders
+```
+
+**Request Body:**
+
+```json
+{
+ "name": "Client Calls",
+ "color": "#10B981",
+ "group_id": null,
+ "custom_prompt": "Focus on action items...",
+ "default_language": "en",
+ "default_min_speakers": 2,
+ "default_max_speakers": 5,
+ "default_hotwords": "Acme, Speakr",
+ "default_initial_prompt": "Sales call.",
+ "default_transcription_model": "gpt-4o-transcribe-diarize",
+ "retention_days": null
+}
+```
+
+Only `name` is required. Set `group_id` to create a group folder (you must be an admin of that group). Use `retention_days: -1` to mark the folder as protected from auto-deletion (only effective when auto-deletion is enabled at the server). Returns the created folder with `201`.
+
+### Update Folder
+
+```http
+PATCH /api/v1/folders/{id}
+PUT /api/v1/folders/{id}
+```
+
+Accepts the same fields as create; all are optional. Only the folder owner (personal) or a group admin (group folder) may update. Returns the updated folder.
+
+### Delete Folder
+
+```http
+DELETE /api/v1/folders/{id}
+```
+
+Recordings in the deleted folder are unassigned (their `folder_id` becomes `null`); they are not deleted. Only the folder owner (personal) or a group admin (group folder) may delete.
+
+**Response:**
+
+```json
+{"success": true}
+```
+
+!!! tip "Assigning recordings to folders"
+ To move a recording into or out of a folder, set `folder_id` on [`PATCH /api/v1/recordings/{id}`](#update-recording) or in the `updates` object of [batch update](#batch-update-recordings). To list a folder's recordings, use `GET /api/v1/recordings?folder_id={id}` (or `folder_id=none` for unfiled recordings).
+
+---
+
+## Transcription Connector
+
+### Discover Active Connector {: #transcription-connector }
+
+```http
+GET /api/v1/transcription
+```
+
+Returns the active transcription connector, the optional fields it accepts, the admin-curated list of selectable models, and the configured default model. Use this to drive client UIs and to know which values are valid for the `transcription_model` override on `/recordings/{id}/transcribe` and `/recordings/upload`.
+
+**Response:**
+
+```json
+{
+ "connector": "openai_transcribe",
+ "capabilities": {
+ "diarization": true,
+ "speaker_count_control": false,
+ "hotwords": true,
+ "initial_prompt": true,
+ "timestamps": true,
+ "language_detection": true,
+ "chunking": false
+ },
+ "models": [
+ {"value": "gpt-4o-transcribe-diarize", "label": "GPT-4o Diarize"}
+ ],
+ "default_model": "gpt-4o-transcribe-diarize"
+}
+```
+
+`connector` may be `null` when the legacy transcription architecture is in use. The `capabilities` flags indicate which optional request fields (`hotwords`, `initial_prompt`, speaker-count controls) the active connector honors; connectors that do not support a field drop it silently.
+
+---
+
+## Webhooks
+
+Webhooks deliver event notifications to an external URL when things happen to your recordings. Each webhook is owned by the user who creates it. The number of webhooks per user is capped (default 10, configurable by the administrator via `WEBHOOK_MAX_PER_USER`).
+
+!!! info "Delivery security and reliability"
+ Each delivery is signed with an HMAC-SHA256 signature sent in the `Speakr-Signature` header (formatted as `sha256=<hex>`), computed over the raw request body using the webhook's secret. Deliveries also carry `Speakr-Delivery-Id` (a UUID for idempotency), `Speakr-Event` (the event type), and `Speakr-Timestamp` headers. Failed deliveries are retried automatically; after a configurable number of consecutive failures (`WEBHOOK_AUTOPAUSE_FAILURES`, default 10) the webhook is auto-paused (`auto_paused: true`, `enabled: false`). Re-enabling it manually clears the auto-pause flag.
+
+For administrator-level configuration and receiver setup, see the [Webhooks admin guide](../admin-guide/webhooks.md).
+
+### Event Types
+
+These are the event types a webhook can subscribe to:
+
+| Event | Fired when |
+|-------|-----------|
+| `recording.created` | A recording is created |
+| `recording.transcription.started` | Transcription begins |
+| `recording.transcription.completed` | Transcription finishes successfully |
+| `recording.transcription.failed` | Transcription fails |
+| `recording.summary.completed` | Summary generation finishes |
+| `recording.summary.failed` | Summary generation fails |
+| `recording.events.extracted` | Calendar events are extracted |
+| `recording.updated` | A recording is updated |
+| `recording.deleted` | A recording is deleted |
+| `webhook.test` | A manual test delivery (see Test Webhook below) |
+
+### List Webhooks
+
+```http
+GET /api/v1/webhooks
+```
+
+**Response:**
+
+```json
+{
+ "webhooks": [
+ {
+ "id": 1,
+ "user_id": 42,
+ "name": "n8n pipeline",
+ "url": "https://hooks.example.com/speakr",
+ "allow_http": false,
+ "events": ["recording.transcription.completed", "recording.summary.completed"],
+ "enabled": true,
+ "auto_paused": false,
+ "consecutive_failures": 0,
+ "created_at": "2024-01-15T10:00:00Z",
+ "updated_at": "2024-01-15T10:00:00Z",
+ "last_delivery_at": "2024-01-16T09:30:00Z"
+ }
+ ],
+ "event_types": [
+ "recording.created",
+ "recording.transcription.started",
+ "recording.transcription.completed",
+ "recording.transcription.failed",
+ "recording.summary.completed",
+ "recording.summary.failed",
+ "recording.events.extracted",
+ "recording.updated",
+ "recording.deleted",
+ "webhook.test"
+ ],
+ "max_per_user": 10
+}
+```
+
+The webhook's HMAC `secret` is **never** returned by this endpoint. It is shown only once, in the create and rotate-secret responses.
+
+### Create Webhook
+
+```http
+POST /api/v1/webhooks
+```
+
+**Request Body:**
+
+```json
+{
+ "name": "n8n pipeline",
+ "url": "https://hooks.example.com/speakr",
+ "events": ["recording.transcription.completed"],
+ "allow_http": false,
+ "enabled": true
+}
+```
+
+`name`, `url`, and a non-empty `events` array are required; every event must be a known event type. `allow_http` (default `false`) must be `true` for `http://` URLs. The URL is validated against an SSRF guard. Exceeding the per-user cap returns `409`.
+
+**Response** (`201`): the webhook object, including the `secret` field **once**:
+
+```json
+{
+ "id": 1,
+ "user_id": 42,
+ "name": "n8n pipeline",
+ "url": "https://hooks.example.com/speakr",
+ "allow_http": false,
+ "events": ["recording.transcription.completed"],
+ "enabled": true,
+ "auto_paused": false,
+ "consecutive_failures": 0,
+ "created_at": "2024-01-15T10:00:00Z",
+ "updated_at": "2024-01-15T10:00:00Z",
+ "last_delivery_at": null,
+ "secret": "xK9...copy-me-now..."
+}
+```
+
+### Get Webhook
+
+```http
+GET /api/v1/webhooks/{id}
+```
+
+Returns the webhook object (without the secret).
+
+### Update Webhook
+
+```http
+PATCH /api/v1/webhooks/{id}
+```
+
+**Request Body** (all fields optional):
+
+```json
+{
+ "name": "Updated name",
+ "url": "https://hooks.example.com/v2",
+ "events": ["recording.transcription.completed", "recording.deleted"],
+ "allow_http": false,
+ "enabled": true
+}
+```
+
+When provided, `events` must be a non-empty array of known event types. Setting `enabled: true` also clears the `auto_paused` flag. Returns the updated webhook.
+
+### Delete Webhook
+
+```http
+DELETE /api/v1/webhooks/{id}
+```
+
+Returns `204 No Content`.
+
+### Rotate Secret
+
+```http
+POST /api/v1/webhooks/{id}/rotate-secret
+```
+
+Generates a fresh HMAC secret and returns the webhook object with the new `secret` included once. Existing deliveries already signed with the old secret are not re-signed.
+
+### Test Webhook
+
+```http
+POST /api/v1/webhooks/{id}/test
+```
+
+Enqueues a synthetic `webhook.test` delivery against this single webhook so you can verify reachability before subscribing to production events. The webhook must be enabled (otherwise `409`).
+
+**Response** (`202`): the created delivery object (see below).
+
+### List Deliveries
+
+```http
+GET /api/v1/webhooks/{id}/deliveries
+```
+
+**Query Parameters:**
+
+| Parameter | Type | Default | Description |
+|-----------|------|---------|-------------|
+| `limit` | integer | 50 | Max deliveries to return (1–200) |
+
+**Response:**
+
+```json
+{
+ "deliveries": [
+ {
+ "id": 1001,
+ "webhook_id": 1,
+ "event_id": "550e8400-e29b-41d4-a716-446655440000",
+ "event_type": "recording.transcription.completed",
+ "attempt_count": 1,
+ "status": "success",
+ "response_status": 200,
+ "response_body_preview": "{\"ok\":true}",
+ "error_message": null,
+ "next_retry_at": null,
+ "created_at": "2024-01-16T09:30:00Z",
+ "delivered_at": "2024-01-16T09:30:01Z"
+ }
+ ],
+ "limit": 50
+}
+```
+
+Delivery `status` is one of `pending`, `success`, `failed` (retryable), or `permanent_failure` (retries exhausted or non-retryable).
+
+### Get Delivery
+
+```http
+GET /api/v1/webhooks/{id}/deliveries/{delivery_id}
+```
+
+Returns a single delivery. This response additionally includes the full serialized `payload` (the exact JSON body that was/will be POSTed) for debugging.
+
+### Replay Delivery
+
+```http
+POST /api/v1/webhooks/{id}/deliveries/{delivery_id}/replay
+```
+
+Re-enqueues the delivery as a brand-new attempt with the same payload (with a fresh `event_id` and timestamp, plus a `replayed_from` reference to the original). Returns the new delivery object with `202`.
+
+---
+
## Error Responses
All endpoints return consistent error responses:
diff --git a/docs/user-guide/api-tokens.md b/docs/user-guide/api-tokens.md
index c1b4bf48..bc983083 100644
--- a/docs/user-guide/api-tokens.md
+++ b/docs/user-guide/api-tokens.md
@@ -86,6 +86,10 @@ Speakr provides a comprehensive REST API with endpoints for recordings, tags, sp
| `/api/v1/recordings/<id>/summarize` | POST | Queue summarization |
| `/api/v1/tags` | GET | List your tags |
| `/api/v1/speakers` | GET | List your speakers |
+| `/api/v1/users/me` | GET | Get the current user's profile and group memberships |
+| `/api/v1/folders` | GET / POST | List or create folders (requires folders enabled) |
+| `/api/v1/transcription` | GET | Discover the active transcription connector and selectable models |
+| `/api/v1/webhooks` | GET / POST | List or create event webhooks |
### Example: List Recordings