For the complete documentation index, see llms.txt. This page is also available as Markdown.

Templates

Device template configuration

Get templates in organization

get

Retrieve all device templates in the organization.

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

Authorizations
AuthorizationstringRequired

OAuth2 Bearer token obtained from authentication endpoint

Query parameters
orgIdinteger · int32Optional

Organization ID (optional)

pageinteger · int32Optional

Page number (0-indexed)

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

Page size (max 1000)

Default: 50
Responses
200

List of templates

application/json
totalElementsinteger · int64RequiredExample: 1
get/api/v1/organization/templates
GET /api/v1/organization/templates HTTP/1.1
Host: blynk.cloud
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "content": [
    {
      "id": 101,
      "templateIds": [
        "TMPL8RITg_f9Q"
      ],
      "parentId": 101,
      "orgId": 101,
      "name": "Temperature Sensor Template"
    }
  ],
  "totalElements": 1
}

Get template by ID

get

Retrieve detailed information about a specific template.

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

Authorizations
AuthorizationstringRequired

OAuth2 Bearer token obtained from authentication endpoint

Query parameters
templateIdinteger · int32Required

Template ID

Responses
200

Template details

application/json
idinteger · int32Required

Template ID

Example: 101
templateIdsstring[]Required

List of template IDs, that are used on the device

Example: TMPL8RITg_f9Q
parentIdinteger · int32Optional

Parent template ID

Example: 101
orgIdinteger · int32Required

Organization ID, that the template belongs to

Example: 101
namestringRequired

Template name

Example: Temperature Sensor Template
boardTypestring · enumOptional

Device board type

Possible values:
connectionTypestring · enumOptional

Connection type, that is used on the device

Possible values:
descriptionstringOptional

Template description

Example: A template for temperature sensors
logoUrlstringOptional

path of the template logo image, that should be prefixed with the server URL

Example: /logo.png
createdAtinteger · int64Required

Template creation timestamp

Example: 1707244800000
get/api/v1/organization/template
GET /api/v1/organization/template?templateId=1 HTTP/1.1
Host: blynk.cloud
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": 101,
  "templateIds": [
    "TMPL8RITg_f9Q"
  ],
  "parentId": 101,
  "orgId": 101,
  "name": "Temperature Sensor Template",
  "boardType": "Arduino",
  "connectionType": "ETHERNET",
  "description": "A template for temperature sensors",
  "logoUrl": "/logo.png",
  "createdAt": 1707244800000
}

Update template

put

Update template properties.

Only the original (root) template can be edited (the one with parentId = null). Sub-organizations cannot modify templates that were created by a parent organization.

Required permissions, when user-scoped authentication is used: PRODUCT_EDIT. Also, when the user-scoped authentication is used, user should have developer mode enabled.

Authorizations
AuthorizationstringRequired

OAuth2 Bearer token obtained from authentication endpoint

Query parameters
templateIdinteger · int32Required

Template ID

Body
namestring · min: 1 · max: 50Required

New template name. Can only contain letters, digits and spaces.

Example: Temperature Sensor
boardTypestring · enumOptional

Device board type

Possible values:
connectionTypestring · enumOptional

Connection type, that is used on the device

Possible values:
descriptionstring · max: 128Optional

New template description. Can only contain letters, digits, spaces and punctuation marks.

Example: Template for temperature sensors
Responses
200

Template updated successfully

application/json
idinteger · int32Required

Template ID

Example: 101
templateIdsstring[]Required

List of template IDs, that are used on the device

Example: TMPL8RITg_f9Q
parentIdinteger · int32Optional

Parent template ID

Example: 101
orgIdinteger · int32Required

Organization ID, that the template belongs to

Example: 101
namestringRequired

Template name

Example: Temperature Sensor Template
boardTypestring · enumOptional

Device board type

Possible values:
connectionTypestring · enumOptional

Connection type, that is used on the device

Possible values:
descriptionstringOptional

Template description

Example: A template for temperature sensors
logoUrlstringOptional

path of the template logo image, that should be prefixed with the server URL

Example: /logo.png
createdAtinteger · int64Required

Template creation timestamp

Example: 1707244800000
put/api/v1/organization/template
PUT /api/v1/organization/template?templateId=1 HTTP/1.1
Host: blynk.cloud
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 128

{
  "name": "Temperature Sensor",
  "boardType": "Arduino",
  "connectionType": "ETHERNET",
  "description": "Template for temperature sensors"
}
{
  "id": 101,
  "templateIds": [
    "TMPL8RITg_f9Q"
  ],
  "parentId": 101,
  "orgId": 101,
  "name": "Temperature Sensor Template",
  "boardType": "Arduino",
  "connectionType": "ETHERNET",
  "description": "A template for temperature sensors",
  "logoUrl": "/logo.png",
  "createdAt": 1707244800000
}

Delete template

delete

Delete a device template.

You can't delete template, that is used in the sub-organizations. If any device is using the template in the root organization, it will be deleted.

Required permissions, when user-scoped authentication is used: PRODUCT_DELETE. Also, when the user-scoped authentication is used, user should have developer mode enabled.

Authorizations
AuthorizationstringRequired

OAuth2 Bearer token obtained from authentication endpoint

Query parameters
templateIdinteger · int32Required

Template ID

Responses
204

Template deleted successfully

No content

delete/api/v1/organization/template
DELETE /api/v1/organization/template?templateId=1 HTTP/1.1
Host: blynk.cloud
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Create new template

post

Create a new device template.

Required permissions, when user-scoped authentication is used: PRODUCT_CREATE. Also, when the user-scoped authentication is used, user should have developer mode enabled.

Authorizations
AuthorizationstringRequired

OAuth2 Bearer token obtained from authentication endpoint

Body
orgIdinteger · int32Optional

Organization ID to create template in. If not specified, the template will be created in the organization, that is associated with the authentication token.

Example: 101
namestring · min: 1 · max: 50Required

New template name. Can only contain letters, digits and spaces.

Example: Temperature Sensor
boardTypestring · enumOptional

Device board type

Possible values:
connectionTypestring · enumOptional

Connection type, that is used on the device

Possible values:
descriptionstring · max: 128Optional

New template description. Can only contain letters, digits, spaces and punctuation marks.

Example: Template for temperature sensors
Responses
201

Template created successfully

application/json
idinteger · int32Required

Template ID

Example: 101
templateIdsstring[]Required

List of template IDs, that are used on the device

Example: TMPL8RITg_f9Q
parentIdinteger · int32Optional

Parent template ID

Example: 101
orgIdinteger · int32Required

Organization ID, that the template belongs to

Example: 101
namestringRequired

Template name

Example: Temperature Sensor Template
boardTypestring · enumOptional

Device board type

Possible values:
connectionTypestring · enumOptional

Connection type, that is used on the device

Possible values:
descriptionstringOptional

Template description

Example: A template for temperature sensors
logoUrlstringOptional

path of the template logo image, that should be prefixed with the server URL

Example: /logo.png
createdAtinteger · int64Required

Template creation timestamp

Example: 1707244800000
post/api/v1/organization/template/create
POST /api/v1/organization/template/create HTTP/1.1
Host: blynk.cloud
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 140

{
  "orgId": 101,
  "name": "Temperature Sensor",
  "boardType": "Arduino",
  "connectionType": "ETHERNET",
  "description": "Template for temperature sensors"
}
{
  "id": 101,
  "templateIds": [
    "TMPL8RITg_f9Q"
  ],
  "parentId": 101,
  "orgId": 101,
  "name": "Temperature Sensor Template",
  "boardType": "Arduino",
  "connectionType": "ETHERNET",
  "description": "A template for temperature sensors",
  "logoUrl": "/logo.png",
  "createdAt": 1707244800000
}

Last updated

Was this helpful?