Skip to navigation

Create a Word document or presentation from a file

Beta

Create a Word document from a .docx file, or a presentation from a .pptx or .potx file, holding that file’s content: the asset Athena makes when you create one from a file in the app. Athena imports the file through DOCX Studio or PPTX Studio with its own studio credential, as your write, and answers once the asset is ready (a large deck can take a few minutes). Nothing is left behind when the import fails. The file’s name decides the type; the title defaults to the name without its extension. Gates are those of POST /api/v0/assets/create: membership in the workspace (workspace_id, else parent_folder_id’s, else your current one) and EDIT on parent_folder_id. With source_asset_id (an asset you can read, for example the document the file was exported from) and no parent_folder_id, the new asset goes into the source’s folder when you may create there, otherwise at your root. Unlike POST /api/v0/tools/file/save, which stores the file itself and turns an Office upload into its editable type in the background, this makes the editable asset in the request and keeps no file asset. A Word file may be up to 18.75 MiB, a PowerPoint file up to 100 MiB. From an agent run (a verified X-Athena-Session-Credential), a Word document’s first write also records the run, and a presentation takes the create_presentation_pptx_studio tool policy.

Authentication

X-API-KEYstring
API Key authentication via header

Headers

X-Athena-Session-CredentialstringOptional

Query parameters

titlestring or nullOptional

Title for the new asset; defaults to the file’s name

parent_folder_idstring or nullOptional
ID of the folder to create the asset in
workspace_idstring or nullOptional

ID of the workspace to create the asset in; defaults to the workspace of parent_folder_id, else your current workspace

source_asset_idstring or nullOptional

An asset you can read that the file came from; without parent_folder_id the new asset goes next to it when you may create there

Request

This endpoint expects a multipart form containing a file.
filefileRequired
The .docx, .pptx or .potx file to create the asset from

Response

Asset created from the file
asset_idstring
ID of the newly created asset
asset_typestring
Type of the created asset
created_atstring
Timestamp when the asset was created
titlestring
Title of the created asset
parent_folder_idstring or nullOptional
ID of the parent folder
workspace_idstring or nullOptional
ID of the workspace that owns the created asset

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error
413
Content Too Large Error
422
Unprocessable Entity Error
502
Bad Gateway Error