Milestone XProtect RESTful Alarms API (1.0.0)

Download OpenAPI specification:Download

Introduction

Using the RESTful Alarms API, you can retrieve and trigger alarms in XProtect. You can also get alarm statistics, list alarm messages and work with alarm snapshots. To get started quickly with the Alarms REST API, refer to our comprehensive quickstart quide. For more detailed information about the Alarms REST API and its endpoints, refer to the complete API reference.

⚠️ The Alarms REST API is currently in beta version. Future releases of this API might break backwards compatibility.

What is an alarm?

An alarm is an alert that requires attention or action from the security operator. Security operators view alarms in the Alarm Manager tab of Smart Client. Alarms have a state, priority and assigned user.

State

The state of an alarm describes how it is being handled. For example, it can be New, In progress, On hold or Closed. Each state is associated to a state level (integer). You can create custom state levels or view existing ones in the Alarms / Alarm Data Settings node in Management Client.

Priority

The priority of an alarm describes its importance or urgency. For example, it can be High, Medium or Low. Each priority is associated to a priority level (integer). You can create custom priority levels or view existing ones in the Alarms / Alarm Data Settings node in Management Client.

Assigned user

The assigned user of an alarm is the owner of the alarm. For example, the security operator that is verifying the alarm.

Creating alarms

Alarms can be created in two ways:

  • When an event matches an Alarm Definition
  • Posting an alarm directly with the API

Alarm Definitions

You can create an Alarm Definition with the Configuration REST API: Alarm definitions for a specific event type.

If you trigger an event with the Events REST API, a new alarm will be created if the event type matches the Alarm definition.

Quickstart

Requirements

To use the Alarms REST API, you must have:

  • A system running XProtect 2023 R2 or later. You are recommended to set up a small separate system for development. If you don't have one, install XProtect following the Get started guide.

  • A Basic user or Windows user with access to some devices. If you don't have one, go to Create basic users.

⚠️ User credentials, bearer tokens, and other sensitive data are transmitted in cleartext if you do not set up certificates and use HTTPS. Make sure that your XProtect system is set up with HTTPS in production.

⚠️ To use most of the Alarms REST API you need a license including Alarm Manager. Check your license capabilities in the Product index

cURL

Follow this quickstart guide to retrieve alarms with cURL.

  1. Verify the requirements

    Check the initial Requirements.

  2. Get an auth token

    Replace the hostname test-01.example.com, username myUser, and password myPassword before running the following sample.

    curl --insecure --request POST "https://test-01.example.com/idp/connect/token" \
    --header "Content-Type: application/x-www-form-urlencoded" \
    --data-urlencode "grant_type=password" \
    --data-urlencode "username=myUsername" \
    --data-urlencode "password=myPassword" \
    --data-urlencode "client_id=GrantValidatorClient"
    

    In Windows Command Prompt (CMD), replace the line continuation character \ with ^.

  3. Retrieve alarms

    Replace the hostname test-01.example.com and the sample token eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L... ay0ferTwm-DZ4OxNXGTHk5t7R_YTWPjg before running the following sample.

    curl --insecure --request GET "https://test-01.example.com/api/rest/v1/alarms" \
    --header "Authorization: Bearer eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L... ay0ferTwm-DZ4OxNXGTHk5t7R_YTWPjg"
    

    In Windows Command Prompt (CMD), replace the line continuation character \ with ^.

    ☑️ If you receive an empty array, make sure that you have some alarm definitions set up and that they are triggered.

Python

Follow this quickstart guide to retrieve alarms with Python.

  1. Verify the requirements

    Check the initial Requirements.

  2. Install dependencies

    pip install requests

  3. Retrieve alarms

    Replace the USERNAME username, PASSWORD password, and SERVER_URL https://test-01.example.com before running the following sample.

    import requests  # pip install requests
    
    USERNAME = 'username'  # replace with your basic user name
    PASSWORD = 'password'  # replace with your basic user password
    SERVER_URL = 'https://test-01.example.com'  # replace with your server URL
    VERIFY_CERTIFICATES = True  # set to False in development if your certificates are self-signed
    
    
    def main():
        session = requests.Session()
    
        # 1. Retrieve a token from IDP
        response = session.request("POST",
                                f"{SERVER_URL}/IDP/connect/token",
                                headers={
                                    'Content-Type': 'application/x-www-form-urlencoded'
                                },
                                data=f"grant_type=password"
                                        f"&username={USERNAME}"
                                        f"&password={PASSWORD}"
                                        f"&client_id=GrantValidatorClient",
                                verify=VERIFY_CERTIFICATES)
        if response.status_code != 200:
            return print(f"Unable to retrieve token: {response.status_code}")
    
        token = response.json()['access_token']
    
        # 2. Retrieve alarms with the token
        response = session.request("GET",
                                f"{SERVER_URL}/api/rest/v1/alarms",
                                headers={
                                    'Authorization': f'Bearer {token}'
                                },
                                verify=VERIFY_CERTIFICATES)
        if response.status_code != 200:
            return print(f"Unable to retrieve alarms: {response.status_code}")
        
        alarms = response.json()
        print(f"GET /alarms response:\n{alarms}\n\n")
    
    
    if __name__ == '__main__':
        main()
    

    ☑️ If you receive an empty array, make sure that you have some alarm definitions set up and that they are triggered.

Python (Windows User)

Follow this quickstart guide to retrieve alarms with Python using a Windows users.

  1. Verify the requirements

    Check the initial Requirements.

  2. Install dependencies

    pip install requests requests-ntlm

  3. Retrieve alarms

    Replace the USERNAME username, PASSWORD password, and SERVER_URL https://test-01.example.com before running the following sample.

    import requests  # pip install requests
    from requests_ntlm import HttpNtlmAuth  # pip install requests-ntlm
    
    
    USERNAME = 'domain\\username'  # replace with your windows domain and username
    PASSWORD = 'password'  # replace with your windows user password
    SERVER_URL = 'https://test-01.example.com'  # replace with your server URL
    VERIFY_CERTIFICATES = True  # set to False in development if your certificates are self-signed
    
    
    def main():
        session = requests.Session()
    
        # 1. Retrieve a token from IDP
        response = session.request("POST",
                                f"{SERVER_URL}/IDP/connect/token",
                                headers={
                                    'Content-Type': 'application/x-www-form-urlencoded'
                                },
                                data="grant_type=windows_credentials&client_id=GrantValidatorClient",
                                verify=VERIFY_CERTIFICATES,
                                auth=HttpNtlmAuth(USERNAME, PASSWORD))
        if response.status_code != 200:
            return print(f"Unable to retrieve token: {response.status_code}")
    
        token = response.json()['access_token']
    
        # 2. Retrieve alarms with the token
        response = session.request("GET",
                                f"{SERVER_URL}/api/rest/v1/alarms",
                                headers={
                                    'Authorization': f'Bearer {token}'
                                },
                                verify=VERIFY_CERTIFICATES)
        if response.status_code != 200:
            return print(f"Unable to retrieve alarms: {response.status_code}")
        
        alarms = response.json()
        print(f"GET /alarms response:\n{alarms}\n\n")
    
    
    if __name__ == '__main__':
        main()
    

    ☑️ If you receive an empty array, make sure that you have some alarm definitions set up and that they are triggered.

Node.js

Follow this quickstart guide to retrieve alarms with Node.js.

  1. Verify the requirements

    Check the initial Requirements.

  2. Retrieve alarms

    Replace the USERNAME username, PASSWORD password, and SERVER_URL https://test-01.example.com before running the following sample.

    const USERNAME = 'username';  // replace with your basic user name
    const PASSWORD = 'password';  // replace with your basic user password
    const SERVER_URL = 'https://test-01.example.com';  // replace with your server URL
    const VERIFY_CERTIFICATES = true;  // set to False in development if your certificates are self-signed
    
    
    if (!VERIFY_CERTIFICATES) process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
    
    
    fetch(`${SERVER_URL}/IDP/connect/token`, {
        method: 'POST',
        headers:{
            'Content-Type': 'application/x-www-form-urlencoded'
        }, 
        body: new URLSearchParams({
            grant_type: 'password',
            username: USERNAME,
            password: PASSWORD,
            client_id: 'GrantValidatorClient'
        })
    })
    .then(response => response.json())
    .then(token_response => {
        const token = token_response['access_token'];
        return fetch(`${SERVER_URL}/api/rest/v1/alarms`, {
            headers:{
                'Authorization': `Bearer ${token}`
            }
        })
    })
    .then(response => response.json())
    .then(alarms => console.log(alarms))
    .catch((err) => {
        console.log(err);
    });
    

    ☑️ If you receive an empty array, make sure that you have some alarm definitions set up and that they are triggered.

Powershell

Follow this quickstart guide to retrieve alarms with the PowerShell.

  1. Verify the requirements

    Check the initial Requirements.

  2. Get an auth token

    Replace the hostname test-01.example.com, username myUser, and password myPassword before running the following sample.

    $headers = @{ "Content-Type" = "application/x-www-form-urlencoded" }
    $body = @{grant_type='password'
        username='myUsername'
        password='myPassword'
        client_id='GrantValidatorClient'}
    $response = Invoke-RestMethod 'https://test-01.example.com/idp/connect/token' -Method 'POST' -Headers $headers -Body $body
    $response | ConvertTo-Json
    
  3. Retrieve alarms

    Replace the hostname test-01.example.com and the sample token eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L... ay0ferTwm-DZ4OxNXGTHk5t7R_YTWPjg before running the following sample.

    $headers = @{ "Authorization" = "Bearer eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L...ay0ferTwm-DZ4OxNXGTHk5t7R_YTWPjg" }
    $response = Invoke-RestMethod 'https://test-01.example.com/api/rest/v1/alarms' -Method 'GET' -Headers $headers
    $response | ConvertTo-Json
    

    ☑️ If you receive an empty array, make sure that you have some alarm definitions set up and that they are triggered.

Filtering

You can add match filters to a resource URI to limit the amount of data returned.

GET /resource?property=operator:value

string and DateTime values are delimited with single quotation marks ('), but int values are not.

GET /resource?property=lt:'2023-04-14T07:42:49.223Z'
GET /resource?property=contains:'John'
GET /resource?property=gt:123

Array values are required by some operators like oneOf. Arrays are comma-separated list of values delimited by ( and ):

GET /resource?property=oneOf:(1,4,8)
GET /resource?property=oneOf:('string value 1','string value 2')

When filtering by string values, escape any single quote ' as two single quotes ''.

GET /resource?property=contains:'string with ''single'' quotes'
GET /resource?property=oneOf:('with ''quote''', 'more ''quotes''')

When no filter operator is included, the operator defaults to equals.

GET /resource?property=value
GET /resource?property=equals:value

You can use any of the other available operators, like this:

GET /resource?property=notEquals:123
GET /resource?property=gt:123
GET /resource?property=lt:'2023-04-14T07:42:49.223Z'
GET /resource?property=startsWith:'Event'
GET /resource?property=contains:'a substring'
GET /resource?property=oneOf:(1,2,3)

You can combine multiple operators as a comma separated array, like this:

GET /resource?property=lt:'2023-04-14T07:42:49.223Z',gt:'2023-04-12T07:42:49.223Z'

Available filter operators:

  • lt less than
  • gt greater than
  • equals equals
  • notEquals not equals
  • startsWith string starts with
  • contains string that contains
  • oneOf equals one of the values in the array

Ordering

You can use the orderBy query parameter to order the result of some resource collections.

GET /resource?orderBy=asc:'fieldName'
GET /resource?orderBy=desc:'fieldName'

You can fine tune the ordering combining multiple statements as a comma separated array, like this:

GET /resource?orderBy=asc:'field1',desc:'field2',asc:'field3'

Available ordering operators:

  • asc ascending
  • desc descending

Alarm Authorized Roles

Retrieve the roles authorized to access an alarm

Returns the roles authorized to access an alarm given its id. Users might be part of multiple roles.

Authorizations:
Bearer
path Parameters
id
required
string <guid>

Alarm identifier as Guid.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Alarm Categories

List all alarm categories

Authorizations:
Bearer
query Parameters
page
integer <int32>
size
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "_links": {
    },
  • "array": [
    ]
}

Create an alarm category

Creates a new alarm category.

Authorizations:
Bearer
Request Body schema: application/json
required
level
required
integer <int32>

Integer level associated to the alarm category.

name
required
string

Name of the alarm category.

Responses

Request samples

Content type
application/json
{
  • "level": 11,
  • "name": "Closed"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update an alarm category

Updates an alarm category given its id.

Authorizations:
Bearer
path Parameters
id
required
string <guid>

Alarm category identifier as Guid.

Request Body schema: application/json
required

The fields to update in the alarm category.

level
required
integer

Update the alarm category level.

name
required
string

Update the alarm category name.

Responses

Request samples

Content type
application/json
{
  • "level": 1,
  • "name": "updated name"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete an alarm category

Deletes an alarm category given its id.

Authorizations:
Bearer
path Parameters
id
required
string <guid>

Alarm category identifier as Guid.

Responses

Response samples

Content type
application/json
{ }

Alarm Close Reasons

Retrieve alarm close reasons configuration

Retrieves the configuration of alarm close reasons, which can be used by operators as descriptions when closing alarms.

Authorizations:
Bearer

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update alarm close reasons configuration

Updates the configuration of alarm close reasons.

Authorizations:
Bearer
Request Body schema: application/json
required

The new alarm close reasons configuration.

enabled
required
boolean

Reasons for closing feature is enabled.

reasons
required
Array of strings

Array of reasons for closing available for selection.

Responses

Request samples

Content type
application/json
{
  • "enabled": true,
  • "reasons": [
    ]
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Alarm Definitions

List all alarm definitions

Authorizations:
Bearer
query Parameters
disabled
boolean or null
page
integer <int32>
size
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "_links": {
    },
  • "array": [
    ]
}

Create an alarm definition

Creates a new alarm definition.

Authorizations:
Bearer
Request Body schema: application/json
required
displayName
string or null

Alarm definition display name.

enabled
boolean

Is alarm definition enabled.

id
string <guid>

Id (unique) of the alarm definition.

name
required
string

Alarm definition name.

description
required
string

Alarm definition description.

eventType
string or null <guid>

Triggering event type (id).

eventTypeGroup
string or null <guid>

Triggering event type group (id).

required
Array of objects (ItemDto)

Array of source objects associated with the alarm.

enableRule
required
string

Defines when the alarm can be triggered. Enum: "0" "1" "2". 0=Always, 1=TimeProfile, 2=EventTriggered.

required
ItemDto (object)

Defines what TimeProfile to be used when checking when the alarm is enabled. Valid only if EnableRule is set to "1".

required
Array of objects (ItemDto)

Defines list of event that could start the alarm. Valid only if EnableRule is set to "2".

required
Array of objects (ItemDto)

Defines list of event that could stop the alarm. Valid only if EnableRule is set to "2".

managementTimeoutTime
required
string <duration>

Operator action time limit. If operator action is required within a specific time, the time is defined here. Format: HH:mm:ss.

required
Array of objects (ItemDto)

Defines list of events that could be triggered after managementTimeoutTime expiration.

required
Array of objects (ItemDto)

List of related camera items to the generated alarm.

mapType
required
string

Alarm manager view map type. Enum: "0" "1" "2". 0=None, 1=Map, 2=Smart Map

relatedMap
required
string <guid>

Id of related map item. Valid only if mapType is set to "1".

owner
required
string

Defines the initial owner. Should be formatted as Identity.ToString() does.

priority
required
string <guid>

Sets the initial priority of the generated alarm.

category
required
string <guid>

Sets the initial category of the generated alarm.

required
Array of objects (ItemDto)

Defines list of events that could be triggered by the alarm.

autoClose
boolean

Defines if an alarm should be closed automatically upon reception of a specific message from save source.

assignableToAdmins
required
boolean

Alarm assignable to Administrators. Select this to include users with an administrator role in the Assigned to list.

(RelatedItemDto (object or null))

"Links" with relation objects.

Responses

Request samples

Content type
application/json
{
  • "displayName": "My alarm definition",
  • "enabled": true,
  • "id": "a748988c-5589-41d4-a3ee-fda98cf6733f",
  • "name": "My alarm definition",
  • "description": "This definition triggers an alarm every time when ...",
  • "eventType": "0fcb1955-0e80-4fd4-a78a-db47ee89700c",
  • "eventTypeGroup": "f67fc7a1-8d87-4204-90f7-1d5854f9f5cd",
  • "sourceList": [
    ],
  • "enableRule": 0,
  • "timeProfile": {
    },
  • "enableEventList": [
    ],
  • "disableEventList": [
    ],
  • "managementTimeoutTime": "00:10:00",
  • "managementTimeoutEventList": [
    ],
  • "relatedCameraList": [
    ],
  • "mapType": 1,
  • "relatedMap": "daa2165b-c545-406f-b4c3-1833d4e62923",
  • "owner": "John Doe (Acme/JD)",
  • "priority": "8188ff24-b5da-4c19-9ebf-c1d8fc2caa75",
  • "category": "00000000-0000-0000-0000-000000000000",
  • "triggerEventList": [
    ],
  • "autoClose": false,
  • "assignableToAdmins": true,
  • "relations": {
    }
}

Response samples

Content type
application/json
{
  • "result": {
    }
}

Get alarm definition by id

Authorizations:
Bearer
path Parameters
id
required
string <guid>

Alarm definition identifier as Guid.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update an alarm definition

Updates an alarm definition given its id.

Authorizations:
Bearer
path Parameters
id
required
string <guid>

Alarm definition identifier as Guid.

Request Body schema: application/json
required

The fields to update in the alarm definition.

displayName
string or null

Alarm definition display name.

enabled
boolean

Is alarm definition enabled.

id
string <guid>

Id (unique) of the alarm definition.

name
required
string

Alarm definition name.

description
required
string

Alarm definition description.

eventType
string or null <guid>

Triggering event type (id).

eventTypeGroup
string or null <guid>

Triggering event type group (id).

required
Array of objects (ItemDto)

Array of source objects associated with the alarm.

enableRule
required
string

Defines when the alarm can be triggered. Enum: "0" "1" "2". 0=Always, 1=TimeProfile, 2=EventTriggered.

required
ItemDto (object)

Defines what TimeProfile to be used when checking when the alarm is enabled. Valid only if EnableRule is set to "1".

required
Array of objects (ItemDto)

Defines list of event that could start the alarm. Valid only if EnableRule is set to "2".

required
Array of objects (ItemDto)

Defines list of event that could stop the alarm. Valid only if EnableRule is set to "2".

managementTimeoutTime
required
string <duration>

Operator action time limit. If operator action is required within a specific time, the time is defined here. Format: HH:mm:ss.

required
Array of objects (ItemDto)

Defines list of events that could be triggered after managementTimeoutTime expiration.

required
Array of objects (ItemDto)

List of related camera items to the generated alarm.

mapType
required
string

Alarm manager view map type. Enum: "0" "1" "2". 0=None, 1=Map, 2=Smart Map

relatedMap
required
string <guid>

Id of related map item. Valid only if mapType is set to "1".

owner
required
string

Defines the initial owner. Should be formatted as Identity.ToString() does.

priority
required
string <guid>

Sets the initial priority of the generated alarm.

category
required
string <guid>

Sets the initial category of the generated alarm.

required
Array of objects (ItemDto)

Defines list of events that could be triggered by the alarm.

autoClose
boolean

Defines if an alarm should be closed automatically upon reception of a specific message from save source.

assignableToAdmins
required
boolean

Alarm assignable to Administrators. Select this to include users with an administrator role in the Assigned to list.

(RelatedItemDto (object or null))

"Links" with relation objects.

Responses

Request samples

Content type
application/json
{
  • "displayName": "My alarm definition",
  • "enabled": true,
  • "id": "a748988c-5589-41d4-a3ee-fda98cf6733f",
  • "name": "My alarm definition",
  • "description": "This definition triggers an alarm every time when ...",
  • "eventType": "0fcb1955-0e80-4fd4-a78a-db47ee89700c",
  • "eventTypeGroup": "f67fc7a1-8d87-4204-90f7-1d5854f9f5cd",
  • "sourceList": [
    ],
  • "enableRule": 0,
  • "timeProfile": {
    },
  • "enableEventList": [
    ],
  • "disableEventList": [
    ],
  • "managementTimeoutTime": "00:10:00",
  • "managementTimeoutEventList": [
    ],
  • "relatedCameraList": [
    ],
  • "mapType": 1,
  • "relatedMap": "daa2165b-c545-406f-b4c3-1833d4e62923",
  • "owner": "John Doe (Acme/JD)",
  • "priority": "8188ff24-b5da-4c19-9ebf-c1d8fc2caa75",
  • "category": "00000000-0000-0000-0000-000000000000",
  • "triggerEventList": [
    ],
  • "autoClose": false,
  • "assignableToAdmins": true,
  • "relations": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete an alarm definition

Deletes an alarm definition given its id.

Authorizations:
Bearer
path Parameters
id
required
string <guid>

Alarm definition identifier as Guid.

Responses

Response samples

Content type
application/json
{ }

Alarm Disables

List all alarm disables

Alarm disables specify which event types not triggering alarms in a specific source during a given time.

Authorizations:
Bearer
query Parameters
page
integer <int32>
size
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "_links": {
    },
  • "array": [
    ]
}

Create an alarm disable

Creates a new alarm disable.

Authorizations:
Bearer
Request Body schema: application/json
required
source
required
string

The resource path of the source for which alarms are disabled.

disabledEventTypes
required
Array of strings <guid> [ items <guid > ]

Ids of the event types disabled for the source. Alarms that originate from any of these event types and this source are disabled.

comment
string or null

Description or justification for disabling the alarm.

expirationTime
required
string <date-time>

Time at which the alarm disable is automatically removed by the server and alarms start being triggered again.

Responses

Request samples

Content type
application/json
{
  • "source": "cameras/ba1d8392-9568-4ac9-ba38-03f92cafc506",
  • "disabledEventTypes": [
    ],
  • "comment": "Feral cat keeps triggering motion detection in Camera - Door 3.",
  • "expirationTime": "2023-02-28T18:10:12.4786334Z"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Retrieves an alarm disable

Alarm disables specify which event types are not triggering alarms in a specific source during a given time.

Authorizations:
Bearer
path Parameters
id
required
string <guid>

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update or create an alarm disable

Updates or creates an alarm disable given its id.

Authorizations:
Bearer
path Parameters
id
required
string <guid>

Alarm disable identifier as Guid.

Request Body schema: application/json
required

The fields to update in the alarm disable.

source
required
string

The resource path of the source for which alarms are disabled.

disabledEventTypes
required
Array of strings <guid> [ items <guid > ]

Ids of the event types disabled for the source. Alarms that originate from any of these event types and this source are disabled.

comment
string or null

Description or justification for disabling the alarm.

expirationTime
required
string <date-time>

Time at which the alarm disable is automatically removed by the server and alarms start being triggered again.

Responses

Request samples

Content type
application/json
{
  • "source": "cameras/ba1d8392-9568-4ac9-ba38-03f92cafc506",
  • "disabledEventTypes": [
    ],
  • "comment": "Feral cat keeps triggering motion detection in Camera - Door 3.",
  • "expirationTime": "2023-02-28T18:10:12.4786334Z"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete an alarm disable

Deletes an alarm disable given its id.

Authorizations:
Bearer
path Parameters
id
required
string <guid>

Alarm disable identifier as Guid.

Responses

Response samples

Content type
application/json
{ }

Alarm Manager Columns

Retrieve alarm manager columns

Retrieves the configuration of alarm manager columns.

Authorizations:
Bearer

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update alarm manager columns

Updates the configuration of manager columns.

Authorizations:
Bearer
Request Body schema: application/json
required

The new alarm manager columns.

enabledColumns
required
Array of strings (AlarmListColumn)
Items Enum: "Priority" "PriorityName" "State" "StateName" "Category" "CategoryName" "Id" "Time" "Name" "Source" "Message" "Rule" "Vendor" "Location" "CustomTag" "Image" "Type" "ObjectValue" "AssignedTo" "ServerName"

Array of columns available in alarm manager for selection.

Responses

Request samples

Content type
application/json
{
  • "enabledColumns": [
    ]
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Alarm Priorities

List all alarm priorities

Authorizations:
Bearer
query Parameters
page
integer <int32>
size
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "_links": {
    },
  • "array": [
    ]
}

Create an alarm priority

Creates a new alarm priority.

Authorizations:
Bearer
Request Body schema: application/json
required
level
required
integer <int32>

Integer level associated to the alarm category.

name
required
string

Name of the alarm category.

soundNotificationsOnLoop
required
boolean

Loop sound notifications for alarms in Smart Client.

desktopNotificationsEnabled
required
boolean

Display notifications for alarms in Smart Client.

soundId
required
string or null <guid>

Sound notification for alarms in Smart Client.

Responses

Request samples

Content type
application/json
{
  • "level": 11,
  • "name": "Closed",
  • "soundNotificationsOnLoop": true,
  • "desktopNotificationsEnabled": 5,
  • "soundId": "25ee70da-c3e8-452c-8c32-ff623e882581"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update an alarm priority

Updates an alarm priority given its id.

Authorizations:
Bearer
path Parameters
id
required
string <guid>

Alarm priority identifier as Guid.

Request Body schema: application/json
required

The fields to update in the alarm priority.

level
required
integer <int32>

Update the alarm priority level.

name
required
string

Update the alarm priority name.

soundNotificationsOnLoop
required
boolean

Update whether alarms sound notifications are looped in Smart Client.

desktopNotificationsEnabled
required
boolean

Update whether alarms notifications are displayed in Smart Client.

soundId
required
string or null <guid>

Sound notification for alarms in Smart Client.

Responses

Request samples

Content type
application/json
{
  • "level": 1,
  • "name": "updated name",
  • "soundNotificationsOnLoop": true,
  • "desktopNotificationsEnabled": true,
  • "soundId": "25ee70da-c3e8-452c-8c32-ff623e882581"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete an alarm priority

Deletes an alarm priority given its id.

Authorizations:
Bearer
path Parameters
id
required
string <guid>

Alarm priority identifier as Guid.

Responses

Response samples

Content type
application/json
{ }

Alarm Settings

Retrieve alarm settings

Retrieves the alarm settings, including alarm and log retention.

Authorizations:
Bearer

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update alarm settings

Updates the alarm settings, including alarm retention and logging.

Authorizations:
Bearer
Request Body schema: application/json
required

The new alarm settings.

closedAlarmsRetentionPeriodDays
required
integer <int32>

Number of days up to which closed alarms are stored.

otherAlarmsRetentionPeriodDays
required
integer <int32>

Number of days up to which non closed alarms are stored.

traceEnabled
required
boolean

Trace logging is enabled, for troubleshooting purposes.

Responses

Request samples

Content type
application/json
{
  • "closedAlarmsRetentionPeriodDays": 30,
  • "otherAlarmsRetentionPeriodDays": 15,
  • "traceEnabled": false
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Alarm Messages

List all alarm messages

Authorizations:
Bearer
query Parameters
page
integer <int32>
size
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "_links": {
    },
  • "array": [
    ]
}

Alarm Sounds

List all alarm sounds

Authorizations:
Bearer
query Parameters
page
integer <int32>
size
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "_links": {
    },
  • "array": [
    ]
}

Create an alarm sound

Creates a new alarm sound and upload its sound.

Authorizations:
Bearer
Request Body schema: application/json
required
name
required
string

Name that describes the alarm sound.

sound
string or null

Base 64 encoded sound.

Responses

Request samples

Content type
application/json
{
  • "name": "Ping sound",
  • "sound": "string"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Retrieve an alarm sound

Retrieves an alarm sound given its id, including the actual source sound base 64 encoded.

Authorizations:
Bearer
path Parameters
id
required
string <guid>

Alarm sound identifier as Guid.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete an alarm sound

Deletes an alarm sound given its id.

Authorizations:
Bearer
path Parameters
id
required
string <guid>

Alarm sound identifier as Guid.

Responses

Response samples

Content type
application/json
{ }

Alarm States

List all alarm states

Authorizations:
Bearer
query Parameters
page
integer <int32>
size
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "_links": {
    },
  • "array": [
    ]
}

Create an alarm state

Creates a new alarm state.

Authorizations:
Bearer
Request Body schema: application/json
required
level
required
integer <int32>

Integer level associated to the alarm state.

name
required
string

Name of the alarm state.

Responses

Request samples

Content type
application/json
{
  • "level": 11,
  • "name": "Closed"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update an alarm state

Updates an alarm state given its id.

Authorizations:
Bearer
path Parameters
id
required
string <guid>

Alarm state identifier as Guid.

Request Body schema: application/json
required

The fields to update in the alarm state.

level
required
integer

Update the alarm state level.

name
required
string

Update the alarm state name.

Responses

Request samples

Content type
application/json
{
  • "level": 1,
  • "name": "updated name"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete an alarm state

Deletes an alarm state given its id. Some states are built in and cannot be removed (1, 4, 9, 11).

Authorizations:
Bearer
path Parameters
id
required
string <guid>

Alarm state identifier as Guid.

Responses

Response samples

Content type
application/json
{ }

Alarm Statistics

Retrieve alarm statistics

Alarm Statistics explain the number of alarms depending on their state.

Authorizations:
Bearer
query Parameters
include
string or null <include>
Example: include=byState

Use the include query parameter to receive optional fields.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Alarm Suppression

Create an alarm suppression.

Authorizations:
Bearer
Request Body schema: application/json
required
source
required
string

The resource path of the source device in the Configuration REST API.

comment
required
string or null

A comment related with the suppression.

expirationTime
required
string <date-time>

Time at which the alarm suppression expires.

Responses

Request samples

Content type
application/json
{
  • "source": "c4c6e1f5-9b2a-455e-905a-654fde888ae1",
  • "comment": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
  • "expirationTime": "2023-02-28T18:10:12.4786334Z"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

List all alarm suppressions

Retrieve all alarm suppressions.

Authorizations:
Bearer
query Parameters
source.id
string or null <filter>
Example: source.id=equals:'cameras/d0ba5376-35b6-4cb6-9d38-a976287f3569'

Filter alarms suppressions according to the source id. Supports both formats: id and REST resource uri. Allowed operators: equals (see filtering).

page
integer <int32>
size
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "_links": {
    },
  • "array": [
    ]
}

Update an alarm suppression.

Change the alarm suppression expiration time and comment.

Authorizations:
Bearer
path Parameters
id
required
string <guid>
Request Body schema: application/json
required
comment
required
string or null

A comment related with the suppression.

expirationTime
required
string <date-time>

Time at which the alarm suppression expires.

Responses

Request samples

Content type
application/json
{
  • "comment": "Lorem ipsum dolor sit amet...",
  • "expirationTime": "2023-02-28T18:10:12.4786334Z"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete an alarm suppression.

Deletes an alarm suppression given its id.

Authorizations:
Bearer
path Parameters
id
required
string <guid>

Alarm suppression identifier as Guid.

Responses

Response samples

Content type
application/json
{ }

Alarms

Retrieve an alarm

Retrieves the details of an alarm given its id.

Authorizations:
Bearer
path Parameters
id
required
string <guid>

Alarm identifier as Guid.

query Parameters
include
string or null <include>
Example: include=data

Use the include query parameter to receive optional fields.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update an alarm

Change the alarm state, priority, category and other fields.

Authorizations:
Bearer
path Parameters
id
required
string <guid>
Request Body schema: application/json
required
comment
required
string or null

A comment for the alarm update, that will be returned as part of the alarm history.

priority
required
string <guid>

Update the alarm priority.

state
required
string <guid>

Update the alarm state.

assignedTo.displayName
required
string or null

Reassign the alarm to another user (non-empty string), assign it to no user (empty string) or discard update of that field (null). Accepts any string.

reasonForClosing
required
string or null

Update the reason for closing of the alarm. Configure reasons for closing in Management Client.

Responses

Request samples

Content type
application/json
{
  • "comment": "Security personnel verified the area and closed the door again.",
  • "priority": "2050b7c1-7b89-44b2-92f0-9f6b00d9da84",
  • "state": "6cfe4b7f-13f5-4cb8-8d1c-e1437ddfa93a",
  • "assignedTo.displayName": "basic ([basic]\\myUserName)",
  • "reasonForClosing": "Blacklisted car in door 3"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Trigger an alarm

Creates a new alarm that is not associated to an event.

Authorizations:
Bearer
Request Body schema: application/json
required
name
required
string

Name of the alarm.

message
required
string

Description of the alarm cause.

category
string or null <guid>

The alarm category allows grouping of alarms. By default, the alarm belongs to no categories.

priority
string or null <guid>

The alarm priority explains the level of urgency and/or importance of an alarm. Configure alarm priorities in Management Client. By default, the alarm has priority High.

state
string or null <guid>

The alarm state describes what is being done with an alarm. Such as "New", "In Progress", "On Hold" or "Closed". Configure alarm states in Management Client. By defaults, the alarm has state New.

assignedTo.displayName
string or null

User to whom the alarm is assigned to.

source
required
string

Source device of the alarm. Some alarms (i.e. the ones coming from User Defined Events) can have the source set to null. The source must be a valid REST resource string or a guid. If the source device is camera the format can be cameras/{id} or simply {id} Retrieve valid cameras from the Configuration API.

time
string or null <date-time>

Time at which the alarm was triggered in ISO 8601 format.

tag
string or null

Custom tag that coudl be used for sorting or filtering

(AnalyticsData (object or null))

Associated analytics data, including objects in the scene and references.

Responses

Request samples

Content type
application/json
{
  • "name": "Blacklisted Car Detected",
  • "message": "Blacklisted car in door 3",
  • "category": "07ca8280-8bb8-40fe-8662-3db2324b8c8f",
  • "priority": "3096f622-8884-453e-adcb-a614df7faf02",
  • "state": "6f7056af-2be7-4273-bc8a-afbb823f6932",
  • "assignedTo.displayName": "basic ([basic]\\myUserName)",
  • "source": "cameras/e028f597-c64b-4f27-bb8d-08f5cd768e1c",
  • "time": "2023-02-28T18:10:12.4786334Z",
  • "tag": "My custom tag",
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

List all alarms

Retrieve all alarms, including closed alarms.

Authorizations:
Bearer
query Parameters
orderBy
string or null <orderBy>
Example: orderBy=asc:'localId',desc:'message'

Order alarms according to one or more fields. Allowed operators: asc, desc (see ordering). Allowed fields: localId, time, assignedTo.displayName, message, lastUpdatedTime, priority.level, state.level, category.level, priority.name, state.name, category.name

localId
integer or null <filter>
Example: localId=53

Filter alarms according to the localId. Allowed operators: gt, lt, equals, notEquals, oneOf (see filtering).

message
string or null <filter>
Example: message=contains:'External Event'

Filter alarms according to the alarm message. Allowed operators: equals, notEquals, contains, startsWith, oneOf, 'containsOneOf' (see filtering).

assignedTo.displayName
string or null <filter>
Example: assignedTo.displayName=startsWith:'Basic',contains:'John'

Filter alarms according to the assigned user. Allowed operators: equals, notEquals, contains, startsWith, oneOf, 'containsOneOf' (see filtering).

time
string or null <filter>
Example: time=gt:'2023-02-28T21:09:05.1868451Z',lt:'2023-02-29T21:09:05.18Z'

Filter alarms according to the time when the alarm was triggered. Supports an accuracy of 10ms. Allowed operators: gt, lt (see filtering).

lastUpdatedTime
string or null <filter>
Example: lastUpdatedTime=gt:'2023-02-28T21:09:05.1868451Z',lt:'2023-02-29T21:09:05.18Z'

Filter alarms according to the time when they were last modified. I.e., when someone reassigns the alarm or changes its priority. Supports an accuracy of 10ms. Allowed operators: gt, lt (see filtering).

state.level
integer or null <filter>
Example: state.level=gt:4,lt:11

Filter alarms according to the state level. Allowed operators: gt, lt, equals, notEquals, oneOf (see filtering).

state.name
string or null <filter>
Example: state.name=notEquals:'Closed'

Filter alarms according to the state name. Allowed operators: equals, notEquals, contains, startsWith, oneOf, 'containsOneOf' (see filtering).

priority.level
integer or null <filter>
Example: priority.level=gt:1

Filter alarms according to the state level. Allowed operators: gt, lt, equals, notEquals, oneOf (see filtering).

priority.name
string or null <filter>
Example: priority.name=notEquals:'Low'

Filter alarms according to the state name. Allowed operators: equals, notEquals, contains, startsWith, oneOf, 'containsOneOf' (see filtering).

category.level
integer or null <filter>
Example: category.level=gt:3,lt:8

Filter alarms according to the state level. Allowed operators: gt, lt, equals, notEquals, oneOf (see filtering).

category.name
string or null <filter>
Example: category.name=notEquals:'Alarm Category A'

Filter alarms according to the state name. Allowed operators: equals, notEquals, contains, startsWith, `oneOf', 'containsOneOf' (see filtering).

source.name
string or null <filter>
Example: source.name=notEquals:'Camera main entry'

Filter alarms according to the source name. Allowed operators: equals, notEquals, contains, startsWith, oneOf, 'containsOneOf' (see filtering).

source.id
string or null <filter>
Example: source.id=equals:'cameras/d0ba5376-35b6-4cb6-9d38-a976287f3569'

Filter alarms according to the source id. Supports both formats: id and REST resource uri. Allowed operators: equals, notEquals, oneOf (see filtering).

page
integer <int32>
size
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "_links": {
    },
  • "array": [
    ]
}

List the history of an alarm

List stored history of the alarm changes starting from the oldest.

Authorizations:
Bearer
path Parameters
id
required
string <guid>
query Parameters
page
integer <int32>
size
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "_links": {
    },
  • "array": [
    ]
}

List snapshots of an alarm

List all stored snapshots of the alarm, if any, in their attachment order.

Authorizations:
Bearer
path Parameters
id
required
string <guid>
query Parameters
page
integer <int32>
size
integer <int32>

Responses

Response samples

Content type
application/json
{
  • "_links": {
    },
  • "array": [
    ]
}

Attach a snapshot to an alarm

Creates a new snapshot and attaches it to an alarm with given id.

Authorizations:
Bearer
path Parameters
id
required
string <guid>
Request Body schema: application/json
required
timeOffset
integer <int32>

The time offset in milliseconds relative to the event timestamp.

width
integer

The width of the image in pixels.

height
integer

The height of the image in pixels.

hasOverlay
boolean

A flag indicating whether the image has overlay rendered into the image.

sizeInBytes
integer

The size in bytes of the binary image.

image
string or null <byte>

A binary JPEG image, if the image is stored in the alarm database.

path
string or null

A path to the image on the server, if the image is stored in the event server.

source
string or null

A source of the snapshot, if the snapshot refers to the recorded image on the recording server. The source must be set to a valid REST resource string. If the source device is a camera the format will be cameras/{id} or simply {id}

Responses

Request samples

Content type
application/json
{
  • "timeOffset": 0,
  • "width": 0,
  • "height": 0,
  • "hasOverlay": true,
  • "sizeInBytes": 0,
  • "image": "string",
  • "path": "string",
  • "source": "cameras/e028f597-c64b-4f27-bb8d-08f5cd768e1c"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

AlarmSessions

Get alarm lines based on a session id.

Returns an array of new alarms, an array of updated alarms and an array of alarms identifiers deleted from current version.

Authorizations:
Bearer
path Parameters
id
required
string <guid>
query Parameters
maxSize
integer <maxSize>
Example: maxSize=data

Use the maxSize query parameter to define the number of requested alarms.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Creates a session to request for new or deleted from session alarms.

Create an alarm session with a set of filters and an ordering criteria.If the filters or the ordering changes, you must delete the current session and start a new one.Use the session id to retrieve the alarms in the session.

Authorizations:
Bearer
Request Body schema: application/json
required
required
Array of objects (AlarmSessionFilter)

Filter conditions for alarms in the current session.

required
Array of objects (AlarmSessionOrderBy)

Order by conditions for alarms in the current session.

Responses

Request samples

Content type
application/json
{
  • "filterBy": [
    ],
  • "orderBy": [
    ]
}

Response samples

Content type
application/json
{
  • "filterBy": [
    ],
  • "orderBy": [
    ],
  • "id": "string"
}

Deletes a session.

Authorizations:
Bearer
path Parameters
id
required
string <guid>

The session id.

Responses

Response samples

Content type
application/json
{ }