Audit Logs API
- enterprise
3 minute read
This guide provides a detailed reference for the RudderStack Audit Logs API.
Overview
The Audit Logs API lets you programmatically access Audit Logs for running your security audits. You can use the API to:
- Access all existing Audit Logs
- Access the Audit Logs generated after the last access
- Filter Audit Logs based on workspaces, date, etc.
You can also view Audit Logs in the RudderStack dashboard.
Prerequisites
- Only Admins can access the Audit Logs API
- Generate an organization-level Service Access Token in the RudderStack dashboard to authenticate the API
Token permissions for legacy RBAC system
If you are on the legacy Permissions Management (RBAC) system, see this documentation for generating the organization-level Service Access Token.
Authentication
The Audit Logs API uses Bearer authentication in the following format:
Authorization: Bearer <SERVICE_ACCESS_TOKEN>Base URL
Use the base URL for your API requests depending on your region:
https://api.rudderstack.comhttps://api.eu.rudderstack.comAccess Audit Logs
You can access Audit Logs using the below endpoint:
Query parameters:
100- Example request:
GET /v2/audit-logs
Host: api.rudderstack.com
Authorization: Bearer 2QHVKQJeojt6Ae9e4iiOhycHrdGcurl --location 'https://api.rudderstack.com/v2/audit-logs?after_cursor=213&per_page=2&workspace_id=1wJCPWvDLHgsi5inTHAChsrFn7O' \
--header 'Authorization: Bearer 2QHVKQJeojt6Ae9e4iiOhycHrdG'- Example response:
{
"data": [{
"id": "2CHj1PJ61lv1NPyQtCiFi2KVX2y",
"actorId": "1vtoxffVBhY2c2iIS6o3GeM0O5B",
"actorType": "user",
"targetId": "2CHj1QBfmNWmpHOMAAkfDZ66fCr",
"targetType": "destination",
"action": "created",
"ip": "::ffff:10.1.3.23",
"createdAt": "2022-07-22T05:03:08.928Z",
"workspaceId": "1vtp6E0bfo3FoGChWFW2f81fogc",
"organizationId": "1vtp6F2GdSqeAHciTsEpNaW9mKy"
},
{
"id": "2CHj6cFHxk11t2QekhPzKhuu7BK",
"actorId": "1vtoxffVBhY2c2iIS6o3GeM0O5B",
"actorType": "user",
"targetId": "2CHj1QBfmNWmpHOMAAkfDZ66fCr",
"targetType": "destination",
"action": "updated",
"ip": "::ffff:10.1.3.23",
"createdAt": "2022-07-22T05:03:49.495Z",
"workspaceId": "1vtp6E0bfo3FoGChWFW2f81fogc",
"organizationId": "1vtp6F2GdSqeAHciTsEpNaW9mKy"
}
],
"paging": {
"next": "/v2/audit-logs?after_cursor=2CHj6cFHxk11t2QekhPzKhuu7BK&per_page=2&workspace_id=1vtp6E0bfo3FoGChWFW2f81fogc",
"total": 200
}
}RudderStack supports specific values for thetargetTypeandactionparameters. See Supported target types and actions for more information.
Response object parameters:
user actor type.Supported target types and actions
RudderStack currently supports following values for the targetType and action parameters pair:
targetType parameter | action parameter |
|---|---|
destination | connected_source |
destination | connected_transformation |
destination | created |
destination | deleted |
destination | disconnected_source |
destination | disconnected_transformation |
destination | updated |
destination | updated_transformation |
notification | updated |
permission | deleted_user_permissions |
permission | resource_access_updated |
permission | resource_locked |
profiles | created |
profiles | deleted |
profiles | updated |
source | connected_sql_model |
source | connected_tracking_plan |
source | created |
source | deleted |
source | disconnected_sql_model |
source | disconnected_tracking_plan |
source | updated |
source | updated_tracking_plan_config |
source | updated_bot_event_management |
source | deleted_bot_event_management |
sql_model | created |
sql_model | deleted |
sql_model | updated |
transformation | created |
transformation | deleted |
transformation | updated |
transformation_library | created |
transformation_library | deleted |
transformation_library | updated |
user | added_to_organization |
user | changed_permission |
user | disabled_mfa |
user | enabled_mfa |
user | removed_from_organization |
user | updated_phone_number |
user_invitation | created |
user_invitation | deleted |
user_invitation | updated |
workspace | deleted |
workspace | updated_data_retention |
workspace | updated_bot_event_management |
workspace | updated_bot_detection |