> 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/xdr-5-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 XDR with the Cortex Cloud Posture Management or Cortex Cloud Runtime Security with Application Security Add-on.

```json
{"openapi":"3.0.0","info":{"title":"ASPM, CICD and Application Security APIs","version":"Cortex XDR 5.2"},"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 XDR with the Cortex Cloud Posture Management or Cortex Cloud Runtime Security with Application Security Add-on.","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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
