Skip to content

Create a new document

Info

Documents are currently in BETA and the API interface may change when this is deemed necessary.

Create a new document from a TranscriptSession result

Use correct API token

It is impodent that the correct API token is used for document creation. Only the token linked to the TranscriptSession can be used.

URL: POST https://api.scriptix.io/api/v3/speech-to-text/session/${sessionId}/document/

Request headers

The following headers need to be present

Parameter Value Description
Content-Type application/json
X-Zoom-S2T-Key Scriptix Batch API Token API key belonging to TranscriptSession

Request path arguments

Argument Description
sessionId Scriptix Transcript Session ID returned from a Batch Session

Realtime sessions

At this moment realtime session do not get their results recorded, as such it is not possible to create a document for those session.

JSON Body Schema

Key Type Description
document_type Enum[string]: "caption","document" Sets the type of document which will be created. See document types.
filename string[200] The name for the document.
max_line_length integer [1..200] | null (Optional) Controls the maximum length of a line in a segment block. When the maximum is reached a new line will be added to the segment. If set to null this option is ignored during rendering. This option is only applicable to documents of the type caption.
max_line_words integer [1..100] | null (Optional) Controls the maximum number of words on a line in a segment block. When the maximum is reached a new line will be added to the segment. If set to null this option is ignored during rendering. This option is only applicable to documents of the type caption.
max_segment_duration integer [1..200000] | null (Optional) Controls the maximum number of milliseconds a segment will be visible, when the maximum is reached a new segment is created. If set to null this option is ignored during rendering. This option is only applicable to documents of the type caption.
max_segment_lines integer [1..4] | null (Optional) Controls the maximum number lines in a segment, when the maximum is reached a new segment is created. If set to null this option is ignored during rendering. This option is only applicable to documents of the type caption.
max_segment_words integer [1..100] | null (Optional) Controls the maximum number of words in a segment, when the maximum is reached a new segment is created. If set to null this option is ignored during rendering. This option is only applicable to documents of the type caption.
max_silence_between_words integer [1..20000] | null (Optional) Controls the maximum allowed milliseconds of silence between two words. When the maximum is reached a new segment is created. If set to null this option is ignored during rendering. This option is only applicable to documents of the type caption.
min_segment_gap integer [0..1000] (Optional) Controls the minimum amount of time in milliseconds between two segments. If the gap between the two segments is not large enough it will be extended by shortening segment one with 2/3rd of the minimal gap and segment two with 1/3rd of the minimal gap. This option is only applicable to documents of the type caption.
webhook_headers string[] (Optional) Array of headers that needs to be present in the callback request. Requires webhook_url to be set.

Headers must be formatted in the following format: Custom-Header-Name: Header Value
webhook_method Enum: POST, PUT Default: POST

(Optional) Specify the method to use for the HTTP callback. Requires webhook_url to be set.
webhook_url string (Optional) If set a HTTPS callback will be made to a web endpoint once the transcription is done.

Default values

The default values are document type specific, you can find these in the document types

Responses codes

Status code Description
201 Document created
400 Bad request, JSON payload may be invalid
401 Unauthorized, no valid authentication found
403 Forbidden, access to resource is not allowed
404 Not found, the transcript session is not found or does not belong to the provided API token

Responses

HTTP 201 Created

Content-type: application/json

Response: APIResultResponse<DocumentModel>

JSON Response
{
    "result": {
        "id": "12780b54-5575-44e4-bbca-0a410b432183",
        "created": "2021-01-25T10:31:46.960411+00:00",
        "last_modified": "2021-01-25T10:31:46.960411+00:00",
        "filename": "Example document",
        "type": "caption"
    }
}

Document types

Document

A document is created in the same internal format as an caption, with the following (non-modifyable) defaults.

  • Maximum lines per segment: 1
  • Maximum segment duration 60 seconds

Defaults may change

The defaults may change upon customer feedback without further notice.

Caption

A document is created in the same internal format as an caption (and can theoretically also be downloaded in subtitle format), with the following (non-modifyable) defaults.

  • Maximum silence between words: 1.5 seconds
  • Maximum line length: 37 characters
  • Maximum words per line: 12
  • Maximum segment duration: 7 seconds
  • Maximmum number of lines per segment: 2
  • Maximum words per segment: 24
  • Minimum gap between segments: 120ms

Defaults may change

The defaults may change upon customer feedback without further notice.