Skip to main content

Create a device token

Request

Security
ApiKey(Required scopes: deviceTokens.create)
Bodyapplication/json
deviceIdstring

Device ID associated with the newly created token. If not given, the token will be "unassociated" with a device and will only be usable after using it to create a device.

projectIdstring

Project ID associated with the newly created token. If deviceId is provided, this must match the project of the device. If deviceId is omitted, this is required.

enabledboolean

Whether this token is enabled or not.

preapprovedboolean

Whether devices created with this token are preapproved or not.

Payload
{ "deviceId": "string", "projectId": "string", "enabled": true, "preapproved": true }

Responses

A new device token

Bodyapplication/json
idstringrequired
createdAtstring, (date-time)required

Timestamp of the device token's creation

deviceIdstring or null

ID of the associated device

projectIdstringrequired

ID of the associated project

enabledbooleanrequired

Whether this token is enabled or not

preapprovedbooleanrequired

Whether devices created with this token are preapproved

tokenstring

Generated token. This is only available on creation.

Response
{ "id": "string", "createdAt": "2019-08-24T14:15:22Z", "deviceId": "string", "projectId": "string", "enabled": true, "preapproved": true, "token": "string" }