> For the complete documentation index, see [llms.txt](https://documents.blocksurvey.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documents.blocksurvey.io/authentication.md).

# Authentication

BlockSurvey enables your application to secure the authorization to connect with its platform using OAuth 2.0 authentication method. Here's how you can generate an API key:

### Prerequisites

You need to have a BlockSurvey account. If you don't have one, please sign up.

### Steps to Generate an API Key

1. Sign in to your BlockSurvey account.
2. Navigate to `Settings → Organization Settings → Configuration & API Configuration`.
3. Click on `Generate New API Key`.
4. Enter a name for the API Key and click `Save`.Your new API key will be displayed.&#x20;

**Make sure to copy this key and keep it in a safe place. The API Key will only be displayed once and you will need to regenerate it if you lose it.**

### Using the API Key for Authentication

Each API request requires an `Authorization` header with your API key.\
\
**cURL Example**

```bash
curl --request GET \
 --url 'https://api3.blocksurvey.io' \
 --header  'Authorization: Bearer user_api_token'
```

Remember to replace `user_api_token` in the cURL example with the actual API Key when testing or using the API endpoint.<br>
