Upload an asset
Changed onUploads 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
Request
- Base URLhttps://sandbox.sequencehq.com/api
- URLhttps://sandbox.sequencehq.com/api/assets
- Authnone declared. Required headers: Authorization, Content-Length
Headers
Your API credentials. Eg. Basic {credentials}.
Use this header to select an API version
Request body multipart/form-data
Response
Created
Example response
{
"id": "e007e884-5100-4183-8355-4771865cb4dd",
"createdBy": "94703530-1293-479b-bd37-ccad42fd9c8b",
"createdByType": "SEQUENCE_USER",
"type": "IMAGE",
"format": "PNG",
"fileName": "my-image.png",
"fileSizeBytes": 12345,
"url": "https://assets.sequencehq.com/1986c663-9ee9-4811-bfbf-57d2ad666096/images/e007e884-5100-4183-8355-4771865cb4dd.png?token=grhc3VtaoNLAifDBFXWYLHcNnK3XJHzFjZ4iMf78Ozg&expires=604800",
"createdAt": "2023-11-27T12:00:00Z"
}Changes
- info
endpoint added
- info