Creates a new sensor with scripts, output variables, and execution metadata. Supports WINDOWS, LINUX, and MAC platforms.
post /intelligence/sensors/api/addSensor
https://{serverurl}/intelligence/sensors/api/addSensor
Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52
Container object holding all sensor configuration details
Unique sensor name. Allowed characters: alphanumeric, underscore, space. Max 100 chars
Human-readable description of the sensor purpose. Max 500 chars
true if this is a user-created custom sensor; false for built-in sensors
Number of execution runs to retain for this sensor
When to execute: 'ondemand' for manual trigger or 'nextSchedule' for scheduled execution
true to overwrite existing sensor version; false to skip if unchanged
Array of platform-specific script definitions for the sensor
Script content or file path. Max 25000 chars
Target OS platform: WINDOWS, LINUX, or MAC (case-insensitive)
Script file name (e.g., collectDisk.ps1)
Command-line arguments passed to the script. Max 1000 chars
Comma-separated success exit codes (e.g., '0,3010'). Max 250 chars
Array of output variable definitions (0-70 items) the sensor collects
Variable name (letters, numbers, and underscores only). Max 100 characters
User-friendly display name. Alphanumeric, underscore, space. Max 100 chars
Data type of the output: 1=String, 2=Integer, 3=Large Integer, 4=Decimal
Default value when sensor returns no output. Max 250 chars
true if this variable contains Personally Identifiable Information
Purpose of this output variable. Max 500 chars
Existing output variable ID (0 for new variables)
curl --request POST \
--url https://appdomains/intelligence/sensors/api/addSensor \
--header 'Accept: application/addSensor.v1+json' \
--header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \
--header 'Content-Type: application/json' \
--data '{}'Create a custom disk health sensor for Windows with one output variable
{
"sensorDetails": {
"isCustomSensor": true,
"sensorName": "Disk Health Sensor",
"executionType": "ondemand",
"description": "Collects disk metrics",
"numberOfRun": 30,
"outputVariables": [
{
"variableName": "diskUsage",
"displayName": "Disk Usage",
"defaultValue": "0",
"dataType": 1,
"description": "Usage percentage",
"isPII": false,
"outputVariableID": 0
}
],
"forceUpdate": false,
"sensorScriptDetails": [
{
"scriptArgs": "--quick",
"fileName": "collectDisk.ps1",
"exitCode": "0,3010",
"content": "Get-WmiObject Win32_DiskDrive | Select-Object Status",
"platform": "WINDOWS"
}
]
}
}
Result of the operation: 'success' on successful creation
A confirmation message (e.g., 'Sensor Disk Health Sensor added successfully')
Unique ID of the newly created sensor
Version ID of the created sensor
Name of the created sensor
Error code indicating which validation failed
Details about which field failed and why
Unauthorized error code: credentials missing, expired, or invalid
Authentication failure reason
Error code for the server error
Details about the server error
Sensor created successfully
{
"sensorVersionID": "67890",
"sensorName": "Disk Health Sensor",
"message": "Sensor Disk Health Sensor added successfully",
"status": "success",
"sensorID": "12345"
}
Sensor name contains invalid characters
{
"errorMessage": "Sensor name contains invalid characters. Only alphanumeric, underscore and space are allowed.",
"errorCode": "SENSOR_VALIDATION_ERROR"
}
Login credentials are missing or invalid
{
"errorMessage": "Authentication required. Provide valid credentials.",
"errorCode": "UNAUTHORIZED"
}
Server error while creating the sensor
{
"errorMessage": "An internal error occurred while creating the sensor.",
"errorCode": "INTERNAL_ERROR"
}
![]()
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.