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

# Authentication

> Authenticate Datamagnet API requests with bearer tokens. Learn how to generate API keys, attach them to requests, and rotate credentials safely.

# Authentication

You need to authenticate your requests to access any of the endpoints in the Datamagnet API. This guide explains how authentication works. Datamagnet uses bearer tokens to authenticate your API requests.

## Authentication with bearer token

The recommended way to authenticate with the Datamagnet API is by using OAuth2. When you establish a connection using OAuth2, you need your access token — you can find it in the [Datamagnet dashboard → API Keys](https://datamagnet.co/app/api-keys). Here's how to add the token to the request header using cURL:

```bash Example request with bearer token theme={null}
curl https://api.datamagnet.co/api/v1/person \
  -H "Authorization: Bearer {token}"
```

Always keep your token safe and reset it if you suspect it has been compromised.


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