Skip to main content

Update Document

Update document content, metadata, or settings.

Endpoint

PUT /api/v3/speech-to-text/session/{sessionId}/document/{documentId}

Request

{
"filename": "Updated Meeting Notes",
"document": {
"document_type": "document",
"content": {...}
},
"timecode_offset": "00:00:00:00",
"plain_document_changed": false
}

Parameters

FieldTypeRequiredDescription
filenamestringNoUpdated document filename
documentobjectNoComplete document content object
timecode_offsetstringNoTimecode offset for synchronization (format: HH:MM:SS:FF)
plain_document_changedbooleanNoWhether plain text version was modified

Response

Status: 200 OK

{
"count": 1,
"total_results": 1,
"result": {
"id": "doc_abc123",
"filename": "Updated Meeting Notes",
"type": "document",
"language": "en",
"last_modified": "2025-01-17T16:00:00Z",
"finished": false
}
}

Examples

Update Filename

curl -X PUT https://api.scriptix.io/api/v3/speech-to-text/session/sess_abc123/document/doc_xyz789 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"filename": "Updated Meeting Notes"
}'

Update Document Content

curl -X PUT https://api.scriptix.io/api/v3/speech-to-text/session/sess_abc123/document/doc_xyz789 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"document": {
"document_type": "document",
"metadata": {...},
"content": {...}
}
}'

Document Status Operations

Finalize Document

Mark a document as finished/completed.

curl -X POST https://api.scriptix.io/api/v3/speech-to-text/session/{sessionId}/document/{documentId}/finished_status?status=true \
-H "Authorization: Bearer YOUR_API_KEY"

Set status=false to mark as unfinished.

Clear Document Text

Remove all text content while preserving structure.

curl -X PUT https://api.scriptix.io/api/v3/speech-to-text/session/{sessionId}/document/{documentId}/clear_text \
-H "Authorization: Bearer YOUR_API_KEY"

Reset to Original

Restore document to its original transcribed state.

curl -X PUT https://api.scriptix.io/api/v3/speech-to-text/session/{sessionId}/document/{documentId}/reset_to_original \
-H "Authorization: Bearer YOUR_API_KEY"

Update Comments

Documents support collaborative comments.

Add Comment

curl -X POST https://api.scriptix.io/api/v3/speech-to-text/session/{sessionId}/document/{documentId}/comments \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Review this section",
"timestamp": 125.5
}'

Update Comment

curl -X PUT https://api.scriptix.io/api/v3/speech-to-text/session/{sessionId}/document/{documentId}/comments/{commentId} \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Updated comment text"
}'

Delete Comment

curl -X DELETE https://api.scriptix.io/api/v3/speech-to-text/session/{sessionId}/document/{documentId}/comments/{commentId} \
-H "Authorization: Bearer YOUR_API_KEY"

Shared Documents

Update shared documents (accessed via magic link) using the shared endpoint.

curl -X PUT https://api.scriptix.io/api/v3/speech-to-text/session/{sessionId}/shared/document/{documentId} \
-H "Authorization: Bearer MAGIC_LINK_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"filename": "Updated by Collaborator",
"document": {...}
}'

Shared documents support the same update operations:

  • PUT /api/v3/speech-to-text/session/{sessionId}/shared/document/{documentId}
  • PUT /api/v3/speech-to-text/session/{sessionId}/shared/document/{documentId}/clear_text
  • PUT /api/v3/speech-to-text/session/{sessionId}/shared/document/{documentId}/reset_to_original
  • PUT /api/v3/speech-to-text/session/{sessionId}/shared/document/{documentId}/finish

Timecode Offset

The timecode_offset parameter adjusts the timing of all timestamps in the document. Useful for synchronizing with external timelines or correcting timing drift.

Format: HH:MM:SS:FF (Hours:Minutes:Seconds:Frames)

Examples:

  • 00:00:00:00 - No offset (default)
  • 00:00:05:00 - 5 second offset
  • 01:30:00:00 - 1 hour 30 minute offset

Error Responses

StatusDescription
400Invalid request parameters
401Unauthorized - invalid or missing authentication
404Document or session not found
422Validation error - invalid document structure
500Internal server error

Example error:

{
"error": "Validation failed",
"message": "Invalid document structure",
"status": 422
}