Static Tokens

Device static tokens

Get static tokens

get

Retrieve all static authentication tokens for devices

Note: to generate the QR code, that is acceptable by the official Blynk mobile applications, use the following format: {token}+{orgId}.

Required permissions, when user-scoped authentication is used: MANAGE_STATIC_TOKENS.

Authorizations
AuthorizationstringRequired

OAuth2 Bearer token obtained from authentication endpoint

Query parameters
orgIdinteger · int32Optional

Organization ID (optional). If not provided, the organization, that is associated with the authentication token, will be used.

pageinteger · int32Optional

Page number (0-indexed)

Default: 0
sizeinteger · int32 · min: 1 · max: 1000Optional

Page size (max 1000)

Default: 50
Responses
chevron-right
200

List of static tokens

application/json
totalElementsinteger · int64Required

Total number of static tokens in the organization

Example: 1
get
/api/v1/organization/static-tokens

Claim device by static token

post

Claim a device using its static token (QR code). This endpoint creates a new device or transfers an existing device to the specified user's organization.

The QR code can be in two formats:

  • Plain token: sqr_gCCsLSydh3d0ArmZj50l9zr79JXVooBR

  • QR format with organization ID: sqr_gCCsLSydh3d0ArmZj50l9zr79JXVooBR+1

If the device doesn't exist, it will be created in the user's organization. If it exists in a different organization, it will be transferred to the user's organization (requires proper access permissions).

Important:

  • The static token should not be already claimed

  • The OAuth client must have access to both the user specified in userId and the organization where the static token was created

Required permissions, when user-scoped authentication is used: ORG_DEVICES_CREATE. Required device view permission: OWN_DEVICES_VIEW or ORG_DEVICES_VIEW. User-scoped tokens that set userId different from authenticated user ID also require ORG_VIEW_USERS.

Authorizations
AuthorizationstringRequired

OAuth2 Bearer token obtained from authentication endpoint

Body
qrCodestring · max: 200Required

Static token QR code value (plain token or token+orgId format)

Example: sqr_gCCsLSydh3d0ArmZj50l9zr79JXVooBR+1
deviceNamestring · max: 50Optional

Device name (optional). If not provided or empty, defaults to "New Device". Only letters, digits, spaces, apostrophes, underscores, and hyphens are allowed.

Example: Living Room SensorPattern: ^[a-zA-Z0-9 '\-_]+$
userIdinteger · int64Required

User ID who will own the claimed device

Example: 12345
Responses
chevron-right
200

Device claimed successfully

application/json
idinteger · int32Required

Device ID

Example: 1
namestringRequired

Device name

Example: Living Room Sensor
templateIdinteger · int32Required

Template ID this device belongs to

Example: 101
orgIdinteger · int32Required

Organization ID this device belongs to

Example: 101
tokenstringRequired

Device authentication token

Example: ZJW2kImth5rGzPUBVcSPkqS_YsoFEFJm
activatedAtinteger · int64Optional

Device activation timestamp

Example: 1707244800000
ownerUserIdinteger · int64Optional

Device owner identifier

Example: 202
post
/api/v1/organization/static-tokens/claim

Unclaim static tokens

post

Remove device associations from static tokens. The static token itself won't be deleted.

Returns 400 if no valid tokens were found to unclaim (tokens may be invalid, already unclaimed, or do not exist).

Required permissions, when user-scoped authentication is used: MANAGE_STATIC_TOKENS, ORG_DEVICES_DELETE.

Authorizations
AuthorizationstringRequired

OAuth2 Bearer token obtained from authentication endpoint

Body
qrCodesstring[] · min: 1 · max: 10000Required

List of QR code tokens to unclaim

Example: sqr_gCCsLSydh3d0ArmZj50l9zr79JXVooBR+1
Responses
post
/api/v1/organization/static-tokens/unclaim

No content

Last updated

Was this helpful?