Create Document
Documents in Scriptix are created through sessions. There are three methods available.
Method 1: Create Transcription Session
Create a session that transcribes audio/video to generate documents.
Endpoint
POST /api/v3/speech-to-text/session
Request
{
"language": "en",
"media_source": "https://example.com/audio.mp3",
"keep_source": true,
"diarization": true,
"punctuation": true,
"multichannel": false,
"document": {
"document_type": "document",
"filename": "Team Meeting Notes"
},
"folder_id": 123
}
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
language | string | Yes | Language code (e.g., en, nl, fr) |
media_source | string | Yes | URL to audio/video file |
keep_source | boolean | No | Keep original media file |
diarization | boolean | No | Enable speaker identification |
punctuation | boolean | No | Add automatic punctuation |
multichannel | boolean | No | Process multi-channel audio |
document.document_type | string | Yes | document or caption |
document.filename | string | Yes | Document filename |
folder_id | number | No | Folder to store document |
Response
Status: 201 Created
{
"result": {
"session_id": "sess_abc123",
"status": "queued"
}
}
Example
curl -X POST https://api.scriptix.io/api/v3/speech-to-text/session \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"language": "en",
"media_source": "https://example.com/meeting.mp3",
"diarization": true,
"document": {
"document_type": "document",
"filename": "Meeting Notes"
}
}'
Method 2: Create Alignment Session
Create a session for aligning existing text with media timestamps.
Endpoint
POST /api/v3/speech-to-text/session
Request
{
"language": "en",
"session_mode": "align",
"folder_id": 123
}
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
language | string | Yes | Language code |
session_mode | string | Yes | Must be align |
folder_id | number | No | Folder to store document |
Response
{
"result": {
"session_id": "sess_abc123",
"status": "created",
"session_mode": "align"
}
}
After creating the alignment session, upload your text and media using the session upload endpoints.
Example
curl -X POST https://api.scriptix.io/api/v3/speech-to-text/session \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"language": "en",
"session_mode": "align"
}'
Method 3: Copy Existing Document
Create a new document by copying an existing one.
Endpoint
POST /api/v3/speech-to-text/session/{sessionId}/document
Request
{
"document_type": "caption",
"filename": "Copy of Meeting Notes",
"document_id": "doc_original_123",
"folder_id": "456"
}
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
document_type | string | Yes | document or caption |
filename | string | Yes | New document filename |
document_id | string | No | Source document to copy |
folder_id | string | No | Destination folder |
Caption-Specific Parameters
When creating captions, you can specify formatting options:
| Field | Type | Description |
|---|---|---|
max_line_length | number | Maximum characters per line |
max_line_words | number | Maximum words per line |
max_segment_duration | number | Maximum segment duration (seconds) |
max_segment_lines | number | Maximum lines per segment |
max_segment_words | number | Maximum words per segment |
max_silence_between_words | number | Max silence between words (ms) |
min_segment_gap | number | Minimum gap between segments (ms) |
Webhook Configuration
| Field | Type | Description |
|---|---|---|
webhook_url | string | Webhook callback URL |
webhook_method | string | POST or PUT |
webhook_headers | string[] | Custom headers for webhook |
Response
{
"result": {
"document_id": "doc_new_456",
"filename": "Copy of Meeting Notes",
"created": "2025-01-17T10:00:00Z"
}
}
Example
curl -X POST https://api.scriptix.io/api/v3/speech-to-text/session/sess_abc123/document \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"document_type": "caption",
"filename": "Subtitles Copy",
"document_id": "doc_original",
"max_line_length": 42,
"max_segment_duration": 7
}'
Session Modes
| Mode | Description | Use Case |
|---|---|---|
decode | Transcribe audio/video | Create transcript from media |
align | Align text with media | Add timestamps to existing text |
upload | Direct upload | Upload pre-existing documents |
Monitoring Session Status
After creating a session, monitor its status:
curl https://api.scriptix.io/api/v3/speech-to-text/session/{sessionId} \
-H "Authorization: Bearer YOUR_API_KEY"
Session status values: queued, processing, completed, failed
Related
- Documents Overview - Complete API reference
- Retrieve Document - Get document content
- Update Document - Modify documents