> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/xsiam-api/aspm-cicd-and-application-security/cloud-coverage.md).

# Cloud Coverage

API for retrieving code-to-cloud coverage ratio for the requested view.

## Get Code-to-Cloud Coverage Ratio

> Returns the Code-to-Cloud coverage ratio, which measures the percentage of your assets that have a traceable lineage between code and cloud. This is the same value shown on the Code to Cloud dashboard.\
> \
> Set \`direction\` to choose which way lineage is traced, and \`type\` to choose which kind of asset to trace:\
> \
> \| \`direction\` | Traces |\
> \|---|---|\
> \| \`code\_to\_cloud\` | Repositories → their deployed cloud assets |\
> \| \`cloud\_to\_code\` | Cloud assets → their source repositories |\
> \
> \| \`type\` | Traces |\
> \|---|---|\
> \| \`artifact\` | Repositories → the cloud images built from them |\
> \| \`infrastructure\` | IaC resources → the cloud assets deployed from them |\
> \
> \#### Required license\
> \>\
> \> Cortex XSIAM Premium. In Cortex XSIAM Enterprise and Cortex NG SIEM, requires the Cortex Cloud Posture Management add-on. Not supported in XSIAM Enterprise Plus.

```json
{"openapi":"3.0.0","info":{"title":"ASPM, CICD and Application Security APIs","version":"Cortex XSIAM 3.6"},"tags":[{"name":"Cloud Coverage","description":"API for retrieving code-to-cloud coverage ratio for the requested view."}],"servers":[{"url":"https://api-yourfqdn"}],"security":[],"paths":{"/public_api/appsec/v1/code-to-cloud/coverage":{"get":{"operationId":"GetCoverage","responses":{"200":{"description":"Ok","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoveragePublicApiResponse"}}}}},"description":"Returns the Code-to-Cloud coverage ratio, which measures the percentage of your assets that have a traceable lineage between code and cloud. This is the same value shown on the Code to Cloud dashboard.\n\nSet `direction` to choose which way lineage is traced, and `type` to choose which kind of asset to trace:\n\n| `direction` | Traces |\n|---|---|\n| `code_to_cloud` | Repositories → their deployed cloud assets |\n| `cloud_to_code` | Cloud assets → their source repositories |\n\n| `type` | Traces |\n|---|---|\n| `artifact` | Repositories → the cloud images built from them |\n| `infrastructure` | IaC resources → the cloud assets deployed from them |\n\n#### Required license\n>\n> Cortex XSIAM Premium. In Cortex XSIAM Enterprise and Cortex NG SIEM, requires the Cortex Cloud Posture Management add-on. Not supported in XSIAM Enterprise Plus.","tags":["Cloud Coverage"],"parameters":[{"in":"query","name":"direction","required":true,"schema":{"$ref":"#/components/schemas/CodeToCloudDirection"}},{"in":"query","name":"type","required":true,"schema":{"$ref":"#/components/schemas/CodeToCloudDashboardType"}},{"in":"query","name":"only_onboarded","required":false,"description":"If `true`, only onboarded repositories are included in the calculation. Only applies when direction is `code_to_cloud` and type is `artifact`; ignored otherwise.","schema":{"type":"boolean","default":false}},{"in":"query","name":"application","required":false,"schema":{"type":"string"},"description":"Limit the calculation to a single application, by name."},{"in":"query","name":"provider","required":false,"schema":{"type":"string"},"description":"Limit the calculation to a single provider, by name ."},{"schema":{"type":"string"},"in":"header","name":"Authorization","description":"{api_key}","required":true},{"schema":{"type":"string"},"in":"header","name":"x-xdr-auth-id","description":"{api_key_id}","required":true}],"summary":"Get Code-to-Cloud Coverage Ratio"}}},"components":{"schemas":{"CoveragePublicApiResponse":{"description":"Returns the coverage ratio for the requested `direction` and `type`.","type":"object","additionalProperties":false,"properties":{"coverage":{"type":"number","format":"double","description":"The coverage ratio, as a decimal between `0` and `1`. Multiply by 100 to get the percentage shown on the Code to Cloud dashboard. Returns `0` if there isn't enough data to calculate coverage."}}},"CodeToCloudDirection":{"type":"string","description":"The direction to trace lineage","enum":["code_to_cloud","cloud_to_code"]},"CodeToCloudDashboardType":{"type":"string","description":"The asset type to calculate coverage","enum":["artifact","infrastructure"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/xsiam-api/aspm-cicd-and-application-security/cloud-coverage.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
