---
title: "Start the OAuth authorization flow for a tool server."
method: POST
path: "/rest/api/v1/tool-servers/{serverId}/auth"
tags: ["Tools"]
---

# Start the OAuth authorization flow for a tool server.

`POST /rest/api/v1/tool-servers/{serverId}/auth`

Initiates the third-party OAuth flow for the specified tool server and returns the
authorization URL that the client should navigate the end user to. After the OAuth
callback completes, the user's browser is redirected back to `returnUrl` with query
parameters indicating the result.

`returnUrl` must match the tenant's configured return URL allowlist; otherwise the
request is rejected with 400.

## Request body

- AuthorizeToolServerRequest
  - `returnUrl` string, required — URL to redirect the end user's browser back to after the OAuth flow completes. Must be present in the tenant's configured return URL allowlist.

## Response `200`

Successful operation

- AuthorizeToolServerResponse
  - `authorizationUrl` string, required — URL that the client should navigate the end user to in order to begin the OAuth flow. After the user consents, control returns to `returnUrl` from the request.

## Other responses

- `400` — Invalid request (e.g. returnUrl not in allowlist, unsupported auth type)
- `401` — Unauthorized
- `403` — User not entitled to the tool server
- `404` — Tool server not found
- `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/ebd602e4aea4/schema)
