---
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

---

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