---
title: "Get User Api Keys (getUserApiKeys)"
method: GET
path: "/api/apiKeys/{userId}"
tags: ["api-key-controller"]
---

# Get User Api Keys (getUserApiKeys)

`GET /api/apiKeys/{userId}`

Returns a page of api keys owned by user. 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 any authorized user.

## Path parameters

- `userId` string, required

## Query parameters

- `pageSize` integer, required
- `page` integer, required
- `textSearch` string
- `sortProperty` 'createdTime' | 'expirationTime' | 'description' | 'enabled'
- `sortOrder` 'ASC' | 'DESC'

## Response `200`

OK

- PageDataApiKeyInfo
  - `data` ApiKeyInfo[] — Array of the entities
    - `id` ApiKeyId
      - `id` string, uuid, required — ID of the entity, time-based UUID v1
      - `entityType` 'API_KEY', required — string
    - `createdTime` integer — Entity creation timestamp in milliseconds since Unix epoch
    - `tenantId` TenantId
      - `id` string, uuid, required — ID of the entity, time-based UUID v1
      - `entityType` 'TENANT', required — string
    - `userId` UserId
      - `id` string, uuid, required — ID of the entity, time-based UUID v1
      - `entityType` 'USER', required — string
    - `expirationTime` integer — Expiration time of the API key.
    - `description` string, required — API Key description.
    - `enabled` boolean — Enabled/disabled API key.
    - `expired` boolean — Indicates if the API key is expired based on current time. Returns false if expirationTime is 0 (no expiry).
  - `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)
