upload_submission_attachment
Upload a file to a Nettskjema submission question using its attachment token. Optionally transcribe audio/video with language, model, speaker, or translation options.
Instructions
Upload an attachment to a submission question, optionally requesting transcription.
The entire file is read into memory before uploading. The filename and fileSize are derived from the file itself rather than accepted as parameters, so they cannot drift out of sync. An audio recording awaiting transcription can be tens of megabytes; the whole file is held in RAM during the upload.
The attachment token comes from the attachmentToken field in the response body of POST /form/{formId}/submission. It authorizes writing to someone else's submission and must be kept as secure as the access token itself.
The spec does not document what happens when the named questionId already has an attachment. An upload may silently replace a respondent's file.
Transcription options apply only when the uploaded file is audio or video. The six supported models are: model_auto, nb_whisper_large_semantic, nb_whisper_large_verbatim, openai_whisper_large_v3, openai_whisper_large_v2, and KBLab-large. The language parameter accepts 100+ language codes; passing an unknown code raises BadRequestError naming the allowed values. The diarize flag requests speaker identification, and translate_to_english requests translation to English after transcription.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Transcription model. Optional; the spec declares no default. | |
| diarize | No | Request speaker identification in the transcription. | |
| language | No | Language code for transcription (e.g., "en", "no", "auto"). Optional; the spec declares no default. | |
| file_path | Yes | Path to the file to upload. May be relative or contain ~. | |
| question_id | Yes | The question (form element) ID to attach the file to. | |
| submission_id | Yes | The submission's numeric ID. | |
| attachment_token | Yes | The attachment token from the submission creation response. Authorizes writing to this submission. | |
| translate_to_english | No | Request translation to English after transcription. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |