Export Document
Export documents to various formats with direct Azure Blob Storage download or streaming.
Endpoint
GET /api/v3/speech-to-text/session/{sessionId}/document/{documentId}?format={format}
Export Modes
Scriptix supports two export modes for cost optimization:
1. Direct Download (Recommended)
Returns a time-limited Azure Blob Storage URL for direct browser download.
GET /api/v3/speech-to-text/session/{sessionId}/document/{documentId}?format={format}&direct_download=true
2. Streaming Download
Streams the file through the API (fallback when pre-generated files unavailable).
GET /api/v3/speech-to-text/session/{sessionId}/document/{documentId}?format={format}
Supported Formats
Caption Formats
| Format | Extension | Description |
|---|---|---|
srt | .srt | SubRip subtitles (most common) |
vtt | .vtt | WebVTT subtitles (web standard) |
sbv | .sbv | YouTube subtitle format |
ttml | .ttml | Timed Text Markup Language (XML-based) |
stl | .stl | EBU-STL subtitle format (broadcast) |
Document Formats
| Format | Extension | Description |
|---|---|---|
docx | .docx | Microsoft Word (editable) |
pdf | PDF document | |
txt | .txt | Plain text |
html | .html | HTML formatted |
Media Format
| Format | Extension | Description |
|---|---|---|
media | varies | Original media file (audio/video) |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
format | string | No | Export format (defaults to JSON document) |
direct_download | boolean | No | Get Azure SAS URL instead of streaming |
without_timestamps | boolean | No | Exclude timestamps from export |
without_speakers | boolean | No | Exclude speaker labels from export |
template_id | number | No | Use custom export template (DOCX/PDF) |
token | string | No* | Magic link token (for shared documents) |
*Required for shared document downloads
Response Formats
Direct Download Response
Status: 200 OK
{
"result": {
"download_url": "https://storage.azure.com/...?sas_token",
"expires_in": 3600,
"filename": "transcript.srt",
"content_type": "text/plain",
"size_bytes": 12450
}
}
| Field | Type | Description |
|---|---|---|
download_url | string | Azure Blob Storage SAS URL (1 hour expiry) |
expires_in | number | URL expiration time in seconds |
filename | string | Suggested filename for download |
content_type | string | MIME type of the file |
size_bytes | number | File size in bytes |
Streaming Response
Status: 200 OK
Binary file content with headers:
Content-Type: File MIME typeContent-Disposition:attachment; filename="transcript.srt"
Email Processing Response
Status: 204 No Content
File will be emailed after processing (for large exports).
Examples
Basic Export to SRT
curl "https://api.scriptix.io/api/v3/speech-to-text/session/sess_abc123/document/doc_xyz789?format=srt" \
-H "Authorization: Bearer YOUR_API_KEY"
Direct Download (Recommended)
curl "https://api.scriptix.io/api/v3/speech-to-text/session/sess_abc123/document/doc_xyz789?format=docx&direct_download=true" \
-H "Authorization: Bearer YOUR_API_KEY"
Response:
{
"result": {
"download_url": "https://storage.azure.com/documents/abc123.docx?sv=2021-06-08&...",
"expires_in": 3600,
"filename": "Meeting Notes.docx",
"content_type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"size_bytes": 45678
}
}
Then download:
curl -o "meeting.docx" "https://storage.azure.com/documents/abc123.docx?sv=..."
Export Without Timestamps
curl "https://api.scriptix.io/api/v3/speech-to-text/session/sess_abc123/document/doc_xyz789?format=txt&without_timestamps=true" \
-H "Authorization: Bearer YOUR_API_KEY"
Export Without Speakers
curl "https://api.scriptix.io/api/v3/speech-to-text/session/sess_abc123/document/doc_xyz789?format=srt&without_speakers=true" \
-H "Authorization: Bearer YOUR_API_KEY"
Export with Custom Template
curl "https://api.scriptix.io/api/v3/speech-to-text/session/sess_abc123/document/doc_xyz789?format=docx&template_id=456&direct_download=true" \
-H "Authorization: Bearer YOUR_API_KEY"
Export Templates
Organizations can create custom DOCX/PDF export templates with branding and formatting.
List Templates
curl https://api.scriptix.io/api/v3/organization/templates \
-H "Authorization: Bearer YOUR_API_KEY"
Export with Template
curl "https://api.scriptix.io/api/v3/speech-to-text/session/sess_abc123/document/doc_xyz789?template_id=123&direct_download=true" \
-H "Authorization: Bearer YOUR_API_KEY"
Templates support:
- Custom headers/footers
- Company branding
- Formatted layouts
- Automatic summarization (AI-powered)
Shared Document Export
Export shared documents (magic link access) without authentication:
curl "https://api.scriptix.io/api/v3/speech-to-text/session/sess_abc123/shared/document/doc_xyz789?format=srt&token=MAGIC_LINK_TOKEN&direct_download=true"
Note: Shared export endpoint uses /shared/document/ path instead of /document/.
Special Operations
Summarize Document
Generate AI-powered summary (separate endpoint):
curl -X POST "https://api.scriptix.io/api/v3/speech-to-text/session/sess_abc123/document/doc_xyz789/export/summarize" \
-H "Authorization: Bearer YOUR_API_KEY"
Returns summary instead of full export.
Error Responses
See Error Handling for complete error reference.
Common errors:
- 400: Invalid format or parameters
- 404: Document not found
- 409: Template unavailable or quota exceeded
Cost Optimization
Use direct_download=true for DOCX, PDF, and template exports to reduce load balancer costs via direct Azure Blob Storage access.
Related
- Documents Overview - Complete API reference
- Retrieve Document - Get document content
- Translation - Multi-language translation