# Add a document or media file to the MDM server Upload documents ## Endpoint **POST** `/api/v1/mdm/docs` ## Request URL `https://[{serverurl}](https://www.manageengine.com/mobile-device-management/help/api/cloud/oauth-authentication-endpoint-domain.html)/api/v1/mdm/docs` ## Scope `MDMOnDemand.MDMDeviceMgmt.CREATE` ## Header `Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52` ## Request Parameters ### Request Headers | Parameter | Type | Required | Value | |---|---|---|---| | Content-Type | string | Mandatory | `application/json` | | Accept | string | Mandatory | `application/json` | ### Request Body `application/json` | Parameter | Type | Required | Description | |---|---|---|---| | tags | array | Optional | Array of tag IDs to classify the content | | description | string | Optional | Content description for the document or media file | | file_id | long | Mandatory | File ID of the document or media file. Upload the file using [Upload File](https://www.manageengine.com/mobile-device-management/help/api/cloud/files-upload-file-ems.html) with MDM_CONTENT_MGMT module | ### Sample Request ```curl curl --request POST \ --url https://appdomain/api/v1/mdm/docs \ --header 'Accept: application/json' \ --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \ --header 'Content-Type: application/json' \ --data '{"file_id":9007199254741080}' ``` ### Sample Request Body Add a document with tags and description ```json { "file_id": 9007199254741080, "description": "List of Docs", "tags": [ 9007199254741088, 9007199254741088 ] } ``` ## Response Parameters ### HTTP Code 200 Response Body: `application/json` | Parameter | Type | Description | |---|---|---| | doc_id | long | A unique identifier for the document or media | | doc_name | string | Name of the document or media | | added_time | long | Epoch timestamp (milliseconds) when the document or media was added to the MDM server | | updated_time | long | Epoch timestamp (milliseconds) when the document or media was last modified | | last_modified_by_name | string | Name of the user who last modified the document or media | | last_modified_by | long | User ID of the user who last modified the document or media | | created_by_name | string | Name of the user who created the document or media | | created_by | long | User ID of the user who created the document or media | | size | long | Document or media size in bytes | | doc_type | integer | Content type identifier | | repository_type | integer | Repository from where the media or document is added | | description | string | Content description | ### Possible Response Codes | Code | Type | |---|---| | 200 | HTTP code | ### Sample Response: HTTP 200 Content successfully added to the MDM server ```json { "updated_time": 1714717200000, "added_time": 1714630800000, "size": 6855, "doc_name": "Zylker MDM", "description": "List of Docs", "last_modified_by": 9007199254741036, "doc_type": 4, "created_by_name": "admin", "doc_id": 9007199254741080, "last_modified_by_name": "admin", "created_by": 9007199254741036, "repository_type": 1 } ``` ## Rate Limit **Duration:** 1 minute | **Threshold:** 2000 | **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.