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

# API Introduction

> Create programmatic interactions with the Phare API.

This API lets you interact programmatically with the Phare platform, enabling integration and automation for most tasks available in the control panel.

## Create an API key

<Info>
  Only team members with the **Owner** or **Admin** role can create an API key in your organization.
</Info>

To access the Phare API, create an API key with the right access. This can be done in the
<a href="https://app.phare.io/organization/api-keys" rel="nofollow">control panel</a>.

## Choosing the right scope

<Frame>
  <div style={{ position: 'relative', width: '100%', paddingTop: '56.25%' }}>
    <iframe src="https://iframe.mediadelivery.net/embed/238508/0ec7b14b-4512-4fc5-b74e-b42f8152c596?autoplay=false&loop=true&muted=true&preload=true&responsive=true" loading="lazy" allow="accelerometer;gyroscope;autoplay;encrypted-media;picture-in-picture;fullscreen" style={{ border: 0, position: 'absolute', top: 0, height: '100%', width: '100%' }} />
  </div>
</Frame>

### Project-scoped API keys

Project-scoped API keys are limited to a single project and are designed for setups where projects must remain clearly separated. They work best for agencies and larger organizations, where each project is owned by a different team.

* Access is restricted to one specific project
* Cannot create or manage other projects
* No additional project headers are required when making API requests

### Organization-scoped API keys

Organization-scoped API keys provide access across all projects in an organization and allow full project management. They are well suited for small teams, startups, and infrastructure provisioning.

* Access to all projects in the organization
* Can create and manage projects
* Requires a [project selection header](#project-selection) on most requests

### Product scopes

Product scopes lets you restrict which parts of the Phare platform an API key can access. This helps apply the principle of least privilege and limits what a key can do if it is misused.

Each API key can be configured per product with one of the following access levels:

* **No access**
* **Read-only**
* **Read-write**

<Info>You can create as many keys as necessary to fit your use case.</Info>

## Authentication

The Phare API uses Bearer Token Authentication to secure access to its endpoints. To authenticate your requests, include the API key in the Authorization header of your HTTP requests:

```bash theme={null}
Authorization: Bearer YOUR_API_KEY
```

## Project selection

If you're using an organization-scoped API key, every endpoint except `/projects` most endpoints will require you to add an HTTP header to specify which project to operate on. You can specify the project by its `ID` or `Slug`:

* **X-Phare-Project-Id**: The project's numeric ID
* **X-Phare-Project-Slug**: The project's slug

Example using the project slug:

```bash theme={null}
curl \
  -X GET "https://api.phare.io/uptime/monitors" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Phare-Project-Slug: luminous-guiding-tower"
```

Example using the project ID:

```bash theme={null}
curl \
  -X GET "https://api.phare.io/uptime/monitors" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "X-Phare-Project-Id: 123"
```

Project-scoped API keys always act on their scoped project and do not require a project selection header.

## Rate limiting

Access to the API is currently rate limited to **100 calls per minute** across the organization. All API keys share the same limit.

## Security

Never share your API key publicly. If you suspect that your API key has been compromised, revoke it immediately through your control panel and generate a new one.

***

If an API endpoint is missing or a custom rate limit is needed, [contact support](mailto:support@phare.io). Phare can help find a solution that fits the use case.
