# Audit Trail
These are a collection of endpoints that allow you to interact with the Audit Trail. These are audit logs that are generated whenever an action is performed on your Console.
# Fetch Audit Trail Logs
GET /api/v1/audit_trail/fetch
Returns a list of audit trail logs.
Required Parameters
Optional Parameters
user_login
, device_push_settings
, user_assign_to_flock
, flock_move
)cursor
.Response
JSON structure with list of logs and the previous and next cursor.
Example
{
"audit_trail": [
{
"action_type": "user_login",
"additional_information": null,
"flock_id": null,
"id": 73,
"message": "User <user_email> logged in",
"timestamp": "2020-04-03 12:56:42 UTC+0000",
"user": "<user_email>",
"user_browser_agent": "<browser_agent_string>",
"user_browser_language": "en-US,en;q=0.9",
"user_ip": "<user_ip>"
},
{
"action_type": "user_login",
"additional_information": null,
"flock_id": null,
"id": 72,
"message": "User <user_email> logged in",
"timestamp": "2020-04-03 09:53:59 UTC+0000",
"user": "<user_email>",
"user_browser_agent": "<browser_agent_string>",
"user_browser_language": "en-US,en;q=0.9",
"user_ip": "<user_ip>"
},
{
"action_type": "user_login",
"additional_information": null,
"flock_id": null,
"id": 71,
"message": "User <user_email> logged in",
"timestamp": "2020-04-02 13:40:05 UTC+0000",
"user": "<user_email>",
"user_browser_agent": "<browser_agent_string>",
"user_browser_language": "en-US,en;q=0.9",
"user_ip": "<user_ip>"
},
{
"action_type": "device_schedule_reboot",
"additional_information": null,
"flock_id": "flock:default",
"id": 70,
"message": "User 'API Token' scheduled the device <device_id> to be rebooted",
"timestamp": "2020-04-02 13:14:49 UTC+0000",
"user": "<user_email>",
"user_browser_agent": "<browser_agent_string>",
"user_browser_language": "",
"user_ip": "<user_ip>"
},
{
"action_type": "device_schedule_reboot",
"additional_information": null,
"flock_id": "flock:default",
"id": 69,
"message": "User 'API Token' scheduled the device <device_id> to be rebooted",
"timestamp": "2020-04-02 13:11:27 UTC+0000",
"user": "<user_email>",
"user_browser_agent": "<browser_agent_string>",
"user_browser_language": "",
"user_ip": "<user_ip>"
}
],
"cursor": {
"next": "MDo2OTo1OjM6MjoxNQ==",
"prev": null
},
"page_count": 15,
"page_number": 1,
"result": "success"
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Purge Audit Trail Logs
DANGER
Purging logs will permanently remove them and they will not be recoverable.
POST /api/v1/audit_trail/purge
Deletes audit_trail logs older than (and including) a provided id.
Required Parameters
Response
A JSON message with a result indicator and message.
Example
{
"msg": "72 logs purged successfully",
"result": "success"
}
2
3
4
# Download Audit Trail Logs
GET /api/v1/audit_trail/download/json
Downloads a zipped json file of audit trail entries.
Required Parameters
Response
A `canary_audit_trail.json.zip` file of type `application/x-zip-compressed`.
Example
The output of this response would be a downloaded file.