---
title: "Assign device to tenant (assignDeviceToTenant)"
method: POST
path: "/api/tenant/{tenantId}/device/{deviceId}"
tags: ["device-controller"]
---

# Assign device to tenant (assignDeviceToTenant)

`POST /api/tenant/{tenantId}/device/{deviceId}`

Creates assignment of the device to tenant. Thereafter tenant will be able to reassign the device to a customer.

Available for users with 'TENANT_ADMIN' authority.

## Path parameters

- `tenantId` string, required
- `deviceId` string, required

## Response `200`

OK

- Device
  - `id` DeviceId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'DEVICE', required — string
  - `createdTime` integer — Timestamp of the device 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
  - `name` string, required — Unique Device Name in scope of Tenant
  - `type` string — Device Profile Name
  - `label` string — Label that may be used in widgets
  - `deviceProfileId` DeviceProfileId, required
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'DEVICE_PROFILE', required — string
  - `firmwareId` OtaPackageId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'OTA_PACKAGE', required — string
  - `softwareId` OtaPackageId
    - `id` string, uuid, required — ID of the entity, time-based UUID v1
    - `entityType` 'OTA_PACKAGE', required — string
  - `version` integer
  - `additionalInfo` unknown
  - `deviceData` DeviceData
    - `configuration` DefaultDeviceConfiguration
      - `type` string, required
    - `transportConfiguration` union — Device transport configuration used to connect the device
      - CoapDeviceTransportConfiguration
        - `type` string, required
        - `powerMode` 'PSM' | 'DRX' | 'E_DRX'
        - `psmActivityTimer` integer
        - `edrxCycle` integer
        - `pagingTransmissionWindow` integer
      - DefaultDeviceTransportConfiguration
        - `type` string, required
      - Lwm2mDeviceTransportConfiguration
        - `type` string, required
        - `powerMode` 'PSM' | 'DRX' | 'E_DRX'
        - `psmActivityTimer` integer
        - `edrxCycle` integer
        - `pagingTransmissionWindow` integer
      - MqttDeviceTransportConfiguration
        - `type` string, required
      - SnmpDeviceTransportConfiguration
        - `type` string, required
        - `host` string
        - `port` integer
        - `protocolVersion` 'V1' | 'V2C' | 'V3'
        - `community` string
        - `username` string
        - `securityName` string
        - `contextName` string
        - `authenticationProtocol` 'SHA_1' | 'SHA_224' | 'SHA_256' | 'SHA_384' | 'SHA_512' | 'MD5'
        - `authenticationPassphrase` string
        - `privacyProtocol` 'DES' | 'AES_128' | 'AES_192' | 'AES_256'
        - `privacyPassphrase` string
        - `engineId` string

---

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