Authentication

Fake JWT authentication login, user registration, token refresh, and profile inspection. All mutations persist in your isolated session overlay.

Fake JWT Login

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

Request Endpoint
POSThttps://playground.nileslabs.com/api/v1/auth/login
Request Body Example
1
{
2
"username": "Bret",
3
"password": "password123"
4
}
1
{
2
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEs...",
3
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEs...",
4
"token_type": "Bearer",
5
"expires_in": 900,
6
"user": {
7
"id": 1,
8
"name": "Leanne Graham",
9
"username": "Bret",
10
"email": "Sincere@april.biz"
11
}
12
}

Register Mock User

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

Request Endpoint
POSThttps://playground.nileslabs.com/api/v1/auth/register
Request Body Example
1
{
2
"name": "Alice Smith",
3
"username": "alice",
4
"email": "alice@example.com",
5
"password": "password123"
6
}
1
{
2
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
3
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
4
"token_type": "Bearer",
5
"expires_in": 900,
6
"user": {
7
"id": "local-9b1deb4d",
8
"name": "Alice Smith",
9
"username": "alice",
10
"email": "alice@example.com"
11
}
12
}

Refresh Access Token

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

Request Endpoint
POSThttps://playground.nileslabs.com/api/v1/auth/refresh
Request Body Example
1
{
2
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEs..."
3
}
1
{
2
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEs...",
3
"token_type": "Bearer",
4
"expires_in": 900
5
}

Get Authenticated Profile

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

Request Endpoint
GEThttps://playground.nileslabs.com/api/v1/auth/me
1
{
2
"id": 1,
3
"name": "Leanne Graham",
4
"username": "Bret",
5
"email": "Sincere@april.biz",
6
"phone": "+1-770-555-0123",
7
"website": "hildegard.org"
8
}

Update Authenticated Profile (PATCH)

Update profile information for the current user using Authorization: Bearer <access_token>.

Request Endpoint
PATCHhttps://playground.nileslabs.com/api/v1/auth/me
Request Body Example
1
{
2
"name": "Leanne Graham (Verified Developer)",
3
"website": "https://developer-verified.io"
4
}
1
{
2
"id": 1,
3
"name": "Leanne Graham (Verified Developer)",
4
"username": "Bret",
5
"email": "Sincere@april.biz",
6
"website": "https://developer-verified.io",
7
"_sandbox": "updated"
8
}
Playground API — Free Stateful Mock REST & GraphQL Service