Skip to main content

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:

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

FormatExtensionDescription
srt.srtSubRip subtitles (most common)
vtt.vttWebVTT subtitles (web standard)
sbv.sbvYouTube subtitle format
ttml.ttmlTimed Text Markup Language (XML-based)
stl.stlEBU-STL subtitle format (broadcast)

Document Formats

FormatExtensionDescription
docx.docxMicrosoft Word (editable)
pdf.pdfPDF document
txt.txtPlain text
html.htmlHTML formatted

Media Format

FormatExtensionDescription
mediavariesOriginal media file (audio/video)

Query Parameters

ParameterTypeRequiredDescription
formatstringNoExport format (defaults to JSON document)
direct_downloadbooleanNoGet Azure SAS URL instead of streaming
without_timestampsbooleanNoExclude timestamps from export
without_speakersbooleanNoExclude speaker labels from export
template_idnumberNoUse custom export template (DOCX/PDF)
tokenstringNo*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
}
}
FieldTypeDescription
download_urlstringAzure Blob Storage SAS URL (1 hour expiry)
expires_innumberURL expiration time in seconds
filenamestringSuggested filename for download
content_typestringMIME type of the file
size_bytesnumberFile size in bytes

Streaming Response

Status: 200 OK

Binary file content with headers:

  • Content-Type: File MIME type
  • Content-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"
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.