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

# Get an Access Token

> Use OAuth client credentials to obtain a Bearer token

## Overview

ApifyCloud APIs use Bearer tokens. You can obtain a token using the OAuth client credentials flow.

## Step 1: Prepare credentials

You need your `client_id` and `client_secret`.

## Step 2: Request a token

Send a POST request to `/oauth/token` with the `client_credentials` grant type.

```bash theme={null}
curl -X POST "https://api.apifycloud.io/api/v1/oauth/token" \
  -H "Content-Type: application/json" \
  -d '{
    "grant_type": "client_credentials",
    "client_id": "your_client_id",
    "client_secret": "your_client_secret"
  }'
```

## Step 3: Use the token

Add the token to the `Authorization` header in subsequent requests:

```
Authorization: Bearer {access_token}
```

## Token lifetime

The response includes `expires_in` (in seconds). Request a new token when it expires.
