# Authentication API

This page shows the process for creating an access token.

1. When onboarding with Alluvial, you will receive API credentials. These include a client\_id and client\_secret.
2. After receiving your credentials use the curl request below, updating the client\_id and client\_secret with your specific credentials.

## Staging

```bash
curl -X 'POST' \
  'https://auth.staging.alluvial.finance/oauth/token' \
  -H 'content-type: application/json' \
  -d '{
    "audience": "https://api.staging.alluvial.finance",
  "grant_type": "client_credentials",
  "client_id": "<YOUR_CLIENT_ID>",
  "client_secret": "<YOUR_CLIENT_SECRET>"
}'
```

Response

```json
{
  "access_token": "eyJz93a...k4laUZw",
  "scope": "read:eth-oracle...read:eth-operators",
  "expires_in": 86400,
  "token_type": "Bearer"
}
```

## Production

Request

```bash
curl -X 'POST' \
  'https://auth.alluvial.finance/oauth/token' \
  -H 'content-type: application/json' \
  -d '{
    "audience": "https://api.alluvial.finance",
  "grant_type": "client_credentials",
  "client_id": "<YOUR_CLIENT_ID>",
  "client_secret": "<YOUR_CLIENT_SECRET>"
}'
```

Response

```json
{
  "access_token": "eyJz93a...k4laUWw",
  "scope": "read:eth-oracle...read:eth-operators",
  "expires_in": 86400,
  "token_type": "Bearer"
}
```
