---
title: "Upload an asset"
method: POST
path: "/assets"
tags: ["Assets"]
---

# Upload an asset

`POST /assets`

## Request

- Base URL: `https://sandbox.sequencehq.com/api`
- URL: `https://sandbox.sequencehq.com/api/assets`
- Auth: none declared. Required headers: `Authorization`, `Content-Length`

Uploads a file and creates an asset. An asset is a stored file that you can
reference by ID elsewhere in the API.

For example, to attach a file to an invoice, upload it using this endpoint and
pass the returned `id` in `attachmentAssetIds` when calling **Create an invoice**
or **Patch an invoice**.

## Sending the file

Send a `multipart/form-data` request containing one part named `file`.

The filename must use a supported extension, and the file part must have a
supported `Content-Type`. We derive the asset's `format` and `type` from the file
part's `Content-Type`, not from its filename extension.

The request must include a `Content-Length` header indicating the size of the
multipart request body, in bytes. It must not exceed 10 MiB (10,485,760 bytes).

### Images

- `jpg` or `jpeg` with a `Content-Type` of `image/jpeg`
- `png` with a `Content-Type` of `image/png`

Image files may be re-encoded to remove metadata.

### Documents

- `pdf` with a `Content-Type` of `application/pdf`

### Binary files

- `csv` with a `Content-Type` of `text/csv`
- `txt` with a `Content-Type` of `text/plain`
- `md` with a `Content-Type` of `text/markdown`
- `rtf` with a `Content-Type` of `application/rtf`
- `doc` with a `Content-Type` of `application/msword`
- `docx` with a `Content-Type` of
  `application/vnd.openxmlformats-officedocument.wordprocessingml.document`
- `xls` with a `Content-Type` of `application/vnd.ms-excel`
- `xlsx` with a `Content-Type` of
  `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`
- `xlsm` with a `Content-Type` of `application/vnd.ms-excel.sheet.macroEnabled.12`
- `odt` with a `Content-Type` of `application/vnd.oasis.opendocument.text`
- `ods` with a `Content-Type` of `application/vnd.oasis.opendocument.spreadsheet`
- `zip` with a `Content-Type` of `application/zip`

## Headers

- `Authorization` string, required
- `Content-Length` integer, required
- `Sequence-Version` '2024-07-30'

## Request body `multipart/form-data`

- object
  - `file` string, binary, required

## Response `201`

Created

- AssetResponse2
  - `id` string, required: Unique ID for this asset.
  - `createdBy` string, required: The ID of the asset creator. A Sequence user id or API key id, as identified by `createdByType`.
  - `createdByType` 'SEQUENCE_USER' | 'API_CLIENT', required
  - `type` 'IMAGE' | 'DOCUMENT' | 'BINARY', required
  - `format` 'JPEG' | 'JPG' | 'PNG' | 'PDF' | 'CSV' | 'TXT' | 'RTF' | 'MD' | 'XLS' | 'XLSX' | 'XLSM' | 'DOC' | 'DOCX' | 'ZIP' | 'ODT' | 'ODS', required
  - `fileName` string, required: Original filename provided when the asset was uploaded.
  - `fileSizeBytes` integer, required: Size of the stored file, in bytes. This may differ from the size of the uploaded file.
  - `url` string, required: Signed URL for downloading the file. The URL expires one week after it is generated. Call **Get an asset** when you need a new URL.
  - `createdAt` string, required: The time at which this asset was created. Formatted as an ISO 8601 timestamp.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `500`: Internal Server Error

## Changes

- **2026-09-15** `30baaff22f35`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/sequencehq/apis/sequence/changes/assets/post.md)

---

[API](https://skmtc.dev/sequencehq/apis/sequence.md) - [All operations](https://skmtc.dev/sequencehq/apis/sequence/llms.txt) - [OpenAPI document](https://skmtc.dev/sequencehq/apis/sequence/revisions/b9b29c6a7118?raw)
