Skip to main content
The File API allows you to manage files in your account. You can upload, download, list, and delete files. After you upload a file, you can use it to perform actions such as attaching it to a Knowledge Graph or using it as an input in a no-code agent. This guide shows you how to perform the following actions:
You need an API key to access the Writer API. Get an API key by following the steps in the API quickstart.We recommend setting the API key as an environment variable in a .env file with the name WRITER_API_KEY.

Upload a file

Endpoint: POST /v1/files
A file persists in your account until you delete it.
You can optionally provide a graphId query parameter to associate the uploaded file with a Knowledge Graph during upload.

Query parameters

Request body

Response format

If you provide a graphId during upload, the file is associated with that Knowledge Graph. However, the graph_ids field in the upload response is an empty list. The association is visible in the graph_ids list when you retrieve the file using the Get a file endpoint.

List all files

Endpoint: GET /v1/files

Query parameters

In addition to the pagination parameters, this endpoint supports the following query parameters:
The file_types parameter is not yet available in the Python and Node SDKs. It will be available in version 2.3.0.

Response format

The response has the following structure:

Get a file

Endpoint: GET /v1/files/{fileId}

Response format

Delete a file

Endpoint: DELETE /v1/files/{fileId}

Response format

The response has the following structure: