Skip to main content
 print this page

Get training document details, or request a file upload URL

GET 

/nl2sql/training-documents/:id

This operation has two modes, selected by the action query parameter.

  • Without action (the default), returns the full training document record, including UploadedFiles and a one-hour DownloadURL for the first uploaded file when at least one file exists.

  • With action=get_upload_url, returns a presigned URL to PUT a training file to. Both document_name and file_name are then required. The file is recorded against the document as soon as the URL is issued, before the upload itself completes, so a URL that is issued but never used leaves a dangling entry in UploadedFiles.

Requires SQLAI to be present in the environment's enabled AI services; otherwise the request fails with AI-1004.

Request

Responses

The training document record, or a presigned upload URL when action=get_upload_url.

Response Headers
    Access-Control-Allow-Origin
    Access-Control-Allow-Methods
    Access-Control-Allow-Headers