{"type":"api","title":"Export inventory event properties","meta":{"id":"/apps/pubhub/media/000-v7-apis/4ec57f8c141f43990cef5c737bb51240bb169e79/2f938fa1-1229-3649-9bbf-48728f3bdf84","info":{"version":"7.0.117","title":"Cloud Insights Inventory API","description":"**Note:** All Cloud Insights APIs are not available for ThousandEyes for Government instance.\n\nUse the Cloud Insights Inventory API to export inventory events for an account group.\n\nThe export uses server-controlled time-window pagination. When more data remains, use the cursor returned in `_links.next.href` to retrieve the next time window.\n\nExport responses are streamed as `application/hal+json`. If an error occurs after streaming begins, the response status is already committed as `200` and the failure is reported in the body: the response contains the `entities` streamed before the failure and an `error` field. Always treat the presence of `error` as a failed export, regardless of the status code. Errors that occur before streaming begins return `500` with `application/problem+json`.\n\nFor more information about Cloud Insights, see [Cloud Insights](https://docs.thousandeyes.com/product-documentation/cloud-insights).\n"},"security":[{"BearerAuth":[]}],"tags":[{"name":"Cloud Insights Inventory","description":"Export inventory event properties for the authenticated tenant."}],"openapi":"3.0.1","servers":[{"description":"ThousandEyes API production URL","url":"https://api.thousandeyes.com/v7"}],"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"Bearer authentication token"}}},"spec":{"tags":["Cloud Insights Inventory"],"summary":"Export inventory event properties","operationId":"getCloudInsightsInventory","description":"Streams inventory event `entityProperties` for the requested account group. Each response contains entities from one server-selected time window.\n\nFor the initial request, specify `startDate` and optionally `endDate`. The range includes `startDate` and excludes `endDate`, and both values must be ISO 8601 with an offset; `Z` (UTC) is recommended. If `endDate` is omitted, it defaults to the current UTC time truncated to whole seconds. If more data remains, follow `_links.next.href` or pass the opaque `cursor` value from that URL to retrieve the next time window.\n\nEach entity is the stored `entityProperties` JSON for one inventory event; this operation does not return the other inventory event columns. The examples below show an abbreviated subset of fields for readability.\n\nDo not specify `cursor` together with `startDate` or `endDate`. The server controls the page size; this operation does not support the `max` parameter.\n","parameters":[{"name":"aid","in":"query","description":"A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.","required":false,"schema":{"type":"string","example":"1234"},"$$ref":"#/components/parameters/AccountGroupId"},{"name":"startDate","in":"query","description":"Start of the time range, in ISO 8601 with an offset; `Z` (UTC) is recommended.\nRequired for the initial request when `cursor` is not specified.\nThe range includes `startDate` and excludes `endDate`. Do not pass with `cursor`.\nSpecify whole seconds. A zero fractional part such as `.000` is accepted; any non-zero\nfractional seconds are rejected with `400`.\n","schema":{"type":"string","format":"date-time","pattern":"^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(\\.0+)?([Zz]|[+-]\\d{2}:\\d{2})$","example":"2022-07-17T22:00:54Z"},"$$ref":"#/components/parameters/StartDate"},{"name":"endDate","in":"query","description":"End of the time range, in ISO 8601 with an offset; `Z` (UTC) is recommended.\nOptional for the initial request; defaults to the current UTC time\ntruncated to whole seconds when omitted. The range includes `startDate` and excludes `endDate`.\nDo not pass with `cursor`.\nSpecify whole seconds. A zero fractional part such as `.000` is accepted; any non-zero\nfractional seconds are rejected with `400`.\n","schema":{"type":"string","format":"date-time","pattern":"^\\d{4}-\\d{2}-\\d{2}[Tt]\\d{2}:\\d{2}:\\d{2}(\\.0+)?([Zz]|[+-]\\d{2}:\\d{2})$","example":"2022-07-18T22:00:54Z"},"$$ref":"#/components/parameters/EndDate"},{"name":"cursor","in":"query","description":"Opaque cursor for the next time window. Pass the value from `_links.next.href` on continuation requests.\nDo not pass together with `startDate` or `endDate`.\n","schema":{"type":"string"},"$$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"Inventory event properties for the current time window. Successful responses include HAL `_links`.\nIf an error occurs after response streaming begins, the status remains `200` because the response is already committed. The response contains any `entities` written before the failure and an `error` field, and `_links` is omitted.\n","content":{"application/hal+json":{"schema":{"oneOf":[{"type":"object","required":["entities","_links"],"description":"Inventory event properties for one server-selected time window. `_links.next.href` contains a fully resolved URL when more data remains. Continuation pages include `_links.self.href`.","properties":{"entities":{"x-paginated-items":true,"type":"array","description":"Inventory event entity properties for the current time window.","items":{"type":"object","additionalProperties":true,"required":["itemId"],"description":"Inventory event `entityProperties`. Common fields are documented below; additional provider- and entity-type-specific fields can also be returned. Documented field names and types are stable.\n","properties":{"accountId":{"type":"string","description":"Cloud account identifier.","example":"895358636272"},"itemType":{"type":"string","description":"Type of cloud entity.","example":"EC2"},"itemId":{"type":"string","description":"Primary entity identifier. Always present. For AWS entities this is the provider resource identifier\n(for example, an EC2 instance ID). For Azure and GCP entities, this matches the `id` field when both\nare returned.\n","example":"i-0abc123"},"id":{"type":"string","description":"Entity identifier used by Azure and GCP providers. May appear alongside `itemId` for those providers.\nFor AWS entities, rely on `itemId` instead.\n","example":"i-0abc123"},"diffStatus":{"type":"string","description":"Change status of the inventory event.","enum":["ADDED","UPDATED","STATE_UPDATED","STATUS_UPDATED","MINOR_UPDATED","SCALE_UPDATED","REMOVED","SNAPSHOT"],"example":"ADDED"},"provider":{"type":"string","description":"Cloud provider associated with the entity.","enum":["AWS","AZR","PAN","GCP","INFOBLOX","SNMP"],"example":"AWS"},"tenantId":{"type":"string","description":"Cloud Insights tenant identifier for the authenticated account group. Matches the `aid` query parameter value. Retrieve `aid` from the `/account-groups` endpoint.\n","example":"107878"},"awsRegion":{"type":"string","description":"AWS region, when applicable.","example":"us-east-1"},"azrRegion":{"type":"string","description":"Azure region, when applicable. The field name `azrRegion` matches the persisted export format and is\nparallel to `awsRegion` and `gcpRegion`.\n","example":"eastus"},"gcpRegion":{"type":"string","description":"GCP region, when applicable.","example":"us-central1"},"time":{"type":"string","description":"Inventory event time as Unix epoch milliseconds, represented as a string.","example":"1705315200123"},"createdTime":{"type":"string","description":"Entity creation time as Unix epoch milliseconds, represented as a string.","example":"1705315200123"},"lastUpdatedTime":{"type":"string","description":"Entity last update time as Unix epoch milliseconds, represented as a string.","example":"1705315200123"}},"$$ref":"#/components/schemas/InventoryEventEntity"}},"_links":{"type":"object","description":"A links object containing pagination related link(s).","properties":{"previous":{"type":"object","description":"A hyperlink from the containing resource to a URI.","required":["href"],"properties":{"href":{"type":"string","description":"Its value is either a URI [RFC3986] or a URI template [RFC6570].","example":"https://api.thousandeyes.com/v7/link/to/resource/id"},"templated":{"type":"boolean","description":"Should be true when the link object's \"href\" property is a URI template."},"type":{"type":"string","description":"Used as a hint to indicate the media type expected when dereferencing the target resource."},"deprecation":{"type":"string","description":"Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation."},"name":{"type":"string","description":"Its value may be used as a secondary key for selecting link objects that share the same relation type."},"profile":{"type":"string","description":"A URI that hints about the profile of the target resource."},"title":{"type":"string","description":"Intended for labelling the link with a human-readable identifier"},"hreflang":{"type":"string","description":"Indicates the language of the target resource"}},"$$ref":"#/components/schemas/Link"},"next":{"type":"object","description":"A hyperlink from the containing resource to a URI.","required":["href"],"properties":{"href":{"type":"string","description":"Its value is either a URI [RFC3986] or a URI template [RFC6570].","example":"https://api.thousandeyes.com/v7/link/to/resource/id"},"templated":{"type":"boolean","description":"Should be true when the link object's \"href\" property is a URI template."},"type":{"type":"string","description":"Used as a hint to indicate the media type expected when dereferencing the target resource."},"deprecation":{"type":"string","description":"Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation."},"name":{"type":"string","description":"Its value may be used as a secondary key for selecting link objects that share the same relation type."},"profile":{"type":"string","description":"A URI that hints about the profile of the target resource."},"title":{"type":"string","description":"Intended for labelling the link with a human-readable identifier"},"hreflang":{"type":"string","description":"Indicates the language of the target resource"}},"$$ref":"#/components/schemas/Link"},"self":{"type":"object","description":"A hyperlink from the containing resource to a URI.","required":["href"],"properties":{"href":{"type":"string","description":"Its value is either a URI [RFC3986] or a URI template [RFC6570].","example":"https://api.thousandeyes.com/v7/link/to/resource/id"},"templated":{"type":"boolean","description":"Should be true when the link object's \"href\" property is a URI template."},"type":{"type":"string","description":"Used as a hint to indicate the media type expected when dereferencing the target resource."},"deprecation":{"type":"string","description":"Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation."},"name":{"type":"string","description":"Its value may be used as a secondary key for selecting link objects that share the same relation type."},"profile":{"type":"string","description":"A URI that hints about the profile of the target resource."},"title":{"type":"string","description":"Intended for labelling the link with a human-readable identifier"},"hreflang":{"type":"string","description":"Indicates the language of the target resource"}},"$$ref":"#/components/schemas/Link"}},"$$ref":"#/components/schemas/PaginationLinks"}},"$$ref":"#/components/schemas/InventoryEventPropertiesPage"},{"type":"object","additionalProperties":false,"required":["entities","error"],"description":"Partial export response returned with status `200` when an error occurs after response streaming begins. Contains the inventory event properties written before the failure and an `error` field. `_links` is omitted. Treat the presence of `error` as a failed export.\n","properties":{"entities":{"type":"array","description":"Inventory event entity properties streamed before the failure.","items":{"type":"object","additionalProperties":true,"required":["itemId"],"description":"Inventory event `entityProperties`. Common fields are documented below; additional provider- and entity-type-specific fields can also be returned. Documented field names and types are stable.\n","properties":{"accountId":{"type":"string","description":"Cloud account identifier.","example":"895358636272"},"itemType":{"type":"string","description":"Type of cloud entity.","example":"EC2"},"itemId":{"type":"string","description":"Primary entity identifier. Always present. For AWS entities this is the provider resource identifier\n(for example, an EC2 instance ID). For Azure and GCP entities, this matches the `id` field when both\nare returned.\n","example":"i-0abc123"},"id":{"type":"string","description":"Entity identifier used by Azure and GCP providers. May appear alongside `itemId` for those providers.\nFor AWS entities, rely on `itemId` instead.\n","example":"i-0abc123"},"diffStatus":{"type":"string","description":"Change status of the inventory event.","enum":["ADDED","UPDATED","STATE_UPDATED","STATUS_UPDATED","MINOR_UPDATED","SCALE_UPDATED","REMOVED","SNAPSHOT"],"example":"ADDED"},"provider":{"type":"string","description":"Cloud provider associated with the entity.","enum":["AWS","AZR","PAN","GCP","INFOBLOX","SNMP"],"example":"AWS"},"tenantId":{"type":"string","description":"Cloud Insights tenant identifier for the authenticated account group. Matches the `aid` query parameter value. Retrieve `aid` from the `/account-groups` endpoint.\n","example":"107878"},"awsRegion":{"type":"string","description":"AWS region, when applicable.","example":"us-east-1"},"azrRegion":{"type":"string","description":"Azure region, when applicable. The field name `azrRegion` matches the persisted export format and is\nparallel to `awsRegion` and `gcpRegion`.\n","example":"eastus"},"gcpRegion":{"type":"string","description":"GCP region, when applicable.","example":"us-central1"},"time":{"type":"string","description":"Inventory event time as Unix epoch milliseconds, represented as a string.","example":"1705315200123"},"createdTime":{"type":"string","description":"Entity creation time as Unix epoch milliseconds, represented as a string.","example":"1705315200123"},"lastUpdatedTime":{"type":"string","description":"Entity last update time as Unix epoch milliseconds, represented as a string.","example":"1705315200123"}},"$$ref":"#/components/schemas/InventoryEventEntity"}},"error":{"type":"string","description":"Error message describing why streaming stopped.","example":"Failed while streaming inventory event properties"}},"$$ref":"#/components/schemas/InventoryEventPropertiesPartialFailure"}]},"examples":{"firstPage":{"summary":"First page with more data available","value":{"entities":[{"accountId":"895358636272","itemType":"EC2","itemId":"i-0abc123","diffStatus":"ADDED","awsRegion":"us-east-1"}],"_links":{"next":{"href":"https://api.thousandeyes.com/v7/cloud-insights/inventory?cursor=eyJhbGciOiJIUzI1NiJ9.example"}}}},"continuationPage":{"summary":"Continuation page","value":{"entities":[{"accountId":"40516be1-2840-44df-9333-c39247d77429","itemType":"VM","itemId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/prod/providers/Microsoft.Compute/virtualMachines/vm-1","diffStatus":"UPDATED","azrRegion":"eastus"}],"_links":{"self":{"href":"https://api.thousandeyes.com/v7/cloud-insights/inventory?cursor=eyJhbGciOiJIUzI1NiJ9.example"},"next":{"href":"https://api.thousandeyes.com/v7/cloud-insights/inventory?cursor=eyJhbGciOiJIUzI1NiJ9.example-next"}}}},"lastPage":{"summary":"Last page","value":{"entities":[{"accountId":"my-gcp-project","itemType":"GCE_INSTANCE","itemId":"instance-1","diffStatus":"REMOVED","gcpRegion":"us-central1"}],"_links":{"self":{"href":"https://api.thousandeyes.com/v7/cloud-insights/inventory?cursor=eyJhbGciOiJIUzI1NiJ9.example-last"}}}}}}}},"400":{"description":"Bad request. Returned for invalid query parameters, when `startDate` is omitted\nwithout a `cursor`, when `startDate` is greater than or equal to `endDate`, or\nwhen `cursor` is combined with `startDate` or `endDate`.\n","content":{"application/problem+json":{"schema":{"type":"object","allOf":[{"type":"object","properties":{"type":{"type":"string","description":"A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\"."},"title":{"type":"string","description":"A short, human-readable summary of the problem type."},"status":{"type":"integer","description":"The HTTP status code generated by the origin server for this occurrence of the problem."},"detail":{"type":"string","description":"A human-readable explanation specific to this occurrence of the problem."},"instance":{"type":"string","description":"A URI reference that identifies the specific occurrence of the problem."}},"$$ref":"#/components/schemas/Error"},{"type":"object","properties":{"errors":{"nullable":true,"type":"array","description":"(Optional) When multiple errors occur, the details for each error are listed.","items":{"type":"object","properties":{"code":{"type":"string","description":"(Optional) A unique error type/code that can be referenced in the documentation for further details."},"field":{"type":"string","description":"Identifies the field that triggered this particular error."},"message":{"type":"string","description":"A short, human-readable summary of the error."}},"$$ref":"#/components/schemas/ValidationErrorItem"}}}}],"$$ref":"#/components/schemas/ValidationError"}}}},"401":{"description":"Unauthorized","content":{"application/problem+json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"invalid_token"},"error_description":{"type":"string","example":"Invalid access token"}},"$$ref":"#/components/schemas/UnauthorizedError"}}},"$$ref":"#/components/responses/401"},"403":{"description":"Insufficient permissions to query endpoint","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\"."},"title":{"type":"string","description":"A short, human-readable summary of the problem type."},"status":{"type":"integer","description":"The HTTP status code generated by the origin server for this occurrence of the problem."},"detail":{"type":"string","description":"A human-readable explanation specific to this occurrence of the problem."},"instance":{"type":"string","description":"A URI reference that identifies the specific occurrence of the problem."}},"$$ref":"#/components/schemas/Error"}}},"$$ref":"#/components/responses/403"},"429":{"description":"Exhausted rate limit for the organization","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\"."},"title":{"type":"string","description":"A short, human-readable summary of the problem type."},"status":{"type":"integer","description":"The HTTP status code generated by the origin server for this occurrence of the problem."},"detail":{"type":"string","description":"A human-readable explanation specific to this occurrence of the problem."},"instance":{"type":"string","description":"A URI reference that identifies the specific occurrence of the problem."}},"$$ref":"#/components/schemas/Error"}}},"$$ref":"#/components/responses/429"},"500":{"description":"Internal server error that occurs before response streaming begins.","content":{"application/problem+json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\"."},"title":{"type":"string","description":"A short, human-readable summary of the problem type."},"status":{"type":"integer","description":"The HTTP status code generated by the origin server for this occurrence of the problem."},"detail":{"type":"string","description":"A human-readable explanation specific to this occurrence of the problem."},"instance":{"type":"string","description":"A URI reference that identifies the specific occurrence of the problem."}},"$$ref":"#/components/schemas/Error"}}}}},"__originalOperationId":"getCloudInsightsInventory","security":[{"BearerAuth":[]}],"method":"get","path":"/cloud-insights/inventory"}}