API for managing personal memory items with authentication and user-specific data.
API for managing personal memory items with authentication and user-specific data.
This API supports three authentication methods:
X-API-Key headerX-API-Key: <your-api-key>X-Session-Token headerX-Session-Token: <your-session-token>Authorization headerAuthorization: Bearer <token>All endpoints require one of these authentication methods.
OAuth2 login endpoint. Initiates the OAuth2 authorization code flow.
Query Parameters:
redirect_uri: The URI to redirect to after authentication (required)state: A random string for CSRF protection (optional but recommended)Flow:
redirect_uri and state/callback with authorization code/callback redirects back to the original redirect_uri with code and stateExample:
GET /login?redirect_uri=https://chat.openai.com&state=abc123curl -i -X GET \
http://memory.papr.ai/login{ "message": "Redirecting to Auth0 for authentication", "redirect_url": "string" }
OAuth2 callback endpoint. Processes the authorization code from Auth0.
Query Parameters:
code: Authorization code from Auth0 (required)state: State parameter for CSRF protection (required)Flow:
redirect_uri with code and state/token endpointSecurity:
curl -i -X GET \
http://memory.papr.ai/callback{ "message": "Authorization successful", "code": "string", "state": "string" }
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 authenticationtoken_type: Token type (Bearer)expires_in: Token expiration time in secondsrefresh_token: Refresh token for getting new access tokensscope: OAuth2 scopes granteduser_id: User ID from Auth0Example Request:
{
"grant_type": "authorization_code",
"code": "abc123...",
"redirect_uri": "https://chat.openai.com",
"client_type": "papr_plugin"
}curl -i -X POST \
http://memory.papr.ai/token{ "access_token": "string", "token_type": "Bearer", "expires_in": 0, "refresh_token": "string", "scope": "string", "user_id": "string", "message": "string" }
Get current user information. Validates authentication and returns user details.
Authentication Required: One of the following authentication methods must be used:
Authorization header: Authorization: Bearer <access_token>Authorization header: Authorization: Session <session_token>Authorization header: Authorization: APIKey <api_key>Headers:
Authorization: Authentication token (required)X-Client-Type: Client type for logging (optional, default: papr_plugin)Response:
user_id: Internal user IDsessionToken: Session token for API access (if available)imageUrl: User profile image URL (if available)displayName: User display name (if available)email: User email address (if available)message: Authentication status messageExample:
GET /me
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
X-Client-Type: papr_plugincurl -i -X GET \
http://memory.papr.ai/meUser information retrieved successfully
Session token for API access
Session token for API access
Session token for API access
User profile image URL
User profile image URL
User profile image URL
User display name
User display name
User display name
User email address
User email address
User email address
{ "user_id": "string", "sessionToken": "string", "imageUrl": "string", "displayName": "string", "email": "string", "message": "You are authenticated!" }
OAuth2 logout endpoint. Logs out the user from Auth0 and redirects to specified URL.
Query Parameters:
returnTo: URL to redirect to after logout (optional, default: extension logout page)client_type: Client type for determining Auth0 client ID (optional, default: papr_plugin)Flow:
Example:
GET /logout?returnTo=https://chat.openai.comNote: This endpoint initiates the logout process. The actual logout completion happens on Auth0's side.
curl -i -X GET \
http://memory.papr.ai/logout{ "message": "Redirecting to logout", "logout_url": "string" }