Get Alert Events

Get the evaluation history of the specified alert.

REQUEST URI

https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/alerts/<alert-id>/events

Get

oauthscope: ZohoAnalytics.metadata.read

QUERY PARAMETERS

 

Parameter Name
Description
CONFIGJSONObject
Config parameter specifications are available in the below section.

FIELDS FOR CONFIG JSON

 

Key
Description
fromDateString
The start of the date range, inclusive. The date is based on the time zone of the user profile.
Supported formats: yyyy-MM-dd HH:mm:ss, yyyy-MM-dd. When only the date is specified, the time defaults to 00:00:00.
Maximum length - 50 characters.
Default value - Start of the day, 44 days before the current day.

Sample: {"fromDate":"2026-05-01 00:00:00"}
toDateString
The end of the date range, inclusive. It must be later than or equal to fromDate.
Supported formats: yyyy-MM-dd HH:mm:ss, yyyy-MM-dd. When only the date is specified, the time defaults to 23:59:59.
Maximum length - 50 characters.
Default value - End of the current day.

Sample: {"toDate":"2026-05-31 23:59:59"}
statusJSONArray
Filters the events by outcome.
Supported values:
triggered - The rules matched and the notifications were sent.
notTriggered - The alert was evaluated and the rules did not match.
error - The evaluation failed.
Supported range - 1 to 3 distinct values.
Maximum length - 200 characters.
Default value - All outcomes.

Sample: {"status":["triggered","error"]}
pageNoInteger
The page number to fetch.
Supported range - 1 to 100000.
Default value - 1.

Sample: {"pageNo":1}
recordsPerPageInteger
The number of events in a page.
Supported range - 1 to 100. A larger value is reduced to 100.
Default value - 100.

Sample: {"recordsPerPage":50}

Note: Events are retained for 45 days, including the current day.

Note: Events are returned in ascending order of time, so the latest event is the last entry on the last page.

Sample Request:

Copiedcurl "https://analyticsapi.zoho.com/restapi/v2/workspaces/35130000001055707/alerts/35130000001056611/events?CONFIG=%7B%22fromDate%22%3A%222026-05-01%2000%3A00%3A00%22%2C%22toDate%22%3A%222026-05-31%2023%3A59%3A59%22%2C%22status%22%3A%5B%22triggered%22%2C%22error%22%5D%2C%22pageNo%22%3A1%2C%22recordsPerPage%22%3A50%7D" -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 GetAlertEvents(IAnalyticsClient ac)
        {
            long alertId = 35130000001056611L;
            Dictionary<string, object> config = JsonSerializer.Deserialize<Dictionary<string, object>>("{\"fromDate\":\"2026-05-01 00:00:00\",\"toDate\":\"2026-05-31 23:59:59\",\"status\":[\"triggered\",\"error\"],\"pageNo\":1,\"recordsPerPage\":50}");
            IWorkspaceAPI workspace = ac.GetWorkspaceInstance(orgId, workspaceId);
            JsonElement result = workspace.GetAlertEvents(alertId, config);
            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.GetAlertEvents(ac);
        }
    }
}
Copiedpackage main

import (
    "fmt"
    ZAnalytics "zoho/pkg/analyticsclient"
)

var (
    clientId = "1000.xxxxxxx"
    clientSecret = "xxxxxxx"
    refreshToken = "1000.xxxxxxx.xxxxxxx"
    orgId = "55522777"
    workspaceId = "35130000001055707"
)

func GetAlertEvents(ac ZAnalytics.Client) {
    alertid := "35130000001056611"
    config := map[string]interface{}{
        "fromDate": "2026-05-01 00:00:00",
        "toDate": "2026-05-31 23:59:59",
        "status": []string{"triggered", "error"},
        "pageNo": 1,
        "recordsPerPage": 50,
    }
    workspace := ZAnalytics.GetWorkspaceInstance(&ac, orgId, workspaceId)
    result, exception := workspace.GetAlertEvents(alertid, config)
    if exception != nil {
        fmt.Println(exception.ErrorMessage)
        return
    }
    fmt.Println(result)
}

func main() {
    ac := ZAnalytics.GetAnalyticsClient(clientId, clientSecret, refreshToken)
    GetAlertEvents(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.getAlertEvents(ac);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    public void getAlertEvents(AnalyticsClient ac) throws Exception {
        long alertId = 35130000001056611l;
        JSONObject config = new JSONObject("{\"fromDate\":\"2026-05-01 00:00:00\",\"toDate\":\"2026-05-31 23:59:59\",\"status\":[\"triggered\",\"error\"],\"pageNo\":1,\"recordsPerPage\":50}");
        WorkspaceAPI workspace = ac.getWorkspaceInstance(orgId, workspaceId);
        JSONObject result = workspace.getAlertEvents(alertId, config);
        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 getAlertEvents() {
        $alert_id = "35130000001056611";
        $config = array(
            "fromDate" => "2026-05-01 00:00:00",
            "toDate" => "2026-05-31 23:59:59",
            "status" => array("triggered", "error"),
            "pageNo" => 1,
            "recordsPerPage" => 50
        );
        $workspace = $this->ac->getWorkspaceInstance($this->org_id, $this->workspace_id);
        $response = $workspace->getAlertEvents($alert_id, $config);
        print_r($response);
    }
}

$obj = new Test();
$obj->getAlertEvents();
?>
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_alert_events(self, ac):
        alert_id = "35130000001056611"
        config = {
            "fromDate": "2026-05-01 00:00:00",
            "toDate": "2026-05-31 23:59:59",
            "status": ["triggered", "error"],
            "pageNo": 1,
            "recordsPerPage": 50
        }
        workspace = ac.get_workspace_instance(Config.ORGID, Config.WORKSPACEID)
        result = workspace.get_alert_events(alert_id, config)
        print(result)

obj = Sample()
obj.get_alert_events(obj.ac)
Copiedvar analyticsClient = require('./AnalyticsClient');
var ac = new analyticsClient('1000.xxxxxxx', 'xxxxxxx', '1000.xxxxxxx.xxxxxxx');
var orgId = '55522777';
var workspaceId = '35130000001055707';

var alertId = "35130000001056611";
var config = {
    "fromDate": "2026-05-01 00:00:00",
    "toDate": "2026-05-31 23:59:59",
    "status": ["triggered", "error"],
    "pageNo": 1,
    "recordsPerPage": 50
};
var workspace = ac.getWorkspaceInstance(orgId, workspaceId);
workspace.getAlertEvents(alertId, config).then((result) => { console.log(result); }).catch((error) => { console.log(error); });
CopiedorgId = "55522777";
workspaceId = "35130000001055707";
alertId = "35130000001056611";
headersMap = Map();
headersMap.put("ZANALYTICS-ORGID", orgId);
config = {"fromDate": "2026-05-01 00:00:00", "toDate": "2026-05-31 23:59:59", "status": ["triggered", "error"], "pageNo": 1, "recordsPerPage": 50};
response = invokeurl
[
  url :"https://analyticsapi.zoho.com/restapi/v2/workspaces/" + workspaceId + "/alerts/" + alertId + "/events?CONFIG=" + zoho.encryption.urlEncode(config.toString())
  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_alert_events
    alert_id = "35130000001056611"
    config = {
      "fromDate" => "2026-05-01 00:00:00",
      "toDate" => "2026-05-31 23:59:59",
      "status" => ["triggered", "error"],
      "pageNo" => 1,
      "recordsPerPage" => 50
    }
    workspace = @ac.get_workspace_instance(Config::ORGID, Config::WORKSPACEID)
    result = workspace.get_alert_events(alert_id, config)
    puts result
  end
end

obj = Sample.new
obj.get_alert_events

Download client libraries:  C# | GO | JAVA | PHP | PYTHON | NodeJS | Ruby

Sample value for CONFIG parameter:

Copied{
  "fromDate": "2026-05-01 00:00:00",
  "toDate": "2026-05-31 23:59:59",
  "status": [
    "triggered",
    "error"
  ],
  "pageNo": 1,
  "recordsPerPage": 50
}

Sample Response:

CopiedHTTP/1.1 200 OK
Content-Type:application/json;charset=UTF-8

{
    "status": "success",
    "summary": "Get alert events",
    "data": {
        "alertEvents": [
            {
                "alertTime": "1779226560981",
                "status": "triggered"
            },
            {
                "alertTime": "1779228341225",
                "status": "error",
                "message": "Given date value 'East 23:59:59' is not compatible with the given date format 'dd MMM yyyy HH:mm:ss'",
                "errorCode": "INCOMPATIBLE_DATE_VALUE"
            },
            {
                "alertTime": "1779228341230",
                "status": "notTriggered"
            }
        ],
        "pageDetails": {
            "pageNo": 1,
            "recordsPerPage": 50,
            "hasNextPage": true
        }
    }
}