canonical: https://jentic.com/apis/googleapis.com/cloudasset

# Google Cloud Asset API

Google Cloud Asset Inventory exposes a unified history and metadata index for resources, IAM policies, and org policies across a Google Cloud organization, folder, or project. Agents can search assets across asset types, export point-in-time snapshots, analyze IAM grants, and subscribe to feeds that emit changes as assets are created, updated, or deleted. The API supports SQL-like asset queries, move analysis between resource containers, and saved queries that can be re-run by agents on a schedule.

## For AI agents

Search, export, and monitor Google Cloud resources, IAM policies, and org policies across an organization. Useful for inventory, compliance, and change-detection workflows on GCP.

## Scope

Does not provision resources, change IAM policies, or stream logs - use for inventory search, IAM analysis, and asset change feeds only.

## Capabilities

- Export point-in-time inventory snapshots of GCP assets to BigQuery or Cloud Storage
- Search resources and IAM policies across an organization, folder, or project
- Analyze IAM policy grants to determine who has access to a given resource
- Subscribe to asset feeds that publish create, update, and delete events to Pub/Sub
- Run SQL-style queries over the asset inventory with the queryAssets endpoint
- Save and re-run inventory queries on a schedule for compliance reporting
- Analyze the impact of moving a project between billing accounts or folders

## Use cases

### Cloud Inventory Export to BigQuery

Operations teams use Cloud Asset Inventory to take a structured snapshot of every resource in a Google Cloud organization and load it into BigQuery for analysis. The exportAssets endpoint writes asset metadata, resource configurations, IAM policies, and org policies as Avro or JSON, where it can be joined against billing data, security findings, or CMDB records. Initial setup runs in minutes; recurring exports can be triggered on any cadence.

Example prompt: Call POST /v1/{parent}:exportAssets with parent=organizations/123456 and contentType=RESOURCE to write a snapshot to a Cloud Storage bucket

### IAM Access Analysis

Security teams use the analyzeIamPolicy operation to answer questions like who can access a given service account or which principals have storage.objects.delete permission. The API walks group memberships and resource-hierarchy inheritance, returning a flattened access map suitable for compliance evidence or least-privilege reviews.

Example prompt: Call analyzeIamPolicy on the organization scope with a query asking which principals have the role roles/owner

### Real-Time Change Detection Feed

Platform teams subscribe asset feeds to Pub/Sub topics so that any create, update, or delete event on a configured asset type fires a notification within seconds. This drives drift detection, automated tagging enforcement, and rollback workflows without polling.

Example prompt: Create a feed via POST /v1/{parent}/feeds that watches assetTypes=storage.googleapis.com/Bucket and publishes to a Pub/Sub topic

### AI Agent Compliance Reviewer via Jentic

An agent invoked by Jentic uses Cloud Asset queries to answer compliance questions on demand: which buckets are public, which service accounts have unused keys, which projects sit outside an approved folder. The agent runs queryAssets, formats the result as evidence, and either escalates to a human or opens a remediation ticket.

Example prompt: Search Jentic for 'list google cloud assets', execute the resulting Cloud Asset query operation with a SQL filter for public buckets, and report violations

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /v1/{+parent}:exportAssets | Export an asset snapshot to BigQuery or Cloud Storage |
| GET | /v1/{+parent}/assets | List assets under a parent scope |
| POST | /v1/{+parent}:queryAssets | Run a SQL-style query against the asset inventory |
| POST | /v1/{+parent}/feeds | Create an asset change feed that publishes to Pub/Sub |
| GET | /v1/{+parent}/savedQueries | List saved asset queries |
| GET | /v1/{+parent}:batchGetAssetsHistory | Retrieve historical state of assets over a time window |
| GET | /v1/{+resource}:analyzeMove | Analyze the impact of moving a resource between parents |

## Key resources

- **Assets** — Individual Google Cloud resources tracked by inventory, including configuration and IAM policy
- **Feeds** — Subscriptions that emit asset change notifications to Pub/Sub
- **SavedQueries** — Reusable asset query definitions that can be executed on demand
- **Operations** — Long-running operations for exports and IAM analysis

## Why Jentic

- **Setup:** Wiring the Cloud Asset API by hand means setting up Google Cloud OAuth or a service account, minting cloud-platform scoped tokens, and driving asset export, IAM analysis, and change-feed calls yourself. Through Jentic you install once, import the Cloud Asset API from the API Directory, store the credential once, and your agent calls it.
- **Permission scoping:** The API puts the project, folder, or organization scope in the URL path (/v1/{+parent}/assets, /v1/{+resource}:analyzeMove), so a rule can pin your agent to one scope: it searches inventory and analyzes IAM there and nowhere else. Limit it to the operations it needs, such as listing assets or querying, and creating change feeds is not included unless you add it.
- **Credential handling:** Your Google Cloud OAuth credentials or service account key are stored once, encrypted, by your own Jentic One instance and injected at execution time. The agent receives only short-lived cloud-platform scoped tokens and the service account JSON never enters its prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'list Google Cloud assets' or 'analyze a GCP IAM policy', and Jentic returns the matching Cloud Asset operation with its parameter schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Cloud Resource Manager API** — Manages the project, folder, and organization hierarchy that Cloud Asset reports on
- **Identity and Access Management (IAM) API** — Reads and writes the IAM policies that Cloud Asset analyses
- **Cloud Logging API** — Captures admin and audit logs that complement asset inventory snapshots

## FAQ

### What authentication does the Cloud Asset API use?

The Cloud Asset API uses OAuth 2.0 with the cloud-platform scope. Tokens are issued for a Google service account or user identity. Through Jentic, the OAuth credential is held in your Jentic One instance and the agent receives a scoped access token only - the underlying service account key never enters agent context.

### Can I export a full GCP inventory snapshot with the Cloud Asset API?

Yes. POST to /v1/{parent}:exportAssets with parent set to your organization, folder, or project, choose contentType (RESOURCE, IAM_POLICY, ORG_POLICY, or ACCESS_POLICY), and supply a Cloud Storage or BigQuery destination. The export runs as a long-running operation and writes one record per asset.

### What are the rate limits for the Cloud Asset API?

Cloud Asset API quotas are published per-method in the Google Cloud console under the Cloud Asset API quota page; typical limits are several hundred queries per minute per project for read operations and lower limits for analyzeIamPolicy. Exports run as long-running operations and are throttled separately.

### How do I detect resource changes in real time with this API through Jentic?

Search Jentic for 'create google cloud asset feed' and execute the resulting operation against POST /v1/{parent}/feeds with the asset types you want to watch and a Pub/Sub topic name. The feed fires a message on every create, update, or delete and the agent can react without polling.

### Does the Cloud Asset API support cross-project IAM analysis?

Yes. analyzeIamPolicy and analyzeIamPolicyLongrunning accept an organization or folder scope, so a single call can return who has a given permission across every project under that node. Use the long-running variant for organization-wide queries that exceed the synchronous timeout.

### Is the Cloud Asset API free?

The Cloud Asset API itself has a free tier for metadata queries; exports to BigQuery or Cloud Storage incur the standard storage and query charges. analyzeIamPolicy calls and SearchAllResources beyond the free tier are billed per request as documented on the Google Cloud pricing page.

### Can I limit what my agent is allowed to do with the Cloud Asset API?

Yes. Because you self-host Jentic One, your own rules decide which Cloud Asset operations and credentials the agent may use. Since this API carries the project, folder, or organization scope in the URL path (for example /v1/{+parent}/assets and /v1/{+resource}:analyzeMove), you can pin the agent to a single scope so it searches inventory and analyzes IAM there and nowhere else. You can also restrict it to just the operations it needs, such as listing assets or running queryAssets, while leaving out actions like creating change feeds unless you explicitly allow them.
