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

# Authentication

> Authenticate your Management API requests with a personal access token or an OAuth2 access token.

The Management API lets you manage your Meilisearch Cloud resources programmatically. It is served at `https://api.meilisearch.com`. Request and response fields are in camelCase.

> [!NOTE]
>
> You cannot create a personal access token or get OAuth2 credentials yourself yet. In both cases, contact [support@meilisearch.com](mailto:support@meilisearch.com).

Every request must send a token in the `Authorization` header:

```
Authorization: Bearer <token>
```

The token is a personal access token or an OAuth2 access token. A missing token returns a `401` error with the [`missing_authorization_header`](https://www.meilisearch.com/docs/reference/management-api-errors#missing_authorization_header) code. An invalid, expired, or revoked token returns a `401` error with the [`invalid_token`](https://www.meilisearch.com/docs/reference/management-api-errors#invalid_token) code.

## Personal access token

A personal access token (PAT) authenticates as the user who owns it.

> [!WARNING]
>
> A personal access token grants access to your Meilisearch Cloud account. Keep it secret and never expose it in client-side code.

## OAuth2

Partner applications acting on behalf of a Meilisearch Cloud user use the OAuth2 authorization code flow with PKCE:

| Endpoint | URL |
| :- | :- |
| Authorization URL | `https://cloud.meilisearch.com/oauth/authorize` |
| Token URL | `https://api.meilisearch.com/oauth/token` |
| Refresh URL | `https://api.meilisearch.com/oauth/token` |

Send the user to the authorization URL in their browser. The access token is limited by its scopes:

| Scope | Access |
| :- | :- |
| **`read`** | GET requests |
| **`write`** | Requests with every other HTTP method |

A request with a method the token's scopes do not allow returns a `403` error with the [`forbidden`](https://www.meilisearch.com/docs/reference/management-api-errors#forbidden) code.


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