# Findings ## Data security findings summary `client.analyticsQuery.dataSecurity.findings.summary(FindingSummaryParamsparams, RequestOptionsoptions?): FindingSummaryResponse` **post** `/accounts/{account_id}/analytics/query/data-security/findings/summary` Returns aggregate current-period and previous-period totals for CASB findings. ### Parameters - `params: FindingSummaryParams` - `account_id: string` Path param: Cloudflare account identifier. - `filters: Array` Body param: Filters to apply. - `name: string` Specifies the column name to filter on. Requires a valid column for the target dataset (e.g. `country`, `allowed`, `appId`). - `op: string` Filter operator. Common values: `eq`, `neq`, `in`, `not_in`, `gt`, `lt`, `gte`, `lte`. - `values: Array` Values to match against. Type depends on the column. - `string` - `boolean` - `number` - `from: string` Body param: Start of the query time range (inclusive). RFC3339. - `to: string` Body param: End of the query time range (exclusive). RFC3339. ### Returns - `FindingSummaryResponse` - `currentTotal: Array>` Aggregated stats for the requested time range. - `previousTotal: Array>` Aggregated stats for the equivalent preceding time range, for trend comparison. ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.analyticsQuery.dataSecurity.findings.summary({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', filters: [], from: '2024-11-01T00:00:00Z', to: '2024-11-08T00:00:00Z', }); console.log(response.currentTotal); ``` #### Response ```json { "errors": [], "messages": [ { "code": 1000, "message": "API in beta: expect breaking changes." } ], "result": { "currentTotal": [ { "findingProduct": "Cloud", "findingType": "Content", "findingsTotal": 48291 }, { "findingProduct": "SaaS", "findingType": "Posture", "findingsTotal": 1205 } ], "previousTotal": [ { "findingProduct": "Cloud", "findingType": "Content", "findingsTotal": 41033 }, { "findingProduct": "SaaS", "findingType": "Posture", "findingsTotal": 982 } ] }, "success": true } ``` ## Data security findings timeseries `client.analyticsQuery.dataSecurity.findings.timeseries(FindingTimeseriesParamsparams, RequestOptionsoptions?): FindingTimeseriesResponse` **post** `/accounts/{account_id}/analytics/query/data-security/findings/timeseries` Returns merged time-bucketed CASB findings. ### Parameters - `params: FindingTimeseriesParams` - `account_id: string` Path param: Cloudflare account identifier. - `filters: Array` Body param: Filters to apply. - `name: string` Specifies the column name to filter on. Requires a valid column for the target dataset (e.g. `country`, `allowed`, `appId`). - `op: string` Filter operator. Common values: `eq`, `neq`, `in`, `not_in`, `gt`, `lt`, `gte`, `lte`. - `values: Array` Values to match against. Type depends on the column. - `string` - `boolean` - `number` - `from: string` Body param: Start of the query time range (inclusive). RFC3339. - `to: string` Body param: End of the query time range (exclusive). RFC3339. ### Returns - `FindingTimeseriesResponse` Merged CASB and CDE findings timeseries result. - `slots: Array>` Contains time-bucketed result rows. Each slot includes a `timestamp` plus `content` and `posture` maps with `cloud` and `saas` keys. - `resolution?: string | null` Always null for this endpoint. ### Example ```typescript import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const response = await client.analyticsQuery.dataSecurity.findings.timeseries({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', filters: [], from: '2024-11-01T00:00:00Z', to: '2024-11-08T00:00:00Z', }); console.log(response.slots); ``` #### Response ```json { "errors": [], "messages": [ { "code": 1000, "message": "API in beta: expect breaking changes." } ], "result": { "slots": [ { "content": { "cloud": 150, "saas": 23 }, "posture": { "cloud": 0, "saas": 5 }, "timestamp": "2024-11-05T00:00:00Z" }, { "content": { "cloud": 180, "saas": 30 }, "posture": { "cloud": 0, "saas": 7 }, "timestamp": "2024-11-06T00:00:00Z" } ] }, "success": true } ``` ## Domain Types ### Finding Summary Response - `FindingSummaryResponse` - `currentTotal: Array>` Aggregated stats for the requested time range. - `previousTotal: Array>` Aggregated stats for the equivalent preceding time range, for trend comparison. ### Finding Timeseries Response - `FindingTimeseriesResponse` Merged CASB and CDE findings timeseries result. - `slots: Array>` Contains time-bucketed result rows. Each slot includes a `timestamp` plus `content` and `posture` maps with `cloud` and `saas` keys. - `resolution?: string | null` Always null for this endpoint.