Miridia
Portal
Administration

Files

The files operations of the Core API.

Base URL: https://api.miridia.io. Read Authentication and Conventions before you call these operations.

MethodPathOperation
POST/api/Files/multipleUpload files
POST/api/Files/from-urlUpload 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.

FieldTypeRequiredDescription
filesstring (binary)[]No

Response

200. Returns a SingleResult envelope. The data field is FileUploadResponse.

Request
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>"
Response
{
  "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).

FieldTypeRequiredDescription
urlsstring[]Yes

Response

200. Returns a SingleResult envelope. The data field is FileUploadResponse.

Request
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"
  ]
}'
Response
{
  "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

NameInTypeRequiredDescription
fileIdpathstring (uuid)Yes

Response

200. The response has no body.

Request
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

NameInTypeRequiredDescription
fileIdpathstring (uuid)Yes

Response

200. Returns a SingleResult envelope. The data field is FileAttachmentResponse.

Request
curl -X DELETE "https://api.miridia.io/api/Files/{fileId}" \
  -H "Authorization: Bearer $MIRIDIA_TOKEN" \
  -H "X-Business-Id: $MIRIDIA_BUSINESS_ID"
Response
{
  "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
FieldTypeDescription
idstring (uuid)
titlestring
descriptionstring
contentTypestring
fileNamestring
fileUrlstring
dateSasTokenExpiresstring (date-time)
fileTypeenum FileTypeOne of: Unknown, Pdf, Doc, Docx, Xls, Xlsx, Png, Jpg, Jpeg, Gif, Bmp, Svg, Tiff, Txt, Csv, Zip, Webp.
FileUploadResponse
FieldTypeDescription
fileAttachmentsFileAttachmentResponse[]
messagestring