# Upload a file to MDM for usage in other APIs such as app distribution, content management, and profile configuration **Deprecated** Uploads a binary file and returns file metadata including a unique file_id for subsequent API calls. **This API endpoint is deprecated** This API is deprecated as of On-Premises build 11.2.2509.XX. Use `/emsapi/files` for new implementations and migrate existing usage to this endpoint before it is completely removed. [View new endpoint >](https://www.manageengine.com/mobile-device-management/help/api/cloud/files-upload-file-ems.html) ## Endpoint `POST /api/v1/mdm/files` ## Request URL https://[{serverurl}](https://www.manageengine.com/mobile-device-management/help/api/cloud/oauth-authentication-endpoint-domain.html)/api/v1/mdm/files ## Scope `MDMOnDemand.MDMDeviceMgmt.CREATE` ## Header `Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52` ## Request Parameters ### Request Headers - **Content-Type** (string, Mandatory): `multipart/form-data` - **Content-Disposition** (string, Mandatory): `filename=fileName.extension` - **Accept** (string, Mandatory): `application/json` ### Request Body `multipart/form-data` - string ## Sample Request ```curl curl --request POST \ --url https://appdomain/api/v1/mdm/files \ --header 'Accept: application/json' \ --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \ --header 'Content-Disposition: filename=fileName.extension' \ --header 'Content-Type: multipart/form-data' ``` ## Response Parameters ### HTTP Code 200 Response Body — `application/json` - JSON object - **content_type** (string): MIME type of the uploaded file. Common values: `application/vnd.android.package-archive` (apk), `application/x-itunes-ipa` (ipa), `application/zip` (appxbundle, xap, appx, msix), `application/x-ms-installer` (msi) - **file_name** (string): Name of the uploaded file including its extension - **file_id** (long): Unique identifier assigned to the uploaded file. Use this ID to check upload status via [Get File Upload Status](https://www.manageengine.com/mobile-device-management/help/api/cloud/files-get-file-upload-status.html) - **expiry_time** (long): Unix timestamp (in milliseconds) until when the uploaded file is valid. The file will be automatically deleted after this time - **content_length** (string): Length of the uploaded file in bytes ## Possible Response Codes - **200** HTTP code ## Sample Response: HTTP 200 ### Android APK file successfully uploaded ```json { "content_type": "application/vnd.android.package-archive", "file_name": "zylker-app.apk", "file_id": 9007199254741076, "expiry_time": 15987913528, "content_length": 2048576 } ``` ### Image file successfully uploaded ```json { "content_type": "image/png", "file_name": "check.png", "file_id": 9007199254741076, "expiry_time": 15987913528, "content_length": 1479 } ``` ![](https://www.zohowebstatic.com/sites/zweb/images/people/ico-help.png) **Duration:** 1 minute | **Threshold:** 10 | **Lock period:** 5 minutes Duration - Time window for the threshold. Threshold - Number of API calls allowed within the specified duration. Lock Period - Wait time before consecutive API requests.