Get sign-in activities

Description

Retrieve a list of sign-in activities by a specified user. This endpoint returns a subset of the data available at the Audit Logs endpoint.

Request

HTTP Method: GET

Query Parameter Description
before Optional Only include logins created before this timestamp
after Optional Only include logins created after this timestamp
Path Parameter Description
user-id ID of the user.
curl -X GET \
  https://<tenant-domain>/api/v1/admin/users/<user-id>/signin_activities \
  -H 'content-type: application/json' \
  -H 'x-user-email: <email-address>' \
  -H 'x-user-token: <api-token>'

Response

A successful request will return a JSON Array describing login events by the specified user.

Field description

Parameter Description
id Signin Activity ID.
user_id Id of user that signed in
user_agent User agent string of client used to sign in
ip IP address of signin
created_at Timestamp describing when user logged in

Sample response

{
  "admin/login_activities": [
    {
      "created_at": "2022-10-19T14:25:18Z",
      "id": 220,
      "user_id": 72,
      "ip": "192.158.1.38",
      "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36"
    },
    {
      "created_at": "2022-10-19T14:25:18Z",
      "id": 219,
      "user_id": 72,
      "ip": "2001:db8:3333:4444:5555:6666:7777:8888",
      "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36"
    }
  ],
  "meta": {
    "current_page": "https://localhost:3000/api/v1/admin/users/72/signin_activities?per_page=20&page=1",
    "previous_page": null,
    "next_page": "https://localhost:3000/api/v1/admin/users/72/signin_activities?per_page=20&page=2",
    "per_page": 20,
    "pages": 2,
    "count": 25
  }
}
Was this helpful?