> ## Documentation Index
> Fetch the complete documentation index at: https://chainpatrol.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Your API Key

> Create and use ChainPatrol API keys — including organization vs. user and test vs. live keys — to authenticate requests to our threat detection APIs.

## Getting Your API Key

To access ChainPatrol's APIs and services, you'll need an API key. Here's how to get one:

1. Go to your [Organization Dashboard](https://app.chainpatrol.io/admin)
2. In the sidebar, open **Developer › API Keys**
3. Click **Create Key**, pick your settings, and click **Create**
4. Copy the key from the confirmation dialog. It is shown only once

Only organization owners and admins can create API keys.

> [!WARNING]
>
> New keys are **Read only** by default. To submit reports or make any other change through
> the API, select **Read & write** when you create the key. See
> [Key Permissions](#key-permissions).

## Types of API Keys

### Key Permissions

* **Read only** (default): Can query and export data, but cannot submit reports or make
  other changes
* **Read & write**: Full API access, including submitting reports and making changes

A read-only key gets `403 Forbidden` from any endpoint that changes data, such as
[Create Report](https://chainpatrol.com/docs/external-api/report-create.md). A key's permission can't be changed after
it is created, so create a new **Read & write** key and revoke the old one. Integration
organizations can only create read-only keys; email
[support@chainpatrol.io](mailto:support@chainpatrol.io) if yours needs write access.

### Organization vs User Keys

* **Organization Keys**: Grant organization-level attribution

  * Reports submitted with organization keys are attributed to a machine user
  * Best for automated systems, integrations, and organization-level workflows
  * Ideal for bots, automated reporting systems, and CI/CD pipelines

* **User Keys**: Grant user-level attribution
  * Reports submitted with user keys are attributed directly to your user account
  * Best for personal use and when individual accountability is needed
  * Ideal for manual reporting and personal tooling

### Test vs Live Keys

ChainPatrol provides both test and live environments to help you develop and test your integration safely.

* **Test Keys**: For distinguishing when being used in development and testing

  * Use in development environments
  * **These keys still affect production data**

* **Live Keys**: For production use
  * Use in production environments
  * Affects real data and reports
  * Required for actual threat detection and reporting

## API Key Format

ChainPatrol API keys follow this format:

* Always start with the prefix `cp_`
* Are unique to your organization
* Should be kept secure and not shared publicly

## Using Your API Key

When making API requests to ChainPatrol, include your API key in the request headers:

```typescript theme={null}
const response = await fetch("https://app.chainpatrol.io/api/v2/asset/check", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-API-KEY": "YOUR_API_KEY",
  },
  body: JSON.stringify({
    type: "URL",
    content: "example.com",
  }),
});
```

## Support

If you need help with your API key or have any questions, you can:

* Email us at [engineering@chainpatrol.io](mailto:engineering@chainpatrol.io)
* Visit our [documentation](https://chainpatrol.com/docs/external-api/overview.md) for more information about our APIs


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.