---
title: "Connect an OAuth grant"
method: POST
path: "/v1/credentials/oauth/connect"
tags: ["Credentials"]
---

# Connect an OAuth grant

`POST /v1/credentials/oauth/connect`

## Request

- Base URL: `http://localhost:9998`
- URL: `http://localhost:9998/v1/credentials/oauth/connect`
- Auth: HTTP bearer

Starts an OAuth 2.1 + PKCE browser consent flow for a provider and stores the resulting grant.

## Request body

- object
  - `providerId` string, required
  - `clientId` string
  - `clientSecret` string
  - `scopes` string[]

## Response `200`

The connected grant status

- OAuthConnectionStatus: OAuth connection status returned by connect / service-account.
  - `providerId` string, required
  - `displayName` string, required
  - `authenticated` boolean, required
  - `scopes` string[], required
  - `accountEmail` string, nullable
  - `authMethod` 'browser' | 'serviceAccount', nullable

## Other responses

- `400`: Invalid request

---

[API](https://skmtc.dev/modelpiper/apis/toolpiper-api.md) · [All operations](https://skmtc.dev/modelpiper/apis/toolpiper-api/llms.txt) · [OpenAPI document](https://skmtc.dev/modelpiper/apis/toolpiper-api/revisions/6722bf56385c?raw)
