> For the complete documentation index, see [llms.txt](https://docs.prismacloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.prismacloud.io/content-collections/get-started/access-keys.md).

# Prisma Cloud API Access Keys

Prisma Cloud has a REST API that enables you to access Prisma Cloud features programmatically. Most actions supported on the Prisma Cloud web interface are available with the REST API, refer to the [Prisma Cloud REST API Reference](https://pan.dev/prisma-cloud/api/cspm/) for details about the REST API.

Prisma Cloud requires an API access key to enable programmatic access to the REST API. By default, only the System Admin has API access and can enable API access for other administrators. To generate an access key, see **update xref Create and Manage Access Keys**. After you obtain an access key, you can submit it in a REST API request to generate a JSON Web Token (JWT). The JWT is then used to authorize all subsequent REST API requests on Prisma Cloud.

1. Authenticate to obtain a JWT.

   The following is an example of a userinput:\[curl] call for a REST API request that returns a JWT. Your Prisma Cloud access key provides the request parameters. Note that an access key is made up of two parts: an Access Key ID and a Secret Key. In the body parameters, specify your Access Key ID as the string value for the userinput:\[userName] and your Secret Key as the string value for the userinput:\[password] . Note that you must use the [API URL](https://pan.dev/prisma-cloud/api/cspm/api-urls/) for your tenant. This example uses <https://api.prismacloud.io>.

   ```
   curl --request POST \
     'https://api.prismacloud.io/login' \
     -H 'Content-Type: application/json' \
     --data '{"username":"<Access Key ID>","password":"<Secret Key>"}'
   ```

   The following shows the response for a successful request.

   ```
   {
     "token": "<JWT>",
     "message": "login_successful",
     "customerNames": [
       {
       "customerName": "Test",
       "tosAccepted": true,
       "prismaId": "123456789999999999"
       }
     ]
   }
   ```

   The value for userinput:\[token] in the response is the JWT you will use to authorize your subsequent REST API requests.
2. Authorize Using the JWT.

   Specify the JWT in an HTTP header parameter for every Prisma Cloud REST API request. Review the details of the header parameter key and the corresponding value below.

   * x-redlock-auth: \<your JWT>
3. Refresh the JWT.

   The JWT is valid for 10 minutes, so you must refresh the token for continued access to the Prisma Cloud API. If you make an API request with an expired JWT request, you will receive an HTTP 401 (Unauthorized) response. The following example is a curl call that makes an API request to obtain a refreshed JWT.

   ```
   curl --request GET \
   'https://api.prismacloud.io/auth_token/extend' \
   -H 'Content-Type: application/json' \
   -H 'x-redlock-auth:<current JWT>'
   ```

   The following is an example of the response to a successful request to refresh a JWT.

   ```
   {
     "token": "<JWT>",
     "message": "login_successful",
     "customerNames": [
       {
         "customerName": "Test",
         "tosAccepted": true,
         "prismaId": "123456789999999999"
       }
     ]
   }
   ```

   The value for userinput:\[token] in the response is the new JWT you must specify in the HTTP header parameter of subsequent REST API requests.


---

# 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://docs.prismacloud.io/content-collections/get-started/access-keys.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.
