Security Base API Documentation
GET User Authentication Status
Checks the current authentication status of the user.
Description
This endpoint allows you to verify if a user is currently logged in and their session is active. It's useful for protecting routes and providing real-time feedback to the user.
Parameters
None.
Responses
| Code | Description | Schema |
|---|---|---|
| 200 OK | Authentication successful. User is logged in. |
|
| 401 Unauthorized | Authentication failed. User is not logged in. |
|
POST User Login
Authenticates a user with their credentials.
Description
Submit user credentials to log into the system. A successful login will return a session token.
Request Body
A JSON object containing the user's email/username and password.
{
"identifier": "user@example.com",
"password": "securepassword123"
}
Responses
| Code | Description | Schema |
|---|---|---|
| 200 OK | Login successful. Session token provided. |
|
| 401 Unauthorized | Invalid credentials. |
|
| 429 Too Many Requests | Rate limit exceeded. Try again later. |
|
GET Get All Users
Retrieves a list of all registered users.
Description
This endpoint is typically restricted to administrators and returns a paginated list of users with their basic information.
Query Parameters
page(integer, optional): The page number to retrieve.limit(integer, optional): The number of users per page.search(string, optional): Filter users by username or email.
Responses
| Code | Description | Schema |
|---|---|---|
| 200 OK | List of users retrieved successfully. |
|
| 403 Forbidden | User does not have sufficient permissions. |
|
POST Report New Incident
Submit a new security incident report.
Description
Allows authenticated users to report new security incidents, providing details about the event.
Request Body
A JSON object detailing the incident.
{
"title": "Phishing Attempt Detected",
"description": "Received suspicious email asking for credentials.",
"severity": "medium",
"category": "phishing",
"reported_by": "uuid-abcd-1234",
"location": "user@example.com inbox"
}
Responses
| Code | Description | Schema |
|---|---|---|
| 201 Created | Incident reported successfully. |
|
| 400 Bad Request | Missing or invalid required fields. |
|
| 401 Unauthorized | User not authenticated. |
|
GET Get Vulnerability Scan Results
Retrieve results from recent vulnerability scans.
Description
Fetch detailed results from automated vulnerability scans performed on your systems or applications.
Query Parameters
scan_id(string, optional): Filter results for a specific scan.status(string, optional): Filter by vulnerability status (e.g., "open", "closed", "in-progress").severity(string, optional): Filter by severity level (e.g., "low", "medium", "high", "critical").
Responses
| Code | Description | Schema |
|---|---|---|
| 200 OK | Vulnerability scan results retrieved. |
|
| 404 Not Found | No scan results found for the specified criteria. |
|
GET Get Audit Logs
Retrieve system audit logs for security events.
Description
Access detailed logs of all significant security-related events within the system, such as login attempts, access changes, and configuration modifications.
Query Parameters
start_date(datetime, optional): Filter logs from a specific start date.end_date(datetime, optional): Filter logs up to a specific end date.event_type(string, optional): Filter by specific event type (e.g., "login_success", "file_access", "config_change").user_id(string, optional): Filter logs associated with a specific user.
Responses
| Code | Description | Schema |
|---|---|---|
| 200 OK | Audit logs retrieved successfully. |
|
| 400 Bad Request | Invalid date format or query parameters. |
|
| 403 Forbidden | User lacks permission to access audit logs. |
|