Playground API Logo
Playground API
v1.0
Sandbox Active
๐Ÿ“š Dev Portal ๐Ÿฅ Health

Auth Resource Documentation

Simulated JWT authentication endpoints (login, register, token refresh, profile read/update). Returns signed JWT access and refresh tokens linked to your session sandbox.

POST /auth/login

Authenticate user with username/email & password to receive signed JWT access and refresh tokens.

curl -X POST 'http://playground-api-xi.vercel.app/auth/login' \
 -H 'Content-Type: application/json'
  \
 -b "pg_identity=your_cookie_uuid" \
 -d '{
  "username": "Bret",
  "password": "password123"
}' 

Request Payload Example

{
  "username": "Bret",
  "password": "password123"
}
โšก Try it out โ€” Test endpoint live Test now
POST /auth/register

Register a new session user and immediately receive signed JWT tokens.

curl -X POST 'http://playground-api-xi.vercel.app/auth/register' \
 -H 'Content-Type: application/json'
  \
 -b "pg_identity=your_cookie_uuid" \
 -d '{
  "name": "Alice Smith",
  "username": "alice",
  "email": "alice@example.com",
  "password": "password123"
}' 

Request Payload Example

{
  "name": "Alice Smith",
  "username": "alice",
  "email": "alice@example.com",
  "password": "password123"
}
โšก Try it out โ€” Test endpoint live Test now
POST /auth/refresh

Exchange a valid refresh token for a fresh 15-minute JWT access token.

curl -X POST 'http://playground-api-xi.vercel.app/auth/refresh' \
 -H 'Content-Type: application/json'
  \
 -b "pg_identity=your_cookie_uuid" \
 -d '{
  "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6..."
}' 

Request Payload Example

{
  "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6..."
}
โšก Try it out โ€” Test endpoint live Test now
GET /auth/me

Retrieve current authenticated user profile using Authorization: Bearer <access_token>.

curl -X
  GET 'http://playground-api-xi.vercel.app/auth/me' \
 -H 'Content-Type: application/json' \
 -b "pg_identity=your_cookie_uuid" 
โšก Try it out โ€” Test endpoint live Test now
PATCH /auth/me

Update current authenticated user profile in the session sandbox using Authorization: Bearer <access_token>.

curl -X PATCH 'http://playground-api-xi.vercel.app/auth/me' \
 -H 'Content-Type: application/json'
  \
 -b "pg_identity=your_cookie_uuid" \
 -d '{
  "name": "Bret - Updated Profile",
  "email": "bret.new@example.com"
}' 

Request Payload Example

{
  "name": "Bret - Updated Profile",
  "email": "bret.new@example.com"
}
โšก Try it out โ€” Test endpoint live Test now