---
title: "Create document attachment upload URL"
method: POST
path: "/file-uploads/document-attachment"
tags: ["File Upload Helpers"]
---

# Create document attachment upload URL

`POST /file-uploads/document-attachment`

## Request

- Base URL: `https://app.fynk.com/v1/api`
- URL: `https://app.fynk.com/v1/api/file-uploads/document-attachment`
- Auth: HTTP bearer

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

Generates a presigned URL for securely uploading a file to cloud storage. The uploaded file can then be added to a
document as an attachment via the [Add an attachment to a document](/operations/v1.documents.attachments.store)
endpoint.

The returned URL expires after a limited time and should be used immediately for upload. Upload the file with a
POST request to the returned URL, sending the provided `fields` as form fields in the request body, followed by
the file contents in a `file` field.

The request accepts a `content_type` string matching one of the rows below.

| File type              | `content_type`                                                            |
|------------------------|---------------------------------------------------------------------------|
| PDF                    | application/pdf                                                           |
| MS Word (.doc)         | application/msword                                                        |
| MS Word (.docx)        | application/vnd.openxmlformats-officedocument.wordprocessingml.document   |
| Excel (.xls)           | application/vnd.ms-excel                                                  |
| Excel (.xlsx)          | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet         |
| PowerPoint (.ppt)      | application/vnd.ms-powerpoint                                             |
| PowerPoint (.pptx)     | application/vnd.openxmlformats-officedocument.presentationml.presentation |
| XML                    | application/xml                                                           |
| EML                    | message/rfc822                                                            |
| CSV                    | text/csv                                                                  |
| Plain text (.txt)      | text/plain                                                                |
| Images                 | image/jpeg, image/png, image/webp, image/gif                              |

For a complete guide with examples, see [How to add an attachment to a document](/#how-to-add-an-attachment-to-a-document).

## Request body

- CreateDocumentAttachmentUploadUrlRequest
  - `content_type` 'application/pdf' | 'application/msword' | 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' | 'application/xml' | 'application/vnd.ms-excel' | 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' | 'application/vnd.ms-powerpoint' | 'application/vnd.openxmlformats-officedocument.presentationml.presentation' | 'text/csv' | 'text/plain' | 'message/rfc822' | 'image/jpeg' | 'image/png' | 'image/webp' | 'image/gif', required: The MIME type string of the file being uploaded.

## Response `201`

`SignedUploadUrlResource`

- object
  - `data` SignedUploadUrlResource, required
    - `uuid` string, required: UUID to be used when referring to the uploaded file in later requests
    - `url` string, required: The URL to upload the file contents to
    - `method` string, required: The HTTP method to use when uploading. Always POST.
    - `fields` object, required: Form fields to send in the body of the POST request, before the file contents
    - `expires_at` string, date-time, required: File must be uploaded before this time

## Other responses

- `401`: Unauthenticated
- `403`: Authorization error
- `422`: Validation error

## Changes

- **2026-11-02** `121033338e69`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/fynk/apis/fynk-api-reference/changes/file-uploads/document-attachment/post.md)

---

[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.dev/fynk/apis/fynk-api-reference/revisions/121033338e69?raw)
