> ## Documentation Index
> Fetch the complete documentation index at: https://docs.radarboard.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Credentials API

> API endpoints for managing encrypted service credentials and OAuth connections.

# Credentials API

Manage encrypted API credentials for external service connections.

## List connected services

<Card title="GET /api/credentials" icon="list">
  Returns the list of credential keys that have stored credentials (no values).
</Card>

**Response:**

```json theme={null}
{
  "connectedKeys": ["revenuecat", "sentry", "vercel"]
}
```

## Save credentials

<Card title="POST /api/credentials" icon="plus">
  Store encrypted credentials for a service.
</Card>

**Request body:**

```json theme={null}
{
  "key": "sentry",
  "values": {
    "authToken": "sntrys_...",
    "orgSlug": "my-org"
  }
}
```

## Delete credentials

<Card title="DELETE /api/credentials" icon="trash">
  Remove stored credentials for a service.
</Card>

**Request body:**

```json theme={null}
{
  "key": "sentry"
}
```

## Test credentials

<Card title="POST /api/credentials/test" icon="flask">
  Test credentials by making a lightweight API call to the service.
</Card>

**Request body:**

```json theme={null}
{
  "key": "sentry",
  "values": {
    "authToken": "sntrys_...",
    "orgSlug": "my-org"
  }
}
```

**Response:**

```json theme={null}
{ "ok": true }
```

or

```json theme={null}
{ "ok": false, "error": "Sentry returned 401" }
```

## OAuth redirect

<Card title="GET /api/auth/{provider}/redirect" icon="arrow-right">
  Initiates the OAuth authorization flow. Redirects the user to the provider's authorization page.
</Card>

**Query params:**

* `credKey`: The credential store key (e.g., `github`)
* `scopes`: Space-separated OAuth scopes

## OAuth callback

<Card title="GET /api/auth/{provider}/callback" icon="arrow-left">
  Receives the OAuth authorization code, exchanges it for tokens, and stores them.
</Card>

Automatically redirects to `/settings?oauth=success` or `/settings?oauth=error`.

## Import from gws CLI (Google only)

<Card title="POST /api/auth/gws-import" icon="terminal">
  Import Google OAuth tokens from the `@googleworkspace/cli` local config.
</Card>

**Response:**

```json theme={null}
{ "imported": true }
```
