---
title: "Get Device Credentials (getDeviceCredentialsByDeviceId)"
method: GET
path: "/api/device/{deviceId}/credentials"
tags: ["device-controller"]
---

# Get Device Credentials (getDeviceCredentialsByDeviceId)

`GET /api/device/{deviceId}/credentials`

If during device creation there wasn't specified any credentials, platform generates random 'ACCESS_TOKEN' credentials.

Available for users with 'TENANT_ADMIN' or 'CUSTOMER_USER' authority.

## Path parameters

- `deviceId` string, required

## Response `200`

OK

- DeviceCredentials — A JSON value representing the device credentials.
  - `id` DeviceCredentialsId, required
    - `id` string, uuid, required — string
  - `createdTime` integer — Timestamp of the device credentials creation, in milliseconds
  - `deviceId` DeviceId, required
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'DEVICE', required — string
  - `credentialsType` 'ACCESS_TOKEN' | 'X509_CERTIFICATE' | 'MQTT_BASIC' | 'LWM2M_CREDENTIALS' — Type of the credentials
  - `credentialsId` string, required — Unique Credentials Id per platform instance. Used to lookup credentials from the database. By default, new access token for your device. Depends on the type of the credentials.
  - `credentialsValue` string — Value of the credentials. Null in case of ACCESS_TOKEN credentials type. Base64 value in case of X509_CERTIFICATE. Complex object in case of MQTT_BASIC and LWM2M_CREDENTIALS
  - `version` integer

---

[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)
