Files
Base URL: https://api.miridia.io. Read Authentication and Conventions before you call these operations.
| Method | Path | Operation |
|---|---|---|
| POST | /api/Files/multiple | Upload files |
| POST | /api/Files/from-url | Upload files from url |
| GET | /api/Files/{fileId} | Get file |
| DELETE | /api/Files/{fileId} | Delete file |
Upload files
POST/api/Files/multiple
Pass each returned id to the target entity's POST /attachments endpoint to associate it.
Access. Send a bearer token or an API key. Any signed-in member can call this operation.
Request body
Send a multipart/form-data form of type object.
| Field | Type | Required | Description |
|---|---|---|---|
files | string (binary)[] | No |
Response
200. Returns a SingleResult envelope. The data field is FileUploadResponse.
curl -X POST "https://api.miridia.io/api/Files/multiple" \
-H "Authorization: Bearer $MIRIDIA_TOKEN" \
-H "X-Business-Id: $MIRIDIA_BUSINESS_ID" \
-F "files=<files>"{
"message": "string",
"messages": [
{
"title": "string",
"message": "string",
"level": "Standard",
"icon": "SyncAlert",
"code": "string"
}
],
"data": {
"fileAttachments": [
{}
],
"message": "string"
},
"statusCode": "OK",
"canRead": true,
"canEdit": true,
"canDelete": true
}Upload files from url
POST/api/Files/from-url
Useful when the asset is already hosted somewhere (a CDN, an integration's image URL) and only its URL is on hand. Pass each returned id to the target entity's POST /attachments endpoint (or a product's imageIds).
Access. Send a bearer token or an API key. Any signed-in member can call this operation.
Request body
Send JSON with the shape UploadFilesFromUrlCommand. Convenience for seeding and for external integrations that already host an asset and only have its URL (e.g. a product image CDN).
| Field | Type | Required | Description |
|---|---|---|---|
urls | string[] | Yes |
Response
200. Returns a SingleResult envelope. The data field is FileUploadResponse.
curl -X POST "https://api.miridia.io/api/Files/from-url" \
-H "Authorization: Bearer $MIRIDIA_TOKEN" \
-H "X-Business-Id: $MIRIDIA_BUSINESS_ID" \
-H "Content-Type: application/json" \
-d '{
"urls": [
"string"
]
}'{
"message": "string",
"messages": [
{
"title": "string",
"message": "string",
"level": "Standard",
"icon": "SyncAlert",
"code": "string"
}
],
"data": {
"fileAttachments": [
{}
],
"message": "string"
},
"statusCode": "OK",
"canRead": true,
"canEdit": true,
"canDelete": true
}Get file
GET/api/Files/{fileId}
Access. Send a bearer token or an API key. The caller needs the Settings view permission.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
fileId | path | string (uuid) | Yes |
Response
200. The response has no body.
curl -X GET "https://api.miridia.io/api/Files/{fileId}" \
-H "Authorization: Bearer $MIRIDIA_TOKEN" \
-H "X-Business-Id: $MIRIDIA_BUSINESS_ID"Delete file
DELETE/api/Files/{fileId}
Detach the file from its entity first (e.g. save the product without the imageId). References inside entity metadata are not cleaned up.
Access. Send a bearer token or an API key. The caller needs the Settings delete permission.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
fileId | path | string (uuid) | Yes |
Response
200. Returns a SingleResult envelope. The data field is FileAttachmentResponse.
curl -X DELETE "https://api.miridia.io/api/Files/{fileId}" \
-H "Authorization: Bearer $MIRIDIA_TOKEN" \
-H "X-Business-Id: $MIRIDIA_BUSINESS_ID"{
"message": "string",
"messages": [
{
"title": "string",
"message": "string",
"level": "Standard",
"icon": "SyncAlert",
"code": "string"
}
],
"data": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"title": "string",
"description": "string",
"contentType": "string",
"fileName": "string",
"fileUrl": "string",
"dateSasTokenExpires": "2026-09-29T08:00:00Z",
"fileType": "Pdf"
},
"statusCode": "OK",
"canRead": true,
"canEdit": true,
"canDelete": true
}Models
The operations on this page use these object types. Select a type to see its fields.
FileAttachmentResponse
| Field | Type | Description |
|---|---|---|
id | string (uuid) | |
title | string | |
description | string | |
contentType | string | |
fileName | string | |
fileUrl | string | |
dateSasTokenExpires | string (date-time) | |
fileType | enum FileType | One of: Unknown, Pdf, Doc, Docx, Xls, Xlsx, Png, Jpg, Jpeg, Gif, Bmp, Svg, Tiff, Txt, Csv, Zip, Webp. |
FileUploadResponse
| Field | Type | Description |
|---|---|---|
fileAttachments | FileAttachmentResponse[] | |
message | string |