Upload a file to the server using module configuration. Supported file types include images, audios, videos, certificates and many more

Open in ChatGPT Open in ChatGPT to ask questions about this page
Open in Claude Open in Claude to ask questions about this page
Copy as MarkdownCopy this page as markdown to use with AI assistants
View as Markdown Open this page as markdown in a new tab

Upload a file to the server using module configuration. The Module header specifies where the uploaded file will be used. Supported file types include images, audios, videos, certificates, application packages, and configuration profiles.

Endpoints

post /emsapi/files

Request URL

https://{serverurl}/emsapi/files

Request Parameters

- Request Headers

Content-TypestringMandatory
multipart/form-datamultipart/form-dataCopied!
ModulestringMandatory
MDM_PROFILES_IMAGESMDM_PROFILES_IMAGESCopied!

Specifies the target module where the uploaded file will be used. Allowed values: MDM_CERTIFICATES (certificates — .cer, .crt, .pem, .pfx, .p12), MDM_APP_MGMT (app packages — .apk, .ipa, .xap, .msix, .msixbundle, .appx, .appxbundle, .pkg), MDM_CUSTOM_PROFILE (custom profiles — .xml, .mobileconfig, .plist, .json), MDM_CONTENT_MGMT (content files for distribution), MDM_PROFILES_IMAGES (images for profile creation and modification), MDM_APP_REPOSITORY_CUSTOM_CONFIG (custom app config — .xml, .plist).

AcceptstringMandatory
application/jsonapplication/jsonCopied!

- Request Body

multipart/form-data
JSON object
Hide Sub-Attributes
filestringOptional

Multipart form field carrying the binary file content. The form field key MUST be file and the value MUST be the file's binary stream (e.g., --form 'file=@/path/to/your/file.ext'). The actual file extension and content type must be compatible with the value supplied in the Module request header. Supported types per module: MDM_CERTIFICATES (.cer, .crt, .pem, .pfx, .p12), MDM_APP_MGMT (.apk, .ipa, .xap, .msix, .msixbundle, .appx, .appxbundle, .pkg), MDM_CUSTOM_PROFILE (.xml, .mobileconfig, .plist, .json), MDM_PROFILES_IMAGES (.png, .jpg, .jpeg, .gif), MDM_CONTENT_MGMT (documents/media for distribution), MDM_APP_REPOSITORY_CUSTOM_CONFIG (.xml, .plist).

Sample Request

Curl
Java
Python
Deluge
PowerShell
Copied!
curl --request POST \
  --url https://appdomain/emsapi/files \
  --header 'Accept: application/json' \
  --header 'Content-Type: multipart/form-data' \
  --header 'Module: MDM_PROFILES_IMAGES'
Show full

Response Parameters

- HTTP code 200

Response Body - application/json

JSON object
Hide Sub-Attributes
fileIDstring

Unique identifier assigned to the uploaded file. Use this ID in subsequent API calls (e.g., profile creation, app distribution, content management) that reference the uploaded file. Use Get File Upload Status to verify the file is ready for use

fileNamestring

Name of the uploaded file including its extension, as supplied in the multipart form field

customerIDstring

Identifier of the customer account that owns the uploaded file

expiryDatestring

Human-readable date and time until when the uploaded file is valid. The file will be automatically deleted after this time (e.g., Jun 28, 2025 04:18 PM)

fileStatusinteger

Numeric status code of the file upload. Possible values: 1 (PENDING — file is queued for processing), 2 (COMPLETED — file successfully uploaded and ready for use), 3 (FAILED — upload or processing failed)

Possible HTTP Status Codes

200HTTP code

Sample Response: HTTP 200

Profile image (MDM_PROFILES_IMAGES) successfully uploaded via module configuration

Copied!
  {
    "expiryDate": "Jun 28, 2025 04:18 PM",
    "fileName": "wallpaper.png",
    "fileStatus": 2,
    "customerID": "9007199254741062",
    "fileID": "9007199254741054"
  }
                
Show full

Certificate file (MDM_CERTIFICATES) successfully uploaded

Copied!
  {
    "expiryDate": "Jun 28, 2025 04:18 PM",
    "fileName": "corp-root-ca.cer",
    "fileStatus": 2,
    "customerID": "9007199254741062",
    "fileID": "9007199254741055"
  }
                
Show full

Application package (MDM_APP_MGMT) successfully uploaded

Copied!
  {
    "expiryDate": "Jun 28, 2025 04:18 PM",
    "fileName": "zylker-app.apk",
    "fileStatus": 2,
    "customerID": "9007199254741062",
    "fileID": "9007199254741056"
  }
                
Show full

Custom configuration profile (MDM_CUSTOM_PROFILE) successfully uploaded

Copied!
  {
    "expiryDate": "Jun 28, 2025 04:18 PM",
    "fileName": "custom-config.mobileconfig",
    "fileStatus": 2,
    "customerID": "9007199254741062",
    "fileID": "9007199254741057"
  }
                
Show full