---
title: "Search Inventory"
method: POST
path: "/api/v2/Inventory/search"
tags: ["Inventory"]
---

# Search Inventory

`POST /api/v2/Inventory/search`

The Inventory API enables you to retrieve information about resources in your cloud integrations, such as virtual machines, S3 buckets, security groups, and more, using the following endpoint:  

 > `POST /api/v2/Inventory/search` 

By default, FortiCNAPP collects resource information once a day. You can view and modify when resource  collection starts using the Compliance Report Schedule [setting](https://docs.fortinet.com/document/forticnapp/latest/administration-guide/807088/general#resource-management-collection-schedule). 

 The time filter allows you to see your resource inventory at a specific point of time. When using the Inventory API, keep in mind that the information returned reflects the inventory when the resource collector last ran within the specified time range. If you use a recent time range that does not encompass the last time inventory collection occurred, the query returns an empty array. In this case, expand the time span to include the last collection time. 

 For details about what cloud resource information is available, see [CLOUD_CONFIGURATION_V View](https://docs.fortinet.com/document/forticnapp/latest/administration-guide/479324/cloud-configuration-v-view). 

 The `rlike` and `not_rlike` operators are useful for filtering results. For example, if the result contains the security group ID `sg-0a1b2c3d4e5f6g7h` in the path `resourceConfig.SecurityGroups.GroupId`, and `SecurityGroups` is an array, you can filter by ID for that pattern as follows:

 > `"filters" : [ {"field":"resourceConfig","expression": "rlike", "value":".*sg-0a1b2c3d4e5f6g7h.*" } ]`   

 Here are additional example `body` payloads: 
 * `{ "timeFilter": { "startTime" : "2022-06-08T00:00:00Z", "endTime": "2022-06-10T12:00:00Z"},` 
 `"csp": "AWS" }` 
 * `{ "timeFilter": { "startTime": "2022-06-08T00:00:00Z", "endTime": "2022-06-10T12:00:00Z"},`
 `"filters" : [ { "field": "resourceConfig.Architecture", "expression": "eq", "value": "x86_64" }, { "field": "resourceRegion", "expression": "eq", "value" : "us-east-2" } ],`  
 `"returns": [ "cloudDetails", "csp", "resourceConfig" , "resourceId", "resourceType" ],`  
 `"csp": "GCP" }`

## Headers

- `Authorization` string, required
- `Content-Type` string, required

## Request body

- Dataset2RequestBodySchema
  - `timeFilter` object — The date/time range during which actions occurred.
    - `startTime` string — Returns only recorded actions that occurred after this timestamp.
    - `endTime` string — Returns only recorded actions that occurred before this timestamp. If empty or missing, the current time is used.
  - `filters` object[] — One or more condition statements you can use to refine the data returned by the request. Only records that satisfy filtering conditions are returned. If there are multiple conditions, a record must satisfy all conditions for a match.
    - `expression` 'eq' | 'ne' | 'in' | 'not_in' | 'like' | 'ilike' | 'not_like' | 'not_ilike' | 'not_rlike' | 'rlike' | 'gt' | 'ge' | 'lt' | 'le' | 'between', required — The comparison operator for the filter condition.
    - `field` string, required — The name of the data field to which the condition applies.
    - `value` string — The value that the condition checks for in the specified field. Use this attribute when specifying a single value.
    - `values` string[] — The values that the condition checks for in the specified field. Use this attribute when specifying multiple values.
  - `returns` string[] — Use this attribute to specify which top-level fields of the response schema you want to receive.
  - `csp` 'AWS' | 'Azure' | 'GCP' — Cloud service provider. You must specify either `csp` or `dataset` in the request.
  - `dataset` 'AwsCompliance' | 'GcpCompliance' — You must specify either `csp` or `dataset` in the request.

## Response `200`

No Error (List of Inventory)

- object
  - `paging` PagingSchema — Details of the response's pagination
    - `rows` number — The number of rows displayed on each page
    - `totalRows` number — The number of rows returned from the query
    - `urls` object — Pagination-related URLs
      - `nextPage` string — The next page's URL
  - `data` InventoryResponseSchema[] — For details about what cloud resource information is available, see [CLOUD_CONFIGURATION_V View](https://docs.fortinet.com/document/forticnapp/latest/administration-guide/479324/cloud-configuration-v-view).
    - `apiKey` string
    - `cloudDetails` object
    - `csp` string
    - `endTime` string
    - `resourceConfig` object
    - `resourceId` string
    - `resourceRegion` string
    - `resourceTags` object
    - `resourceType` string
    - `service` string
    - `startTime` string
    - `status` object
    - `urn` string

## Other responses

- `204` — No Data
- `4XX` — Client Error
- `5XX` — Internal Server Error

---

[API](https://skmtc.net/lacework/apis/forticnapp-api-2-0-documentation.md) · [All operations](https://skmtc.net/lacework/apis/forticnapp-api-2-0-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/lacework/forticnapp-api-2-0-documentation/revisions/7015f76895f2/schema)
