Status Check
Table of Contents
GET /api/v1/status
Purpose
Checks whether the current user is logged in to the server.
This endpoint is intended for frontend applications to verify authentication status. Since authentication is handled via secure, HTTP-only cookies, this endpoint allows client-side code (which cannot access these cookies) to confirm whether a user session exists.
Authentication
- Required: Secure, HTTP-only session cookie
- Not required:
Authorizationheader or access token in request body
Request
- Method:
GET - URL:
/api/v1/status - Headers: None required
- Cookies: Must include a valid session cookie
Response
Success (200 OK)
JSON response example:
{
"httpStatusCode": 200,
"userId": 352,
"userSessionId": "f1017fac1232132353421a9d5c95714aaafff33232bb27b1bdc693"
}
Explanation:
- userId: The unique ID of the authenticated user
- userSessionId: The identifier for the active user session
Error (401 Unauthorized)
JSON response example:
{
"errorText": "Wrong Bearer, please renew Web API Access Token",
"httpStatusCode": 401
}
Explanation:
- This occurs when:
- No valid session cookie is present
- The session has expired
- The cookie token is malformed or revoked
Usage Notes
- Call this endpoint on app load or route change to determine if a session exists.
- A 401 response means the user is not authenticated and should be redirected to the login page or flow.
- No sensitive data is exposed in the response—safe for public frontend use.
Related Endpoints
- POST /api/v1/login - Authenticate user and initiate session
- POST /api/v1/logout - Terminate the current session
All available Web API calls
- Authentication with token – suitable for individual requests
- Authentication with a username and password – suitable for maintaining a session to send multiple requests
- Login with username and password – suitable for individual requests
- Logout the current user – terminate the current session
- Getting user status – check the current user's authentication and session status
- Users API – retrieve user information
- Rooms API – retrieve room information
- Messages API – retrieve and send messages
- Comments API – retrieve and send comments on messages
- Attachments API – manage message attachments
- Events API – receive real-time updates about changes on the server
- Permissions API – retrieve user permissions in rooms
- Server Health API – check the health status of the Virola Server