---
title: "Callback"
method: GET
path: "/callback"
tags: ["Authentication"]
---

# Callback

`GET /callback`

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:**
    1. Auth0 redirects to this endpoint after successful authentication
    2. This endpoint validates the authorization code and state
    3. Redirects back to the original `redirect_uri` with code and state
    4. Client can then exchange the code for tokens at `/token` endpoint
    
    **Security:**
    - Validates state parameter to prevent CSRF attacks
    - Checks authorization code expiration
    - Cleans up session data after processing

## Response `200`

OAuth2 callback processed successfully

- CallbackResponse — Response model for OAuth2 callback endpoint
  - `message` string — Callback status message
  - `code` string, nullable — Authorization code
  - `state` string, nullable — State parameter for security

## Other responses

- `400` — Bad request - missing code or state
- `500` — Internal server error

---

[API](https://skmtc.net/papr-ai/apis/papr-memory-api.md) · [All operations](https://skmtc.net/papr-ai/apis/papr-memory-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/papr-ai/papr-memory-api/revisions/b553be9aad37/schema)
