---
title: "GetConnectorOAuthToken returns a user's OAuth access token for a connector in the calling deployment's project, refreshing it first if it is about to expire. It returns NotFound if the user has not authorized the connector's current OAuth configuration. It can only be called by deployments."
method: POST
path: "/v1/deployments/-/connector-oauth-token"
---

# GetConnectorOAuthToken returns a user's OAuth access token for a connector in the calling deployment's project, refreshing it first if it is about to expire. It returns NotFound if the user has not authorized the connector's current OAuth configuration. It can only be called by deployments.

`POST /v1/deployments/-/connector-oauth-token`

## Request

- The document declares no server URL.
- Auth: none declared

## Request body

- V1GetConnectorOAuthTokenRequest
  - `configHash` string: Hash of the connector's current OAuth configuration, as computed by the runtime. A token is only returned if the user authorized this configuration, so changing it never reuses an existing authorization.
  - `connector` string: Name of the connector in the deployment's project.
  - `forceRefresh` boolean: If true, the token is refreshed even if it has not expired yet (used after the server rejected the current token).
  - `userId` string: ID of the user whose token to return.

## Response `200`

A successful response.

- V1GetConnectorOAuthTokenResponse
  - `accessToken` string
  - `expiresOn` string, date-time: When the access token expires. Unset if the token does not expire.

## Other responses

- `default`: An unexpected error response.

## Changes

- **2026-10-21** (v1) `1b13259a2d7f`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/rilldata/apis/rill-admin-api/changes/v1/deployments/-/connector-oauth-token/post.md)

---

[API](https://skmtc.dev/rilldata/apis/rill-admin-api.md) - [All operations](https://skmtc.dev/rilldata/apis/rill-admin-api/llms.txt) - [OpenAPI document](https://skmtc.dev/rilldata/apis/rill-admin-api/revisions/5dfad67cc1ca?raw)
