---
title: "Get audit logs by user id (getAuditLogsByUserId)"
method: GET
path: "/api/audit/logs/user/{userId}"
tags: ["audit-log-controller"]
---

# Get audit logs by user id (getAuditLogsByUserId)

`GET /api/audit/logs/user/{userId}`

Returns a page of audit logs related to the actions of targeted user. For example, RPC call to a particular device, or alarm acknowledgment for a specific device, etc. You can specify parameters to filter the results. The result is wrapped with PageData object that allows you to iterate over result set using pagination. See response schema for more details. 

Available for users with 'TENANT_ADMIN' authority.

## Path parameters

- `userId` string, required

## Query parameters

- `pageSize` integer, required
- `page` integer, required
- `textSearch` string
- `sortProperty` 'createdTime' | 'entityType' | 'entityName' | 'userName' | 'actionType' | 'actionStatus'
- `sortOrder` 'ASC' | 'DESC'
- `startTime` integer
- `endTime` integer
- `actionTypes` string

## Response `200`

OK

- PageDataAuditLog
  - `data` AuditLog[] — Array of the entities
    - `id` AuditLogId
      - `id` string, uuid, required — string
    - `createdTime` integer — Timestamp of the auditLog creation, in milliseconds
    - `tenantId` TenantId
      - `id` string, uuid, required — ID of the entity, time-based UUID v1
      - `entityType` 'TENANT', required — string
    - `customerId` CustomerId
      - `id` string, uuid, required — ID of the entity, time-based UUID v1
      - `entityType` 'CUSTOMER', required — string
    - `entityId` EntityId
      - `id` string, uuid, required — ID of the entity, time-based UUID v1
      - `entityType` 'TENANT' | 'CUSTOMER' | 'USER' | 'DASHBOARD' | 'ASSET' | 'DEVICE' | 'ALARM' | 'RULE_CHAIN' | 'RULE_NODE' | 'ENTITY_VIEW' | 'WIDGETS_BUNDLE' | 'WIDGET_TYPE' | 'TENANT_PROFILE' | 'DEVICE_PROFILE' | 'ASSET_PROFILE' | 'API_USAGE_STATE' | 'TB_RESOURCE' | 'OTA_PACKAGE' | 'EDGE' | 'RPC' | 'QUEUE' | 'NOTIFICATION_TARGET' | 'NOTIFICATION_TEMPLATE' | 'NOTIFICATION_REQUEST' | 'NOTIFICATION' | 'NOTIFICATION_RULE' | 'QUEUE_STATS' | 'OAUTH2_CLIENT' | 'DOMAIN' | 'MOBILE_APP' | 'MOBILE_APP_BUNDLE' | 'CALCULATED_FIELD' | 'JOB' | 'ADMIN_SETTINGS' | 'AI_MODEL' | 'API_KEY', required
    - `entityName` string — Name of the logged entity
    - `userId` UserId
      - `id` string, uuid, required — ID of the entity, time-based UUID v1
      - `entityType` 'USER', required — string
    - `userName` string — Unique user name(email) of the user that performed some action on logged entity
    - `actionType` 'ADDED' | 'DELETED' | 'UPDATED' | 'ATTRIBUTES_UPDATED' | 'ATTRIBUTES_DELETED' | 'TIMESERIES_UPDATED' | 'TIMESERIES_DELETED' | 'RPC_CALL' | 'CREDENTIALS_UPDATED' | 'ASSIGNED_TO_CUSTOMER' | 'UNASSIGNED_FROM_CUSTOMER' | 'ACTIVATED' | 'SUSPENDED' | 'CREDENTIALS_READ' | 'ATTRIBUTES_READ' | 'RELATION_ADD_OR_UPDATE' | 'RELATION_DELETED' | 'RELATIONS_DELETED' | 'REST_API_RULE_ENGINE_CALL' | 'ALARM_ACK' | 'ALARM_CLEAR' | 'ALARM_DELETE' | 'ALARM_ASSIGNED' | 'ALARM_UNASSIGNED' | 'LOGIN' | 'LOGOUT' | 'LOCKOUT' | 'ASSIGNED_FROM_TENANT' | 'ASSIGNED_TO_TENANT' | 'PROVISION_SUCCESS' | 'PROVISION_FAILURE' | 'ASSIGNED_TO_EDGE' | 'UNASSIGNED_FROM_EDGE' | 'ADDED_COMMENT' | 'UPDATED_COMMENT' | 'DELETED_COMMENT' | 'SMS_SENT' — String represented Action type
    - `actionData` unknown
    - `actionStatus` 'SUCCESS' | 'FAILURE' — String represented Action status
    - `actionFailureDetails` string — Failure action details info. An empty string in case of action status type 'SUCCESS', otherwise includes stack trace of the caused exception.
  - `totalPages` integer — Total number of available pages. Calculated based on the 'pageSize' request parameter and total number of entities that match search criteria
  - `totalElements` integer — Total number of elements in all available pages
  - `hasNext` boolean — 'false' value indicates the end of the result set

---

[API](https://skmtc.net/thingsboard/apis/thingsboard-rest-api.md) · [All operations](https://skmtc.net/thingsboard/apis/thingsboard-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/thingsboard/thingsboard-rest-api/revisions/40169ccdec5c/schema)
