Get Alerts In Workspace
Get the list of alerts in the specified workspace, including the status and last run details of each alert.
REQUEST URI
https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/alerts
Get
oauthscope: ZohoAnalytics.metadata.read
Sample Request:
Copiedcurl "https://analyticsapi.zoho.com/restapi/v2/workspaces/35130000001055707/alerts" -H 'ZANALYTICS-ORGID: <org-id>' -H 'Authorization: Zoho-oauthtoken <access_token>'Copiedusing System;
using System.Collections.Generic;
using System.Text.Json;
using ZohoAnalytics;
namespace ZohoAnalyticsTest
{
class Program
{
long orgId = 55522777;
long workspaceId = 35130000001055707;
public void GetAlertsInWorkspace(IAnalyticsClient ac)
{
IWorkspaceAPI workspace = ac.GetWorkspaceInstance(orgId, workspaceId);
JsonElement result = workspace.GetAlertsInWorkspace();
Console.WriteLine(result);
}
static void Main(string[] args)
{
string clientId = "1000.xxxxxxx";
string clientSecret = "xxxxxxx";
string refreshToken = "1000.xxxxxxx.xxxxxxx";
IAnalyticsClient ac = new AnalyticsClient(clientId, clientSecret, refreshToken);
Program obj = new Program();
obj.GetAlertsInWorkspace(ac);
}
}
}Copiedpackage main
import (
"fmt"
ZAnalytics "zoho/pkg/analyticsclient"
)
var (
clientId = "1000.xxxxxxx"
clientSecret = "xxxxxxx"
refreshToken = "1000.xxxxxxx.xxxxxxx"
orgId = "55522777"
workspaceId = "35130000001055707"
)
func GetAlertsInWorkspace(ac ZAnalytics.Client) {
workspace := ZAnalytics.GetWorkspaceInstance(&ac, orgId, workspaceId)
result, exception := workspace.GetAlertsInWorkspace()
if exception != nil {
fmt.Println(exception.ErrorMessage)
return
}
fmt.Println(result)
}
func main() {
ac := ZAnalytics.GetAnalyticsClient(clientId, clientSecret, refreshToken)
GetAlertsInWorkspace(ac)
}Copiedimport com.zoho.analytics.client.*;
import org.json.*;
public class Test {
private long orgId = 55522777l;
private long workspaceId = 35130000001055707l;
public static void main(String args[]) {
String clientId = "1000.xxxxxxx";
String clientSecret = "xxxxxxx";
String refreshToken = "1000.xxxxxxx.xxxxxxx";
Test tObj = new Test();
AnalyticsClient ac = new AnalyticsClient(clientId, clientSecret, refreshToken);
try {
tObj.getAlertsInWorkspace(ac);
} catch (Exception ex) {
ex.printStackTrace();
}
}
public void getAlertsInWorkspace(AnalyticsClient ac) throws Exception {
WorkspaceAPI workspace = ac.getWorkspaceInstance(orgId, workspaceId);
JSONArray result = workspace.getAlertsInWorkspace();
System.out.println(result);
}
}Copied<?php
require 'AnalyticsClient.php';
class Test {
public $ac;
public $org_id = "55522777";
public $workspace_id = "35130000001055707";
function __construct() {
$this->ac = new AnalyticsClient("1000.xxxxxxx", "xxxxxxx", "1000.xxxxxxx.xxxxxxx");
}
function getAlertsInWorkspace() {
$workspace = $this->ac->getWorkspaceInstance($this->org_id, $this->workspace_id);
$response = $workspace->getAlertsInWorkspace();
print_r($response);
}
}
$obj = new Test();
$obj->getAlertsInWorkspace();
?>Copiedfrom AnalyticsClient import AnalyticsClient
class Config:
CLIENTID = "1000.xxxxxxx"
CLIENTSECRET = "xxxxxxx"
REFRESHTOKEN = "1000.xxxxxxx.xxxxxxx"
ORGID = "55522777"
WORKSPACEID = "35130000001055707"
class Sample:
ac = AnalyticsClient(Config.CLIENTID, Config.CLIENTSECRET, Config.REFRESHTOKEN)
def get_alerts_in_workspace(self, ac):
workspace = ac.get_workspace_instance(Config.ORGID, Config.WORKSPACEID)
result = workspace.get_alerts_in_workspace()
print(result)
obj = Sample()
obj.get_alerts_in_workspace(obj.ac)Copiedvar analyticsClient = require('./AnalyticsClient');
var ac = new analyticsClient('1000.xxxxxxx', 'xxxxxxx', '1000.xxxxxxx.xxxxxxx');
var orgId = '55522777';
var workspaceId = '35130000001055707';
var workspace = ac.getWorkspaceInstance(orgId, workspaceId);
workspace.getAlertsInWorkspace().then((result) => { console.log(result); }).catch((error) => { console.log(error); });CopiedorgId = "55522777";
workspaceId = "35130000001055707";
headersMap = Map();
headersMap.put("ZANALYTICS-ORGID", orgId);
response = invokeurl
[
url :"https://analyticsapi.zoho.com/restapi/v2/workspaces/" + workspaceId + "/alerts"
type :GET
headers:headersMap
connection:"analytics_oauth_connection"
];
info response;Copiedrequire 'zoho_analytics_client'
class Config
ORGID = "55522777"
WORKSPACEID = "35130000001055707"
end
class Sample
def initialize
@ac = AnalyticsClient.new.with_data_center("US").with_oauth({
"clientId" => "1000.xxxxxxx",
"clientSecret" => "xxxxxxx",
"refreshToken" => "1000.xxxxxxx.xxxxxxx"
}).build
end
def get_alerts_in_workspace
workspace = @ac.get_workspace_instance(Config::ORGID, Config::WORKSPACEID)
result = workspace.get_alerts_in_workspace
puts result
end
end
obj = Sample.new
obj.get_alerts_in_workspaceDownload client libraries: C# | GO | JAVA | PHP | PYTHON | NodeJS | Ruby
Sample Response:
CopiedHTTP/1.1 200 OK
Content-Type:application/json;charset=UTF-8
{
"status": "success",
"summary": "Get alerts in workspace",
"data": {
"alerts": [
{
"id": "137687000010815003",
"name": "Sales Drop Alert",
"viewId": "137687000006991601",
"viewName": "Sales By Region",
"enabled": true,
"createdTime": "2026-03-12T10:15:22+05:30",
"createdByName": "Jane Doe",
"createdBy": "jane.doe@example.com",
"lastModifiedTime": "2026-03-20T09:00:00+05:30",
"lastModifiedByName": "Jane Doe",
"lastModifiedBy": "jane.doe@example.com",
"lastAlertSentTime": "2026-03-20T09:05:00+05:30",
"lastRunTime": "2026-03-20T09:05:00+05:30",
"lastRunStatus": "Condition met",
"nextScheduleTime": "2026-03-21T09:00:00+05:30"
},
{
"id": "137687000010815005",
"name": "Region sub-total monitor",
"viewId": "466206000000105001",
"viewName": "Sales Pivot",
"enabled": false,
"createdTime": "2026-03-19T18:42:03+05:30",
"createdByName": "John Roe",
"createdBy": "john.roe@example.com",
"lastModifiedTime": "2026-03-19T18:42:03+05:30",
"lastModifiedByName": "John Roe",
"lastModifiedBy": "john.roe@example.com",
"lastAlertSentTime": "",
"lastRunTime": "",
"lastRunStatus": "",
"nextScheduleTime": ""
}
]
}
}