Audit Log API
Leverage our API to export your logs that live within Settings > Audit Log
Accessing the API via Command Line
- Find your organization ID and project ID in the LogRocket platform. Create an API key under Settings > API Keys.
- Replace the placeholders in the following command with the appropriate information and submit the
curlrequest.
curl āhttps://api.logrocket.com/v1/orgs/<your-organization-id>/apps/<your-project-id>/audit/logs/?limit=10&cursor=1530651654308ā -H āAuthorization: token <your-api-key>ā
Format of the Returned Data
Fields:
has_next: True if there are more audit logs with timestamps greater than those returned in the original request.cursor: The timestamp that should be used for subsequent requests to get the next page of audit logs.- You can treat your initial cursor as a timestamp (logs returned will be greater than or equal to that time), but please treat subsequent cursors as opaque page references (this is in case we need to tie break same-ms logs).
user: ID (email or system ID) of the user that performed the action described in the log.action: Title of the action the log is describing.description:- For "Viewed Session" logs: the ID of the session that was viewed. To reconstitute a session url from these use the following format:
https://app.logrocket.com/<org>/<app>/s/<description> - All other actions taken by admins and non-admins are simple strings describing the action.
- For "Viewed Session" logs: the ID of the session that was viewed. To reconstitute a session url from these use the following format:
{
"has_next": true,
"cursor": 1706906952000,
"logs": [
{
"time": "02/02/24 08:48PM",
"created_date": "2024-02-02T20:48:40.376852Z",
"user": "[email protected]",
"action": "Viewed session",
"description": "1-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee/1"
},
... more logs ...
]
}If there are more logs itāll return you a next cursor and set has_next to true. You can treat your initial cursor as a timestamp (logs returned will be gte that time), but please treat subsequent cursors as opaque page references (this is in case we need to tie break same-ms logs)
Updated about 3 hours ago
Whatās Next
