### Request an access token
Run the following cURL command to request an access token. Replace the placeholder values with your Client ID and Client Secret.

```curl
  curl -X POST 'https://auth.sitecorecloud.io/oauth/token' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'client_id={YOUR_API_KEY}' \
  --data-urlencode 'client_secret={YOUR_API_SECRET}' \
  --data-urlencode 'grant_type=client_credentials' \
  --data-urlencode 'audience=https://api.sitecorecloud.io'
```
In the response, the `access_token` key contains the access token:

```json
  {
    "access_token": "{YOUR_ACCESS_TOKEN}",
    "scope": "ai.org.brd:w ai.org.brd:r ai.org.docs:w ai.org.docs:r ai.org:admin",
    "expires_in": 86400,
    "token_type": "Bearer"
  }
```
Access tokens expire in 24 hours. If your requests unexpectedly return a response with status `401 Unauthorized`, request a new access token by repeating this `POST` request.
We recommend that you cache the access token for 24 hours to avoid repeating this `POST` request while the access token is still valid.
