---
title: "Store a file in a document's file storage"
method: POST
path: "/documents/{document}/file-storage"
tags: ["Document Operations"]
---

# Store a file in a document's file storage

`POST /documents/{document}/file-storage`

<small>Requires an API token with the **Document Manager** role.</small>

Associates a previously uploaded file with the [document](/#documents) referred to by the URL.

This endpoint requires a three-step upload process:

1. Generate upload URL: Call the [Create document file storage upload URL](/operations/v1.file-uploads.document-file-storage.create) endpoint to get a presigned upload URL
2. Upload file: Make a POST request to the returned URL with the specified form fields, followed by the file contents in a `file` field
3. Associate uploaded file with document: Call this endpoint with `file_upload_uuid` set to the `uuid` received in step 1

The file will be available in the file storage of the document referred to in the URL.

For a complete guide with examples, see [How to store a file in a document's file storage](/#how-to-store-a-file-in-a-documents-file-storage).

## Path parameters

- `document` string, required

## Request body

- StoreStoredFileRequest
  - `file_upload_uuid` string, uuid, required — The UUID received in the [Create document file storage upload URL](/operations/v1.file-uploads.document-file-storage.create) response
  - `file_name` string, required — The name of the file being uploaded

## Response `201`

`StoredFileMinimalResource`

- object
  - `data` StoredFileMinimalResource, required
    - `uuid` string, required — UUID of the uploaded file.
    - `sha256` string, required — SHA256 hash of the uploaded file.
    - `file_name` string, required — Name of the uploaded file.
    - `file_size` integer, required — Size of the uploaded file in bytes.
    - `mime_type` string, required — MIME type of the uploaded file.

## Other responses

- `401` — Unauthenticated
- `403` — Authorization error
- `404` — Not found
- `422` — Validation error

---

[API](https://skmtc.dev/fynk/apis/fynk-api-reference.md) · [All operations](https://skmtc.dev/fynk/apis/fynk-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/fynk/fynk-api-reference/revisions/9657a6757f59/schema)
