> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.beehiiv.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.beehiiv.com/_mcp/server.

# Authorize

GET https://app.beehiiv.com/oauth/authorize

Starts the OAuth2 authorization code flow. This endpoint redirects the user to login and consent (if needed), then redirects back to your `redirect_uri` with a `code` and `state`.

Reference: https://developers.beehiiv.com/oauth2/authorizations/authorize

## Request

### Query parameters

- `client_id` (string, required) — The OAuth application client ID (`uid`).
- `redirect_uri` (string, required) — Must exactly match one of the app's configured redirect URIs.
- `response_type` (string, required) — Must be `code` for the authorization code flow.
- `scope` (string, optional) — Space-delimited list of requested scopes.
- `state` (string, optional) — Opaque value returned to your callback for CSRF protection.
- `code_challenge` (string, optional) — PKCE code challenge. Required for public clients.
- `code_challenge_method` (enum, optional) — PKCE challenge method (`plain` or `S256`). Required for public clients when using PKCE.
  - Allowed values: `plain`, `S256`

## Response

### 302

Redirect

## Errors

### 400 O Auth Bad Request Error

The request is invalid or missing required parameters.

- `error` (string, required)
- `error_description` (string, optional)
- `error_uri` (string, optional)
- `state` (string, optional)

### 401 O Auth Unauthorized Error

Client authentication failed or the token is invalid.

- `error` (string, required)
- `error_description` (string, optional)
- `error_uri` (string, optional)
- `state` (string, optional)