Audit Log API
Export your audit logs
Accessing the API via Command Line
- Find your organization and project IDs. These can be found in most LogRocket URLs (e.g.,
https://app.logrocket.com/<your_organization_id>/<your_project_id>/s/...). You can also find them in the LogRocket dashboard under Settings > Project Settings. The App ID listed there has the form<your_organization_id>/<your_project_id>. - Create an API key under Settings > API Keys.
- Replace the placeholders in the following command with the appropriate information and send the request:
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 (in case we need to tiebreak same-millisecond 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, the response will include a next cursor and set has_next to true.
Updated 15 days ago

