Fortinet white logo
Fortinet white logo

CameraEvent

CameraEvent

Timeline of motion detection video recordings and annotations about related system events that may interrupt recordings, such as reboots. See also the FortiRecorder Log Reference.

Permissions required include Camera notifications.

HTTP Methods
  • GET

URL

Either:

  • https://HOST_OR_IP/api/v1/CameraEvent
  • https://HOST_OR_IP/api/v1/CameraEvent?device_name=CAMERA_NAMES&start_time=TIMESTAMP&end_time=TIMESTAMP&evt_filter=FILTER&startIndex=INDEX&pageSize=PAGE_SIZE

where variables (zero or more) are:

  • CAMERA_NAMES — Optional. Comma-separated unique identifiers of specific devices, such as the cameras named fd51,cd55. See also CameraCamera.

  • TIMESTAMP — Optional. Timestamp in the format YYYY-MM-DD-HH-MM-SS (year, month, day, hour, minute, second).

  • INDEX — Optional. See also Filtering and paging.

  • PAGE_SIZE — Optional. See also Filtering and paging.

  • FILTER — Optional. Event type. Each event has both atype and subtype JSON attribute, indicating whether the event is a motion detection, annotation, etc These can be used for FILTER. See Type and Subtype.

Request JSON

Leave empty.

Response JSON

Responses vary by URL (collection vs. individual resource). For example, if you get an individual event log message, you may receive a response like this:

{
    "objectID": "CameraEventCollection:",
    "reqAction": 1,
    "totalRemoteCount": 2,
    "subCount": 2,
    "remoteSorting": true,
    "nextPage": false,
    "nodePermission": 3,
    "nodeAccessDetails": 1,
    "collection": [
        {
            "mkey": "FK400D3016000013\/System\/001735840431-1048576:1\/1",
            "start_time": "2025-01-02 12:53:51",
            "start_timestamp": 1735840431,
            "type": 1048576,
            "subtype": 1,
            "forward_from_camera": ""
        },
        {
            "mkey": "FK400D3016000013\/System\/001735833948-1048576:32\/1",
            "start_time": "2025-01-02 11:05:48",
            "start_timestamp": 1735833948,
            "type": 1048576,
            "subtype": 32,
            "forward_from_camera": ""
        }
    ]
}

Type

Only one bit is active, but when used in FILTER in the URL, multiple bits can be set.

  • 0 — Evt_None

  • 1 << 0 — Evt_Detect_Generic

  • 1 << 1 — Evt_Detect_Motion (see Motion)

  • 1 << 2 — Evt_Detect_Audio

  • 1 << 3 — Evt_Detect_DI (digital input)

  • 1 << 4 — Evt_Detect_PIR (passive infrared)

  • 1 << 5 — Evt_Detect_Tamper (see Tamper)

  • 1 << 6 — Evt_Detect_Face_Detection (see Face detection)

  • 1 << 7 — Evt_Detect_Physical_Access

  • 1 << 8 — Evt_Detect_Object_Detection

  • 1 << 16 — Evt_Camera (see Camera event)

  • 1 << 17 — Evt_Recording (see Recording)

  • 1 << 18 — Evt_Schedule (see Camera event)

  • 1 << 19 — Evt_Annotate

  • 1 << 20 — Evt_System (see System event)

  • 1 << 21 — Evt_Notification

Subtype

Subtype is relative to the event type. Only one bit is active.

Motion

  • 0 — SubEvt_Motion_None

  • 1 << 0 — SubEvt_Motion_Motion

  • 1 << 1 — SubEvt_Motion_MotionAlarm

  • 1 << 2 — SubEvt_Motion_ObjectInside

  • 1 << 3 — SubEvt_Motion_Crossed

Tamper

  • 0 — SubEvt_Tamper_None

  • 1 << 0 — SubEvt_Tamper_Realtime

  • 1 << 1 — SubEvt_Tamper_Tamper

  • 1 << 2 — SubEvt_Tamper_SceneChanged

Face detection

  • 0 — SubEvt_Face_None

  • 1 << 0 — SubEvt_Face_Blocked

  • 1 << 1 — SubEvt_Face_VIP

  • 1 << 2 — SubEvt_Face_Expired

  • 1 << 3 — SubEvt_Face_Unknown

  • 1 << 4 — SubEvt_Face_Generic

  • 1 << 5 — SubEvt_Face_Masked

  • 1 << 6 — SubEvt_Face_Unmasked

Object detection

  • 0 — SubEvt_Object_None

  • 1 << 0 — SubEvt_Object_Person

  • 1 << 1 — SubEvt_Object_Motion

  • 1 << 2 — SubEvt_Object_Weapon

  • 1 << 3 — SubEvt_Object_Vehicle

  • 1 << 4 — SubEvt_Object_Animal

  • 1 << 5 — SubEvt_Object_Item

  • 1 << 6 — SubEvt_Object_Sports

Camera event

  • 0 — SubEvt_Camera_None

  • 1 << 0 — SubEvt_Camera_Reset

  • 1 << 1 — SubEvt_Camera_Reboot

  • 1 << 2 — SubEvt_Camera_Power Up

  • 1 << 3 — SubEvt_Camera_Restart

  • 1 << 4 — SubEvt_Camera_Disable

  • 1 << 5 — SubEvt_Camera_Enable

  • 1 << 6 — SubEvt_Camera_SD_Format

  • 1 << 7 — SubEvt_Camera_Upgrade

  • 1 << 8 — SubEvt_Camera_Suspend

  • 1 << 9 — SubEvt_Camera_Resume

  • 1 << 10 — SubEvt_Camera_Interruption

Recording

  • 0 — SubEvt_Rec_None

  • 1 << 0 — SubEvt_Rec_Continuous

  • 1 << 1 — SubEvt_Rec_Detection

  • 1 << 2 — SubEvt_Rec_Manual

  • 1 << 3 — SubEvt_Rec_Temp

System event

  • 0 — SubEvt_System_None

  • 1 << 0 — SubEvt_System_Startup

  • 1 << 1 — SubEvt_System_Halt

  • 1 << 2 — SubEvt_System_Reboot

  • 1 << 3 — SubEvt_System_Reload

  • 1 << 4 — SubEvt_System_Disk

  • 1 << 5 — SubEvt_System_Upgrade

  • 1 << 6 — SubEvt_System_Downgrade

  • 1 << 7 — SubEvt_System_Loadgui

  • 1 << 8 — SubEvt_System_Update

State

Multiple bits can be active at the same time.

  • 0 — State_None

  • 1 << 0 — State_Active (camera is recording)

  • 1 << 1 — State_Inactive (camera is not recording)

  • 1 << 1 — State_Edge (stored on the camera's SD card)

  • 1 << 1 — State_NonEdge (stored by FortiRecorder)

  • 1 << 1 — State_Locked (recording file is locked)

  • 1 << 1 — State_Unlocked

Example: Get events after 1 AM on January 1, 2025

curl -X GET -b cookie.txt "https://HOST_OR_IP/api/v1/CameraEvent?start_time=2025-01-01-01-00-00"
Tooltip

On Microsoft Windows with the curl command, if the URL has parameters, then you must put double quotes ( " ) around the URL. Otherwise the command line may try to interpret URL parameters after each ampersand ( & ), question mark ( ? ), or asterisk/star ( * ) as commands or arguments. Errors at the end of the JSON indicate this problem but do not accurately show the cause, such as:

'reqAction' is not recognized as an internal or external command, operable program or batch file.

Reserved characters and escape sequence vary by operating system and command line environment.

Example: Get events for cameras "cam1" and "cam2" during a specified time period

curl -X GET -b cookie.txt "https://HOST_OR_IP/api/v1/ Timeline?device_name=cam1,cam2&start_time=2025-01-01-01-00-00&end_time=2025-01-02-14-00-00"

CameraEvent

CameraEvent

Timeline of motion detection video recordings and annotations about related system events that may interrupt recordings, such as reboots. See also the FortiRecorder Log Reference.

Permissions required include Camera notifications.

HTTP Methods
  • GET

URL

Either:

  • https://HOST_OR_IP/api/v1/CameraEvent
  • https://HOST_OR_IP/api/v1/CameraEvent?device_name=CAMERA_NAMES&start_time=TIMESTAMP&end_time=TIMESTAMP&evt_filter=FILTER&startIndex=INDEX&pageSize=PAGE_SIZE

where variables (zero or more) are:

  • CAMERA_NAMES — Optional. Comma-separated unique identifiers of specific devices, such as the cameras named fd51,cd55. See also CameraCamera.

  • TIMESTAMP — Optional. Timestamp in the format YYYY-MM-DD-HH-MM-SS (year, month, day, hour, minute, second).

  • INDEX — Optional. See also Filtering and paging.

  • PAGE_SIZE — Optional. See also Filtering and paging.

  • FILTER — Optional. Event type. Each event has both atype and subtype JSON attribute, indicating whether the event is a motion detection, annotation, etc These can be used for FILTER. See Type and Subtype.

Request JSON

Leave empty.

Response JSON

Responses vary by URL (collection vs. individual resource). For example, if you get an individual event log message, you may receive a response like this:

{
    "objectID": "CameraEventCollection:",
    "reqAction": 1,
    "totalRemoteCount": 2,
    "subCount": 2,
    "remoteSorting": true,
    "nextPage": false,
    "nodePermission": 3,
    "nodeAccessDetails": 1,
    "collection": [
        {
            "mkey": "FK400D3016000013\/System\/001735840431-1048576:1\/1",
            "start_time": "2025-01-02 12:53:51",
            "start_timestamp": 1735840431,
            "type": 1048576,
            "subtype": 1,
            "forward_from_camera": ""
        },
        {
            "mkey": "FK400D3016000013\/System\/001735833948-1048576:32\/1",
            "start_time": "2025-01-02 11:05:48",
            "start_timestamp": 1735833948,
            "type": 1048576,
            "subtype": 32,
            "forward_from_camera": ""
        }
    ]
}

Type

Only one bit is active, but when used in FILTER in the URL, multiple bits can be set.

  • 0 — Evt_None

  • 1 << 0 — Evt_Detect_Generic

  • 1 << 1 — Evt_Detect_Motion (see Motion)

  • 1 << 2 — Evt_Detect_Audio

  • 1 << 3 — Evt_Detect_DI (digital input)

  • 1 << 4 — Evt_Detect_PIR (passive infrared)

  • 1 << 5 — Evt_Detect_Tamper (see Tamper)

  • 1 << 6 — Evt_Detect_Face_Detection (see Face detection)

  • 1 << 7 — Evt_Detect_Physical_Access

  • 1 << 8 — Evt_Detect_Object_Detection

  • 1 << 16 — Evt_Camera (see Camera event)

  • 1 << 17 — Evt_Recording (see Recording)

  • 1 << 18 — Evt_Schedule (see Camera event)

  • 1 << 19 — Evt_Annotate

  • 1 << 20 — Evt_System (see System event)

  • 1 << 21 — Evt_Notification

Subtype

Subtype is relative to the event type. Only one bit is active.

Motion

  • 0 — SubEvt_Motion_None

  • 1 << 0 — SubEvt_Motion_Motion

  • 1 << 1 — SubEvt_Motion_MotionAlarm

  • 1 << 2 — SubEvt_Motion_ObjectInside

  • 1 << 3 — SubEvt_Motion_Crossed

Tamper

  • 0 — SubEvt_Tamper_None

  • 1 << 0 — SubEvt_Tamper_Realtime

  • 1 << 1 — SubEvt_Tamper_Tamper

  • 1 << 2 — SubEvt_Tamper_SceneChanged

Face detection

  • 0 — SubEvt_Face_None

  • 1 << 0 — SubEvt_Face_Blocked

  • 1 << 1 — SubEvt_Face_VIP

  • 1 << 2 — SubEvt_Face_Expired

  • 1 << 3 — SubEvt_Face_Unknown

  • 1 << 4 — SubEvt_Face_Generic

  • 1 << 5 — SubEvt_Face_Masked

  • 1 << 6 — SubEvt_Face_Unmasked

Object detection

  • 0 — SubEvt_Object_None

  • 1 << 0 — SubEvt_Object_Person

  • 1 << 1 — SubEvt_Object_Motion

  • 1 << 2 — SubEvt_Object_Weapon

  • 1 << 3 — SubEvt_Object_Vehicle

  • 1 << 4 — SubEvt_Object_Animal

  • 1 << 5 — SubEvt_Object_Item

  • 1 << 6 — SubEvt_Object_Sports

Camera event

  • 0 — SubEvt_Camera_None

  • 1 << 0 — SubEvt_Camera_Reset

  • 1 << 1 — SubEvt_Camera_Reboot

  • 1 << 2 — SubEvt_Camera_Power Up

  • 1 << 3 — SubEvt_Camera_Restart

  • 1 << 4 — SubEvt_Camera_Disable

  • 1 << 5 — SubEvt_Camera_Enable

  • 1 << 6 — SubEvt_Camera_SD_Format

  • 1 << 7 — SubEvt_Camera_Upgrade

  • 1 << 8 — SubEvt_Camera_Suspend

  • 1 << 9 — SubEvt_Camera_Resume

  • 1 << 10 — SubEvt_Camera_Interruption

Recording

  • 0 — SubEvt_Rec_None

  • 1 << 0 — SubEvt_Rec_Continuous

  • 1 << 1 — SubEvt_Rec_Detection

  • 1 << 2 — SubEvt_Rec_Manual

  • 1 << 3 — SubEvt_Rec_Temp

System event

  • 0 — SubEvt_System_None

  • 1 << 0 — SubEvt_System_Startup

  • 1 << 1 — SubEvt_System_Halt

  • 1 << 2 — SubEvt_System_Reboot

  • 1 << 3 — SubEvt_System_Reload

  • 1 << 4 — SubEvt_System_Disk

  • 1 << 5 — SubEvt_System_Upgrade

  • 1 << 6 — SubEvt_System_Downgrade

  • 1 << 7 — SubEvt_System_Loadgui

  • 1 << 8 — SubEvt_System_Update

State

Multiple bits can be active at the same time.

  • 0 — State_None

  • 1 << 0 — State_Active (camera is recording)

  • 1 << 1 — State_Inactive (camera is not recording)

  • 1 << 1 — State_Edge (stored on the camera's SD card)

  • 1 << 1 — State_NonEdge (stored by FortiRecorder)

  • 1 << 1 — State_Locked (recording file is locked)

  • 1 << 1 — State_Unlocked

Example: Get events after 1 AM on January 1, 2025

curl -X GET -b cookie.txt "https://HOST_OR_IP/api/v1/CameraEvent?start_time=2025-01-01-01-00-00"
Tooltip

On Microsoft Windows with the curl command, if the URL has parameters, then you must put double quotes ( " ) around the URL. Otherwise the command line may try to interpret URL parameters after each ampersand ( & ), question mark ( ? ), or asterisk/star ( * ) as commands or arguments. Errors at the end of the JSON indicate this problem but do not accurately show the cause, such as:

'reqAction' is not recognized as an internal or external command, operable program or batch file.

Reserved characters and escape sequence vary by operating system and command line environment.

Example: Get events for cameras "cam1" and "cam2" during a specified time period

curl -X GET -b cookie.txt "https://HOST_OR_IP/api/v1/ Timeline?device_name=cam1,cam2&start_time=2025-01-01-01-00-00&end_time=2025-01-02-14-00-00"