Skip to main content

Upload an attachment

Attaches a binary file to an entity. Max size 50 MB. The filename is sanitized on ingestion (null bytes, path separators, and header-injection sequences are replaced with _).

Request

Method: POST
Path: /api/attachments/upload

Authentication: Not required

Responses

201 - Attachment stored

400 - Missing file, missing entityGuid, or tenant not found

Examples

cURL

curl -X POST \
-H "Content-Type: application/json" \
http://localhost:3000/api/attachments/upload \
-d '{"example": "data"}'

JavaScript

const response = await fetch('http://localhost:3000/api/attachments/upload', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
// Request data
}),
});

const data = await response.json();
console.log(data);

This documentation is automatically generated from the OpenAPI specification.