Files
Create file
Save text as a plain text, Markdown or Word file, or store a file sent as base64.
POST
Stores a file you send in the body as a new file in your private space. The response’s
id is the new file’s file_id. Send exactly one of:
contentwithformat: text, stored as plain text, Markdown or Word.file_content: any file’s bytes, base64-encoded, at most 3 MB once decoded. Wordsmith stores the bytes as sent and reads the type from them. This suits tools that cannotPUTto an upload URL, such as a Power Automate flow. Upload larger files through the upload URL.
content, format picks the file type:
With
content, Wordsmith adds the extension when file_name does not already end with it, ignoring case. "Summary" with docx is stored as Summary.docx.
content is at most 1,000,000 bytes as UTF-8.
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".
Body parameters
The file’s name, 1 to 255 characters. With
content, the extension for format is added when the name does not end with it. With file_content, include the extension.The file’s text, at most 1,000,000 bytes as UTF-8. Send exactly one of
content and file_content.Required with
content, and refused with file_content. txt stores plain text, md stores Markdown, and docx converts the content from Markdown to a Word document.Any file’s bytes, base64-encoded, at most 3 MB once decoded. Send exactly one of
content and file_content. A file whose sensitivity label your organisation blocks is refused with 403.Response
Returns201 with the new 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.