---
title: "Check datasource authorization"
method: POST
path: "/rest/api/v1/checkdatasourceauth"
tags: ["Authentication"]
---

# Check datasource authorization

`POST /rest/api/v1/checkdatasourceauth`

Returns all datasource instances that require per-user OAuth authorization
for the authenticated user, along with a transient auth token that can be
appended to auth URLs to complete OAuth flows.

Clients construct the full OAuth URL by combining the backend base URL,
the `authUrlRelativePath` from each instance, and the transient auth token:
`<backend>/<authUrlRelativePath>?transient_auth_token=<token>`.

## Response `200`

OK

- CheckDatasourceAuthResponse
  - `unauthorizedDatasourceInstances` UnauthorizedDatasourceInstance[], required — Datasource instances that require per-user OAuth authorization. Empty when all datasources are authorized.
    - `datasourceInstance` string — The instance identifier (e.g. "github", "github_enterprise_0", "slack_0"). Matches the instance names used in datasource configuration.
    - `displayName` string — Human-readable name of the datasource instance for display.
    - `authStatus` 'DISABLED' | 'AWAITING_AUTH' | 'AUTHORIZED' | 'STALE_OAUTH' | 'SEG_MIGRATION' — The per-user authorization status for a datasource.
    - `authUrlRelativePath` string — Relative path to initiate or resume OAuth for the current user and instance, including a one-time authentication token as a query parameter. Clients should prepend their configured Glean backend base URL.

## Other responses

- `401` — Not Authorized
- `429` — Too Many Requests

## Changes

- **2026-06-06** `c1a150309e52` — 1 info
  - the endpoint scheme security `APIToken` was removed from the API
- **2026-06-03** `2cb0cc06631f` — 1 info
  - the endpoint scheme security `APIToken` was added to the API
- **2026-06-03** `d2c4124e0abe` — 1 info
  - the endpoint scheme security `APIToken` was removed from the API
- **2026-05-27** `35c36b2b6d97` — 1 info
  - the endpoint scheme security `APIToken` was added to the API
- **2026-05-27** `2ed9c7b7b8d9` — 1 info
  - the endpoint scheme security `APIToken` was removed from the API

[Full history](https://skmtc.dev/gleanwork/apis/glean-api/changes/rest/api/v1/checkdatasourceauth/post.md)

---

[API](https://skmtc.dev/gleanwork/apis/glean-api.md) · [All operations](https://skmtc.dev/gleanwork/apis/glean-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/gleanwork/glean-api/revisions/c1a150309e52/schema)
