Skip to main content

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

FieldTypeRequiredDescription
languagestringYesLanguage code (e.g., en, nl, fr)
media_sourcestringYesURL to audio/video file
keep_sourcebooleanNoKeep original media file
diarizationbooleanNoEnable speaker identification
punctuationbooleanNoAdd automatic punctuation
multichannelbooleanNoProcess multi-channel audio
document.document_typestringYesdocument or caption
document.filenamestringYesDocument filename
folder_idnumberNoFolder 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

FieldTypeRequiredDescription
languagestringYesLanguage code
session_modestringYesMust be align
folder_idnumberNoFolder 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

FieldTypeRequiredDescription
document_typestringYesdocument or caption
filenamestringYesNew document filename
document_idstringNoSource document to copy
folder_idstringNoDestination folder

Caption-Specific Parameters

When creating captions, you can specify formatting options:

FieldTypeDescription
max_line_lengthnumberMaximum characters per line
max_line_wordsnumberMaximum words per line
max_segment_durationnumberMaximum segment duration (seconds)
max_segment_linesnumberMaximum lines per segment
max_segment_wordsnumberMaximum words per segment
max_silence_between_wordsnumberMax silence between words (ms)
min_segment_gapnumberMinimum gap between segments (ms)

Webhook Configuration

FieldTypeDescription
webhook_urlstringWebhook callback URL
webhook_methodstringPOST or PUT
webhook_headersstring[]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

ModeDescriptionUse Case
decodeTranscribe audio/videoCreate transcript from media
alignAlign text with mediaAdd timestamps to existing text
uploadDirect uploadUpload 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