Skip to main content

Get user access history

GET 

/company/users/access/:id

Returns the login history of a specific user with detailed information on IP, browser, operating system, and geolocation.

Objective

To facilitate security auditing and detection of suspicious access by analyzing access patterns.

Use Cases

  • Security auditing
  • Detection of access from unusual locations
  • Analysis of devices used
  • Investigation of unauthorized access

Authentication

  • Requires a valid JWT (middleware m.isLoged)

Response Data

Each access record includes:

  • IP address
  • Browser (name, version)
  • OS (name, version)
  • Device (name, version)
  • Geolocation (country, region, city, timezone)

Geolocation

  • Uses geoip-lite to determine location from IP
  • May not be available for all IPs (private, VPN, etc.)

Pagination

  • Returns paginated results
  • Parameters: page, limit

Request

Responses

Access history retrieved successfully.