---
title: "Generate static tokens"
method: POST
path: "/api/v1/organization/static-tokens/generate"
tags: ["Static Tokens"]
---

# Generate static tokens

`POST /api/v1/organization/static-tokens/generate`

Generate one or more static authentication tokens for a given template (product).

Each generated token is created in the `UNCLAIMED` state and can later be claimed by a user
(see the claim endpoint) or used directly by a device for authentication.

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

The optional `metaMapping` array assigns meta field values to each generated token. When provided,
its size must equal `count`, and each entry maps a template meta field id to its value.

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

## Request body

- object
  - `productId` integer, required — Template (product) ID, that the tokens will be generated for
  - `count` integer, required — Number of static tokens to generate
  - `metaMapping` object[] — Optional meta field values applied to each generated token. When provided, the array size must equal `count`. Each item maps a meta field id to its value.
  - `orgId` integer — Organization ID (optional). If not provided, the organization, that is associated with the authentication token, will be used.

## Response `201`

Static tokens generated successfully

- StaticToken[]
  - `token` string, required — Static authentication token, that should be used for device claiming
  - `orgId` integer, required — Organization ID, that the token belongs to
  - `productId` integer, required — Template ID, that the token belongs to
  - `deviceToken` string, required — Device token, that should be used on the device for authentication.
  - `createdAt` integer, required — Token creation timestamp
  - `status` 'CLAIMED' | 'UNCLAIMED', required — Static token status
  - `ownerId` integer — User ID of the claimed device owner
  - `deviceId` integer — Device ID of the claimed device
  - `claimedOrgId` integer — Organization ID, that the device was claimed to

## Other responses

- `400` — Bad request
- `403` — Forbidden
- `404` — Template or organization not found or access denied
- `429` — Too many requests
- `500` — Internal server error

---

[API](https://skmtc.dev/blynk/apis/blynk-platform-api.md) · [All operations](https://skmtc.dev/blynk/apis/blynk-platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/blynk/blynk-platform-api/revisions/d8640cc48a13/schema)
