File
A file represents a temporary uploaded file used in any context requiring a file upload. Examples include risk data attachments or a cover image for a risk data record.
The File object
A file contains the following properties:
Meta
- Name
filename
- Type
- string
- Description
The corresponding file name for the uploaded file
- Name
expires
- Type
- timestamp
- Description
The expiration date for the uploaded file
- Name
purpose
- Type
- enum
- Description
The defined purpose for the uploaded file
Upload files
This endpoint allows you to upload files to be used in any context requiring a file upload.
You may upload up to 10 files in one request. Each file will have the same purpose
assigned.
Each file must be less than 50MB in size, and the entire request must be less than 100MB in size.
Required properties
- Name
purpose
- Type
- enum
- Description
The purpose of the uploaded files
- Name
files
- Type
- file[]
- Description
An array of files to be uploaded. Acceptable file types are: jpg, jpeg, png, pdf, doc, docx, ppt, pptx, xls, xlsx, csv, ods, odt, and txt.
Request
curl -X POST https://app.wunderite.com/api/v1/risks/{risk}/data/files \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-F files[]=@/path/to/file.jpg \
-F files[]=@/path/to/file2.jpg \
-F purpose=attachment
Response
{ "data": [ { "object": "file", "uuid": "CXgSqNghkcUWRivhj0PZ21fptDEADpZOZLdWU5mU4JK2PX0hydczaD2cPCXPz21Y", "meta": { "filename": "file.jpg", "purpose": "attachment", "expires": "2024-01-01T23:00:00Z" }