---
updatedAt: 2025-06-05T20:02:27.000Z
agentTools:
  projectIndex: https://dev.streamlabs.com/llms.txt
---

# Obtain an access_token

## 1. Open the Try it URL, and add your desired scopes

![2212](https://files.readme.io/37a012c-streamlabs-app-details-try-it.jpg "streamlabs-app-details-try-it.jpg")

## 2. Approve the app, and you will get the code

![2204](https://files.readme.io/c5bef09-streamlabs-app-authorize.png "streamlabs-app-authorize.png")

## 3. Got the code

![475](https://files.readme.io/b7e2bb3-image.png "image.png")

## 4. Get the access\_token

Send a post request to <https://streamlabs.com/api/v2.0/token> to get the access\_token

```curl
curl --location 'https://streamlabs.com/api/v2.0/token' \
--header 'Content-Type: application/json' \
--header 'X-Requested-With: XMLHttpRequest' \
--data '{
    "grant_type": "authorization_code",
    "client_id": "<client_id>",
    "client_secret": "<client_secret>",
    "redirect_uri": "https://test.streamlabs.com/auth",
    "code": "<code_from_authorization>"
}'
```

## 5. Use access\_token as Bearer Auth Header

Use the `access_token` as a bearer authentication header for all api requests.

```curl
curl --location --request GET 'https://streamlabs.com/api/v2.0/donations' \
--header 'Content-Type: application/json' \
--header 'X-Requested-With: XMLHttpRequest' \
--header 'Authorization: Bearer <access_token>'
```