# User Activity

WARNING

These endpoints are available only if vanguardapp/activity-log (opens new window) plugin is installed.

# Paginate Activities

GET
/activity

# Example Request

curl --location --request GET 'https://yourwebsite.com/api/activity' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {api_key}' \
--header 'Authorization: Bearer {api_key}'

# Example Response

{
    "data": [
        {
            "id": 1,
            "user_id": 123,
            "ip_address": "123.45.67.890",
            "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36",
            "browser": "Chrome",
            "platform": "OS X",
            "device": "Macintosh",
            "description": "Logged in.",
            "created_at": "2017-08-16 10:30:22"
        },
        // ...
    ],
    // ...
}

# Sortable Fields

created_at (default)

# Partial filters

description

# Exact Filters

user

# Activity Stats

GET
/stats/activity

# Example Request

curl --location --request GET 'https://yourwebsite.com/api/stats/activity' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {api_key}' \
--header 'Authorization: Bearer {api_key}'

# Example Response

{
  "2020-03-07": 0,
  "2020-03-08": 0,
  "2020-03-09": 0,
  "2020-03-10": 0,
  "2020-03-11": 0,
  "2020-03-12": 0,
  "2020-03-13": 0,
  "2020-03-14": 0,
  "2020-03-15": 0,
  "2020-03-16": 6,
  "2020-03-17": 2,
  "2020-03-18": 4,
  "2020-03-19": 2,
  "2020-03-20": 0
}