v37

latestOpenAPI 3.1.0raw.githubusercontent.com2026-06-1170194628.0 KB
Authentication

Token

OAuth2 token endpoint. Exchanges authorization code for access tokens.

**Request Body (JSON or Form):**
- `grant_type`: OAuth2 grant type - "authorization_code" or "refresh_token" (required)
- `code`: Authorization code from OAuth2 callback (required for authorization_code grant)
- `redirect_uri`: Redirect URI used in authorization (required for authorization_code grant)
- `client_type`: Client type - "papr_plugin" or "browser_extension" (optional, default: papr_plugin)
- `refresh_token`: Refresh token for token refresh (required for refresh_token grant)

**Response:**
- `access_token`: OAuth2 access token for API authentication
- `token_type`: Token type (Bearer)
- `expires_in`: Token expiration time in seconds
- `refresh_token`: Refresh token for getting new access tokens
- `scope`: OAuth2 scopes granted
- `user_id`: User ID from Auth0

**Example Request:**
```json
{
    "grant_type": "authorization_code",
    "code": "abc123...",
    "redirect_uri": "https://chat.openai.com",
    "client_type": "papr_plugin"
}
```
post/token

Response

OAuth2 token exchange successful

access_tokenstring required

OAuth2 access token

token_typestring

Token type

expires_ininteger required

Token expiration time in seconds

refresh_tokenstring nullable

Refresh token for getting new access tokens

scopestring required

OAuth2 scopes granted

user_idstring nullable

User ID from Auth0

messagestring nullable

Additional message or status