Sessions
Session security - fingerprinting, hijacking detection, concurrent limits
Generate Fingerprint
Request Body
application/json
Browser user agent string
Client IP address
Accept-Language header
Screen resolution (e.g., '1920x1080')
Client timezone (e.g., 'America/New_York')
Response Body
application/json
application/json
curl -X POST "https://loading/api/v1/sessions/fingerprint" \ -H "Content-Type: application/json" \ -d '{ "user_agent": "string", "ip_address": "string" }'{}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Create Session
Authorization
HTTPBearer In: header
Request Body
application/json
Client IP address
Browser user agent
Pre-computed device fingerprint
Geolocation country code
Geolocation city
Idle timeout (5-1440 minutes)
605 <= value <= 1440Response Body
application/json
application/json
curl -X POST "https://loading/api/v1/sessions/create" \ -H "Content-Type: application/json" \ -d '{ "ip_address": "string", "user_agent": "string" }'{
"success": true,
"session_id": "string",
"fingerprint": "string",
"expires_at": "2019-08-24T14:15:22Z",
"error": "string"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Validate Session
Authorization
HTTPBearer In: header
Request Body
application/json
Session UUID to validate
Current client IP
Current user agent
Current device fingerprint
Response Body
application/json
application/json
curl -X POST "https://loading/api/v1/sessions/validate" \ -H "Content-Type: application/json" \ -d '{ "session_id": "string", "current_ip": "string", "current_user_agent": "string" }'{
"is_valid": true,
"error_message": "string",
"session_id": "string",
"is_suspicious": false,
"risk_score": 0
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Get Active Sessions
Authorization
HTTPBearer In: header
Response Body
application/json
curl -X GET "https://loading/api/v1/sessions/active"{
"sessions": [
{
"session_id": "string",
"status": "string",
"ip_address": "string",
"user_agent": "string",
"geo_country": "string",
"geo_city": "string",
"created_at": "2019-08-24T14:15:22Z",
"last_activity_at": "2019-08-24T14:15:22Z",
"is_current": false
}
],
"total_count": 0,
"max_concurrent": 5
}Secure Logout
Authorization
HTTPBearer In: header
Request Body
application/json
Current session UUID
Revoke all sessions for user
falseResponse Body
application/json
application/json
curl -X POST "https://loading/api/v1/sessions/logout" \ -H "Content-Type: application/json" \ -d '{ "session_id": "string" }'{
"success": true,
"revoked_sessions": 0,
"revoke_all": true,
"error": "string"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Revoke Session
Authorization
HTTPBearer In: header
Path Parameters
Request Body
application/json
Revocation reason
"User revoked"length <= 255Response Body
application/json
application/json
curl -X DELETE "https://loading/api/v1/sessions/string" \ -H "Content-Type: application/json" \ -d '{}'{
"property1": true,
"property2": true
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Cleanup Expired Sessions
Authorization
HTTPBearer In: header
Response Body
application/json
curl -X POST "https://loading/api/v1/sessions/cleanup"{
"property1": 0,
"property2": 0
}