---
title: "Upload Note Attachment"
method: POST
path: "/notes/{noteId}/attachments"
tags: ["Notes"]
---

# Upload Note Attachment

`POST /notes/{noteId}/attachments`

## Request

- Base URL: `https://api.upflow.io/v1`
- URL: `https://api.upflow.io/v1/notes/{noteId}/attachments`
- Auth: API key in header `X-Api-Key` and API key in header `X-Api-Secret`

This endpoint can be used to upload a file attachment to a note.
You can either send the file in a multipart/form-data request (i.e. a regular "file upload" in HTML)
or a JSON request with the file encoded in base64.

Limitations:
- Maximum file size: 5MB

## Request body

- NoteAttachmentImportAttr: Attributes for importing a note attachment via JSON.
  - `fileName` string, required: The name of the file.
  - `data` string, byte, required: Base64 encoded string for the file. Mandatory when using application/json.

## Response `201`

Attachment created successfully.

- NoteAttachment
  - `id` string, uuid, required: The Attachment ID.
  - `mimeType` string, required: The MIME type of the attached file.
  - `fileName` string, required: The name of the attached file.
  - `createdAt` string, date-time, required: The date at which the attachment was created (ISO 8601 format).
  - `fileUrl` string, uri, required: The URL to download the attached file. Valid for 10 hours.

## Other responses

- `403`: Forbidden - Cannot add attachments to a note created from the UI
- `404`: Note not found.

---

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