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

# Count

Resource: streams
Authorized roles: viewer

# OpenAPI definition

```json
{
  "components": {
    "schemas": {
      "IntervalQuery": {
        "properties": {
          "interval": {
            "type": "string",
            "enum": [
              "minute",
              "hour",
              "day"
            ]
          },
          "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"
          },
          "aggregate": {
            "type": "string",
            "enum": [
              "year",
              "month",
              "week",
              "day",
              "12 hours",
              "4 hours",
              "hour",
              "30 minutes",
              "5 minutes",
              "minute",
              "30 seconds",
              "5 seconds",
              "second"
            ]
          },
          "start": {
            "format": "date-time",
            "type": "string"
          },
          "end": {
            "format": "date-time",
            "type": "string"
          },
          "latestOnly": {
            "type": "boolean"
          },
          "next": {},
          "limit": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "type": "object",
        "required": [
          "interval",
          "start",
          "end"
        ]
      },
      "IsoDateListResponse": {
        "properties": {
          "items": {
            "items": {
              "format": "date-time",
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object",
        "required": [
          "items"
        ]
      },
      "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 query-api",
    "version": "1.357.8"
  },
  "openapi": "3.0.0",
  "paths": {
    "/presence": {
      "post": {
        "operationId": "PresenceController.count",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntervalQuery"
              }
            }
          },
          "description": "IntervalQuery",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IsoDateListResponse"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Count",
        "tags": [
          "Presence"
        ],
        "description": "Resource: streams\nAuthorized roles: viewer",
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "servers": [
    {
      "url": "https://api.formant.io/v1/queries"
    }
  ]
}
```