Upload an asset
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
jpgorjpegwith aContent-Typeofimage/jpegpngwith aContent-Typeofimage/png
Image files may be re-encoded to remove metadata.
Documents
pdfwith aContent-Typeofapplication/pdf
Binary files
csvwith aContent-Typeoftext/csvtxtwith aContent-Typeoftext/plainmdwith aContent-Typeoftext/markdownrtfwith aContent-Typeofapplication/rtfdocwith aContent-Typeofapplication/msworddocxwith aContent-Typeofapplication/vnd.openxmlformats-officedocument.wordprocessingml.documentxlswith aContent-Typeofapplication/vnd.ms-excelxlsxwith aContent-Typeofapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheetxlsmwith aContent-Typeofapplication/vnd.ms-excel.sheet.macroEnabled.12odtwith aContent-Typeofapplication/vnd.oasis.opendocument.textodswith aContent-Typeofapplication/vnd.oasis.opendocument.spreadsheetzipwith aContent-Typeofapplication/zip
Headers
Your API credentials. Eg. Basic {credentials}.
Use this header to select an API version
2024-07-30 Body
Response
Created
Unique ID for this asset.
"e007e884-5100-4183-8355-4771865cb4dd"
The ID of the asset creator. A Sequence user id or API key id, as identified by createdByType.
"94703530-1293-479b-bd37-ccad42fd9c8b"
Whether createdBy identifies a SEQUENCE_USER or an API_CLIENT.
SEQUENCE_USER, API_CLIENT "SEQUENCE_USER"
Classification of this asset as IMAGE, DOCUMENT, or BINARY.
IMAGE, DOCUMENT, BINARY "IMAGE"
File format of this asset. For uploaded assets, this value is derived from the Content-Type of the file part.
JPEG, JPG, PNG, PDF, CSV, TXT, RTF, MD, XLS, XLSX, XLSM, DOC, DOCX, ZIP, ODT, ODS "PNG"
Original filename provided when the asset was uploaded.
"my-image.png"
Size of the stored file, in bytes. This may differ from the size of the uploaded file.
12345
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.
"https://assets.sequencehq.com/1986c663-9ee9-4811-bfbf-57d2ad666096/images/e007e884-5100-4183-8355-4771865cb4dd.png?token=grhc3VtaoNLAifDBFXWYLHcNnK3XJHzFjZ4iMf78Ozg&expires=604800"
The time at which this asset was created. Formatted as an ISO 8601 timestamp.
"2023-11-27T12:00:00Z"