---
title: "Upload file"
method: POST
path: "/v1/files"
tags: ["File API"]
---

# Upload file

`POST /v1/files`

## Request

- Base URL: `https://api.writer.com`
- URL: `https://api.writer.com/v1/files`
- Auth: HTTP bearer

Upload a new file to the system. Supports various file formats including PDF, DOC, DOCX, PPT, PPTX, JPG, PNG, EML, HTML, SRT, CSV, XLS, and XLSX.

File uploads do not accept team parameters. When you attach a file to a Knowledge Graph, the file inherits the team scope of that Knowledge Graph.

## Query parameters

- `graphId` string, uuid

## Headers

- `Content-Disposition` string, required
- `Content-Type` string, required
- `Content-Length` integer, required

## Request body `text/plain`

- string, binary

## Response `200`

- FileResponse
  - `id` string, required: A unique identifier of the file.
  - `created_at` string, date-time, required: The timestamp when the file was uploaded.
  - `name` string, required: The name of the file.
  - `graph_ids` string[], required: A list of Knowledge Graph IDs that the file is associated with. If you provided 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 will be visible in the `graph_ids` list when you retrieve the file using the file retrieval endpoint.
  - `status` string, required: The processing status of the file.

## Changes

- **2025-12-01** `ea6ec4b34f6b`: 1 info
  - added the new optional `query` request parameter `graphId`
- **2024-10-03** `4a11c63c7cb5`: 3 breaking, 1 info
  - removed the media type `application/octet-stream` from the request body
  - removed the media type `audio/mpeg` from the request body
  - removed the media type `video/mp4` from the request body
  - added the media type `message/rfc822` to the request body
- **2024-09-20** `149f74d46fcb`: 2 info
  - api operation id `getewayUploadFile` removed and replaced with `gatewayUploadFile`
  - added the required property `status` to the response with the `200` status

[Operation history](https://skmtc.dev/writer/apis/writer-api/changes/v1/files/post.md)

---

[API](https://skmtc.dev/writer/apis/writer-api.md) - [All operations](https://skmtc.dev/writer/apis/writer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/writer/apis/writer-api/revisions/59865afc5779?raw)
