---
title: "Count Change Event"
method: POST
path: "/change-events/count"
tags: ["Change Event"]
---

# Count Change Event

`POST /change-events/count`

## Request

- Base URL: `https://oneuptime.com/api`
- URL: `https://oneuptime.com/api/change-events/count`
- Auth: API key in header `APIKey`
- TypeScript: <https://skmtc.dev/oneuptime/apis/oneuptime-openapi-specification/docs/change-events/count/post.ts> (a function with typed inputs; its response is checked against the schema)

Endpoint to count Change Event items

## Request body

- object
  - `query` ChangeEventV1QuerySchema: Query schema for ChangeEventV1. A field takes a plain value, which it matches exactly, or an operator its type allows. Telemetry tables are large: bound every query by time.
    - `projectId` union: Query operators for projectId field of type Object ID. Supported operators: EqualTo, NotEqual, IsNull, NotNull, Includes.
      - string
      - object
        - `_type` 'NotEqual', required
        - `value` string, required
      - object
        - `_type` 'IsNull', required
      - object
        - `_type` 'NotNull', required
      - object
        - `_type` 'Includes', required
        - `value` string[], required
    - `primaryEntityId` union: Query operators for primaryEntityId field of type Object ID. Supported operators: EqualTo, NotEqual, IsNull, NotNull, Includes.
      - string
      - object
        - `_type` 'NotEqual', required
        - `value` string, required
      - object
        - `_type` 'IsNull', required
      - object
        - `_type` 'NotNull', required
      - object
        - `_type` 'Includes', required
        - `value` string[], required
    - `primaryEntityType` union: Query operators for primaryEntityType field of type Text. Supported operators: EqualTo, NotEqual, IsNull, NotNull, Includes, EqualToOrNull, Search.
      - string
      - object
        - `_type` 'NotEqual', required
        - `value` string, required
      - object
        - `_type` 'IsNull', required
      - object
        - `_type` 'NotNull', required
      - object
        - `_type` 'Includes', required
        - `value` string[], required
      - object
        - `_type` 'EqualToOrNull', required
        - `value` string, required
      - object
        - `_type` 'Search', required
        - `value` string, required
    - `time` union: Query operators for time field of type DateTime64. Supported operators: EqualTo, NotEqual, IsNull, NotNull, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual, InBetween. Times are ISO-8601, such as 2026-01-01T00:00:00.000Z.
      - string, date-time
      - object
        - `_type` 'NotEqual', required
        - `value` string, date-time, required
      - object
        - `_type` 'IsNull', required
      - object
        - `_type` 'NotNull', required
      - object
        - `_type` 'GreaterThan', required
        - `value` string, date-time, required
      - object
        - `_type` 'GreaterThanOrEqual', required
        - `value` string, date-time, required
      - object
        - `_type` 'LessThan', required
        - `value` string, date-time, required
      - object
        - `_type` 'LessThanOrEqual', required
        - `value` string, date-time, required
      - object
        - `_type` 'InBetween', required
        - `startValue` string, date-time, required
        - `endValue` string, date-time, required
    - `eventType` union: Query operators for eventType field of type Text. Supported operators: EqualTo, NotEqual, IsNull, NotNull, Includes, EqualToOrNull, Search.
      - string
      - object
        - `_type` 'NotEqual', required
        - `value` string, required
      - object
        - `_type` 'IsNull', required
      - object
        - `_type` 'NotNull', required
      - object
        - `_type` 'Includes', required
        - `value` string[], required
      - object
        - `_type` 'EqualToOrNull', required
        - `value` string, required
      - object
        - `_type` 'Search', required
        - `value` string, required
    - `title` union: Query operators for title field of type Text. Supported operators: EqualTo, NotEqual, IsNull, NotNull, Includes, EqualToOrNull, Search.
      - string
      - object
        - `_type` 'NotEqual', required
        - `value` string, required
      - object
        - `_type` 'IsNull', required
      - object
        - `_type` 'NotNull', required
      - object
        - `_type` 'Includes', required
        - `value` string[], required
      - object
        - `_type` 'EqualToOrNull', required
        - `value` string, required
      - object
        - `_type` 'Search', required
        - `value` string, required
    - `description` union: Query operators for description field of type Text. Supported operators: EqualTo, NotEqual, IsNull, NotNull, Includes, EqualToOrNull, Search.
      - string
      - object
        - `_type` 'NotEqual', required
        - `value` string, required
      - object
        - `_type` 'IsNull', required
      - object
        - `_type` 'NotNull', required
      - object
        - `_type` 'Includes', required
        - `value` string[], required
      - object
        - `_type` 'EqualToOrNull', required
        - `value` string, required
      - object
        - `_type` 'Search', required
        - `value` string, required
    - `attributes` object: Query operators for attributes field of type Map(String, String). Supported operators: EqualTo, NotEqual, IsNull, NotNull, Search. Filtered by key, each key with these operators: {"attributes": {"<key>": <value or operator>}}.
    - `attributeKeys` union: Query operators for attributeKeys field of type Array of Text. Supported operators: EqualTo, NotEqual, IsNull, NotNull, Includes, Search. EqualTo, NotEqual and Search match one element; Includes matches any of several.
      - object
        - `_type` 'EqualTo', required
        - `value` string, required
      - object
        - `_type` 'NotEqual', required
        - `value` string, required
      - object
        - `_type` 'IsNull', required
      - object
        - `_type` 'NotNull', required
      - object
        - `_type` 'Includes', required
        - `value` string[], required
      - object
        - `_type` 'Search', required
        - `value` string, required
    - `_id` union: Query operators for _id field of type Object ID. Supported operators: EqualTo, NotEqual, IsNull, NotNull, Includes.
      - string
      - object
        - `_type` 'NotEqual', required
        - `value` string, required
      - object
        - `_type` 'IsNull', required
      - object
        - `_type` 'NotNull', required
      - object
        - `_type` 'Includes', required
        - `value` string[], required
    - `createdAt` union: Query operators for createdAt field of type Date. Supported operators: EqualTo, NotEqual, IsNull, NotNull, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual, InBetween. Times are ISO-8601, such as 2026-01-01T00:00:00.000Z.
      - string, date-time
      - object
        - `_type` 'NotEqual', required
        - `value` string, date-time, required
      - object
        - `_type` 'IsNull', required
      - object
        - `_type` 'NotNull', required
      - object
        - `_type` 'GreaterThan', required
        - `value` string, date-time, required
      - object
        - `_type` 'GreaterThanOrEqual', required
        - `value` string, date-time, required
      - object
        - `_type` 'LessThan', required
        - `value` string, date-time, required
      - object
        - `_type` 'LessThanOrEqual', required
        - `value` string, date-time, required
      - object
        - `_type` 'InBetween', required
        - `startValue` string, date-time, required
        - `endValue` string, date-time, required

## Response `200`

Successful response

- object
  - `count` number

## Other responses

- `400`: Bad request. This response indicates that the request was malformed or contained invalid data.
- `401`: Unauthorized. This response indicates that the request requires user authentication.
- `402`: Payment Required. This response indicates that the request requires payment or a valid subscription.
- `403`: Forbidden. This response indicates that the server understood the request, but refuses to authorize it.
- `405`: Project not found. This response indicates that the requested project does not exist or is not accessible.
- `408`: Request Timeout. This response indicates that the server timed out waiting for the request.
- `415`: Unable to reach server. This response indicates that the server is currently unreachable or down.
- `422`: Not authorized. This response indicates that the user does not have permission to access the requested resource.
- `500`: Internal Server Error. This response indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.

---

[API](https://skmtc.dev/oneuptime/apis/oneuptime-openapi-specification.md) - [All operations](https://skmtc.dev/oneuptime/apis/oneuptime-openapi-specification/llms.txt) - [OpenAPI document](https://skmtc.dev/oneuptime/apis/oneuptime-openapi-specification/revisions/ba3307d00304?raw)
