Files
Complete upload
Turn an uploaded file into a Wordsmith file with a file_id.
POST
Turns an upload into a file and returns it. The response’s
id is the file’s file_id, which the other files endpoints and Attach files take.
An upload takes three calls:
- Call Upload URL. It returns
upload_urlandjob_id. PUTthe file’s bytes toupload_url, with aContent-Typeheader equal to thecontent_typeyou sent.- Call this endpoint with the
job_idasupload_id.
409 upload_completion_in_progress; retry it.
If Wordsmith has not received the bytes yet, the response is 400 upload_not_received and the upload stays open. PUT the bytes, then complete again.
An upload is used once. After you complete it, attach the file by its file_id, not the job_id. A job_id already used as an upload_job_id attachment cannot be completed.
Authentication
Send an API key, or an OAuth access token with thefiles:write scope, as a bearer token in the Authorization header. A token without the scope gets 403 with "error": "insufficient_scope".
Path parameters
The
job_id that Upload URL returned.Response
Returns200 with the file.
The file’s sensitivity label from your organisation’s labelling system, such as Microsoft Purview:
provider, name (null when Wordsmith can’t name the label) and is_protected (the label encrypts the file). null when the file has no label.