Adds a new script to the Script Repository. Upload the script file first and pass the returned fileID in scriptFile.fileID. The scriptId returned here is the value to use when creating a Custom Script configuration policy with executionType Repository.
post /dcapi/configuration/scriptRepository/script
https://{serverurl}/dcapi/configuration/scriptRepository/script Copied!
Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52
The uploaded script file to register. Upload the file first (POST /emsapi/files) and pass the returned fileID here.
Identifier of the uploaded script file. Upload the file first (POST /emsapi/files) and pass the fileID returned by that call.
Default command-line arguments passed to the script when it runs. Masked in responses.
Operating system the script targets. Allowed values:
Windows
Mac
Linux
Free-text description of what the script does.
Comma-separated list of exit codes to treat as success (e.g., "0,1"). Any other exit code marks the execution as failed.
Existing script identifier. Omit when adding a new script.
curl --request POST \
--url https://appdomains/dcapi/configuration/scriptRepository/script \
--header 'Accept: application/addScriptStatus.v1+json' \
--header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \
--header 'Content-Type: application/scriptDetails.v1+json' \
--data '{"scriptFile":{"fileID":12345}}'Add a new Windows script to the repository
{
"description": "My custom script for deployment",
"exitCodes": "0",
"arguments": "--verbose",
"scriptFile": {
"fileID": 12345
},
"platform": "Windows"
}
Add a new Linux shell script to the repository. Shows every accepted field; scriptID is omitted because the script does not exist yet.
{
"description": "Cleanup temporary files on Linux endpoints",
"exitCodes": "0,1",
"arguments": "",
"scriptFile": {
"fileID": 67890
},
"platform": "Linux"
}
Operation result. Always 'success' on successful script creation
Final filename of the script (may have suffix if duplicate was found)
Unique ID assigned to the newly created script
Product error code for the authorization failure
Localised error message for the error code
Product error code for the failure
Localised error message for the error code
Script was added to the repository successfully
{
"fileName": "MyScript.bat",
"scriptId": 67890,
"status": "success"
}
The API user does not have the role required for this operation
{
"errorCode": 1001,
"errorMsg": "Access denied - You are not allowed to access the requested resource."
}
Unexpected server error while adding the script
{
"errorCode": 1003,
"errorMsg": "An Internal Error occurred, try again later."
}
![]()
Duration: 1 minute | Threshold: 30 | 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.
© 2026, Zoho Corporation Pvt. Ltd. All Rights Reserved.