Upload a file
Errors
Returns an error if file upload, database operations, or file system operations fail.
Response
File with same content already exists, returning existing file
Example response
{
"file": {
"createdAt": "2023-01-01T00:00:00Z",
"fileHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"fileSize": 1048576,
"filename": "document.pdf",
"id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
"metadata": {
"description": "Important document"
},
"mimeType": "application/pdf",
"originalFilename": "My Important Document.pdf",
"status": "uploaded",
"updatedAt": "2023-01-01T00:00:00Z",
"userId": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
},
"message": "File uploaded successfully"
}Changes
Changed in 5 of the 28 revisions of this API.6211
- ○
added the success response with the status
200response-success-status-added
- ○
- ○
the endpoint scheme security
bearerAuth AND cookieAuthwas added to the APIapi-security-added
- ○
the endpoint scheme security
cookieAuthwas removed from the APIapi-security-removed
- ○
- ▲
removed the required property
file/file_hashfrom the response with the201statusresponse-required-property-removed
- ▲
removed the required property
file/file_sizefrom the response with the201statusresponse-required-property-removed
- ▲
removed the required property
file/mime_typefrom the response with the201statusresponse-required-property-removed
- ▲
removed the required property
file/original_filenamefrom the response with the201statusresponse-required-property-removed
- ▲
removed the required property
file/user_idfrom the response with the201statusresponse-required-property-removed
- ●
removed the optional property
file/created_atfrom the response with the201statusresponse-optional-property-removed
- ●
removed the optional property
file/updated_atfrom the response with the201statusresponse-optional-property-removed
- ○
added the optional property
file/createdAtto the response with the201statusresponse-optional-property-added
- ○
added the optional property
file/updatedAtto the response with the201statusresponse-optional-property-added
- ○
added the required property
file/fileHashto the response with the201statusresponse-required-property-added
- ○
added the required property
file/fileSizeto the response with the201statusresponse-required-property-added
- ○
added the required property
file/mimeTypeto the response with the201statusresponse-required-property-added
- ○
added the required property
file/originalFilenameto the response with the201statusresponse-required-property-added
- ○
added the required property
file/userIdto the response with the201statusresponse-required-property-added
- ▲
- ○
endpoint added
endpoint-added
- ○
- ▲
api path removed without deprecation
api-path-removed-without-deprecation
This revision also has 29 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ▲