---
updatedAt: 2026-06-12T14:47:10.000Z
agentTools:
  projectIndex: https://docs.formant.io/llms.txt
---

# Counts by device

Count events by device
Resource: events
Authorized roles: viewer, device

# OpenAPI definition

```json
{
  "components": {
    "schemas": {
      "EventFilter": {
        "properties": {
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "viewed": {
            "type": "boolean"
          },
          "keyword": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "eventTypes": {
            "items": {
              "type": "string",
              "enum": [
                "triggered-event",
                "datapoint-event",
                "device-online",
                "device-offline",
                "intervention-request",
                "intervention-response",
                "teleop-session-record",
                "port-forwarding-session-record",
                "command-request",
                "command-response",
                "command-delivery",
                "custom",
                "comment",
                "system",
                "annotation",
                "task-summary",
                "stateful"
              ]
            },
            "type": "array"
          },
          "notificationEnabled": {
            "type": "boolean"
          },
          "userIds": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "type": "array"
          },
          "annotationTemplateIds": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "type": "array"
          },
          "disableNullMatches": {
            "type": "boolean"
          },
          "severities": {
            "items": {
              "type": "string",
              "enum": [
                "info",
                "warning",
                "error",
                "critical"
              ]
            },
            "type": "array"
          },
          "setsDeviceColor": {
            "type": "boolean"
          },
          "externalIds": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "parentIds": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "type": "array"
          },
          "tags": {
            "title": "MultiTagSets",
            "description": "One or more TagSets (combined with OR logic)",
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/TagSets"
                }
              },
              {
                "$ref": "#/components/schemas/TagSets"
              }
            ]
          },
          "deviceIds": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "type": "array"
          },
          "names": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "types": {
            "items": {
              "type": "string",
              "enum": [
                "bitset",
                "localization",
                "point cloud",
                "location",
                "file",
                "health",
                "transform tree",
                "battery",
                "video",
                "numeric set",
                "json",
                "image",
                "numeric",
                "text"
              ]
            },
            "type": "array"
          },
          "notTags": {},
          "notNames": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "agentIds": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "type": "array"
          },
          "start": {
            "format": "date-time",
            "type": "string"
          },
          "end": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "EventCounts": {
        "properties": {
          "total": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "info": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "warn": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "error": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "critical": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "triggered-events": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "intervention-request": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "type": "object",
        "required": [
          "total"
        ]
      },
      "EventCountsByDevice": {
        "properties": {
          "counts": {
            "items": {
              "$ref": "#/components/schemas/EventCounts"
            },
            "type": "array"
          }
        },
        "type": "object",
        "required": [
          "counts"
        ]
      },
      "TagSets": {
        "title": "TagSets",
        "description": "A map of tag keys to an array of values",
        "type": "object",
        "additionalProperties": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "info": {
    "title": "Formant admin-api",
    "version": "1.357.8"
  },
  "openapi": "3.0.0",
  "paths": {
    "/events/counts-by-device": {
      "post": {
        "operationId": "EventController.countsByDevice",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EventFilter"
              }
            }
          },
          "description": "EventFilter",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventCountsByDevice"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Counts by device",
        "tags": [
          "Event"
        ],
        "description": "Count events by device\nResource: events\nAuthorized roles: viewer, device",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "servers": [
    {
      "url": "https://api.formant.io/v1/admin"
    }
  ]
}
```