Skip to main content
 print this page

Add SQL AI training data

POST 

/nl2sql/training-documents

Registers a training document used to improve SQL AI responses.

This call creates metadata only. To attach the actual file, follow it with GET /nl2sql/training-documents/{id}?action=get_upload_url and PUT the file to the returned URL. The document only reaches the chatbot's knowledge base after a sync job runs, so trigger POST /nl2sql/sync-jobs once the upload is complete.

Requires SQLAI to be present in the environment's enabled AI services; otherwise the request fails with AI-1004. Not idempotent: a duplicate DocumentName is rejected with IPV-1018.

Request

Responses

Training document registered. Upload the file next, then trigger a sync job.

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