---
title: "Count Cloud Cost"
method: POST
path: "/cloud-cost/count"
tags: ["Cloud Cost"]
---

# Count Cloud Cost

`POST /cloud-cost/count`

## Request

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

Endpoint to count Cloud Cost items

## Request body

- object
  - `query` CloudCostV1QuerySchema: Query schema for CloudCostV1. A field takes a plain value, which it matches exactly, or an operator its type allows. Telemetry tables are large: bound every query by day.
    - `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
    - `cloudAccountId` union: Query operators for cloudAccountId 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
    - `cloudConnectionId` union: Query operators for cloudConnectionId 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
    - `provider` union: Query operators for provider 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
    - `accountId` union: Query operators for accountId 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
    - `day` union: Query operators for day 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
    - `service` union: Query operators for service 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
    - `region` union: Query operators for region 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
    - `resourceId` union: Query operators for resourceId 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
    - `cost` union: Query operators for cost field of type Decimal. Supported operators: EqualTo, NotEqual, IsNull, NotNull, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual, InBetween.
      - number
      - object
        - `_type` 'NotEqual', required
        - `value` number, required
      - object
        - `_type` 'IsNull', required
      - object
        - `_type` 'NotNull', required
      - object
        - `_type` 'GreaterThan', required
        - `value` number, required
      - object
        - `_type` 'GreaterThanOrEqual', required
        - `value` number, required
      - object
        - `_type` 'LessThan', required
        - `value` number, required
      - object
        - `_type` 'LessThanOrEqual', required
        - `value` number, required
      - object
        - `_type` 'InBetween', required
        - `startValue` number, required
        - `endValue` number, required
    - `currency` union: Query operators for currency 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
    - `readAt` union: Query operators for readAt 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
    - `_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)
