# API Scan from CloudDefense UI

{% embed url="<https://youtu.be/AMYMaCTUzdc>" %}

### Step 1: Access to API application

Login to your CloudDefense Instance and click on “Scan” then “Other”. After this select “API”\
\ <br>

<figure><img src="https://lh3.googleusercontent.com/9fmHE141reijUEqChiaPfVqYZO7ontCePjP2jnNsXmV4KWIvhxeFmxtqOaV3sTyR45gdTb3-FiNXxoY_kpRkc6ltym0ixkXFyt4Lp-eqGXNvU2Qz0RSCp4rrbQG0PZIklfSHwhj9Kw6LDCFmzo4XiL16PssFy4-TojCyTIDxhyU06zrS5J1t2ieRyw" alt=""><figcaption><p><br></p></figcaption></figure>

<figure><img src="https://lh6.googleusercontent.com/GQ25WtEtuQdHV6EziO-FZvq2_MqWkXh-iIWv6I3AS55FuBIRGIAMOP15bihJGY4ztovxjHYxLM_a4J4KYSvhx402EsqZVYUZRM10IxlA54Ks7_RIxfGWA9zD6ibLX4JpnuSVNwDirb3Sdv-WQs2v07FpKS0OyQ2VGzRWR09gwMkchAeaqsRSvFlhWw" alt=""><figcaption></figcaption></figure>

### Step 2: Provide Swagger Details

<figure><img src="https://lh4.googleusercontent.com/6FkniAdC9N807-RqxhRKQJaUdpkS7y9r63gYXA9qvd9njDawbvLsW4J2Kf6yywNwe7O3gPzmMwYbszEq1lxxjSPYen6VePGm02gafr16DaFUy1qIfh_7llW1MZtg34sotSufaZIUJBm87skXUEGVJhnA-Fhw1tD8G_HafQnmUVqHy5ajjJXiHBylLg" alt=""><figcaption></figcaption></figure>

We’ll use `https://petstore.swagger.io/v2/swagger.json` for testing here (Remember we need json as output not any html website, there is difference between swagger viewer and swagger json)

In App URL you need to provide (Base URL) example - `https://petstore.swagger.io/` In JSON Path provide full URL of JSON - `https://petstore.swagger.io/v2/swagger.json`

### Step 3: Scan your API Key

Then click on “Run Scan” and your scan should start. API Scan from CloudDefense CLI guidelines are given below:

**a)** Install cdefense CLI in your Device using these steps - `https://github.com/CloudDefenseAI/cd#installation`&#x20;

**b)** Now run below command to run DAST Scan from CLI

`cdefense api --api-key=<CLOUDDEFENSE_API_KEY> --url=https://petstore.swagger.io/ --openapi-jsonurl=https://petstore.swagger.io/v2/swagger.json --project-name=example-api-scan --verbose`\
\
\
\
\
\ <br>


---

# Agent Instructions: 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:

```
GET https://docs.clouddefenseai.com/scans/api-scan-from-clouddefense-ui.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
