Subcategories
This module can be used to create and list subcategories (token templates)
Token Templates are the barebones of any token collection, when you create a collection you select a category for it and then a template, this contains a set of pre-defined parameters that any one of your tokens will need in its metadata.
List all subcategories
When listing subcategories you have three scope options:
generic: brings subcategories that are generic and are not for a specific company
specific: lists only subcategories created by the company
all: lists all of the above
get
List subcategories of a company
Authorizations
Path parameters
companyIdstringRequired
Query parameters
categoryIdstringOptional
scopestringOptionalExample:
all
Responses
200Success
application/json
401
Need user with one of these roles: superAdmin, admin
get
GET /{companyId}/subcategories HTTP/1.1
Host:
x-w3block-api-key: YOUR_API_KEY
Accept: */*
[
{
"id": "text",
"companyId": "text",
"category": {
"id": "text",
"companyId": "text",
"subcategories": [
{}
],
"name": "text",
"image": "text",
"createdAt": "2025-07-03T03:54:24.252Z",
"updatedAt": "2025-07-03T03:54:24.252Z"
},
"categoryId": "text",
"name": "text",
"tokenTemplate": {
"prop1": {
"type": "SELECT",
"config": {
"required": {},
"label": "text",
"tooltip": "text",
"placeholder": "text",
"order": 1,
"childrenType": "SELECT",
"range": {
"min": 1,
"max": 1
},
"options": [
"text"
],
"float": true
},
"children": {}
},
"prop2": {
"type": "SELECT",
"config": {
"required": {},
"label": "text",
"tooltip": "text",
"placeholder": "text",
"order": 1,
"childrenType": "SELECT",
"range": {
"min": 1,
"max": 1
},
"options": [
"text"
],
"float": true
},
"children": {}
}
},
"deletedAt": "2025-07-03T03:54:24.252Z",
"createdAt": "2025-07-03T03:54:24.252Z",
"updatedAt": "2025-07-03T03:54:24.252Z",
"certificateTemplate": "text"
}
]
Create a subcategory
post
Create a new subcategory
Authorizations
Path parameters
companyIdstringRequired
Body
categoryIdstringRequired
namestringRequired
tokenTemplateobjectRequired
certificateTemplatestringOptional
Responses
201Success
application/json
401
Need user with one of these roles: superAdmin, admin
post
POST /{companyId}/subcategories HTTP/1.1
Host:
x-w3block-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 83
{
"categoryId": "text",
"name": "text",
"tokenTemplate": {},
"certificateTemplate": "text"
}
{
"id": "text",
"companyId": "text",
"category": {
"id": "text",
"companyId": "text",
"subcategories": [
{}
],
"name": "text",
"image": "text",
"createdAt": "2025-07-03T03:54:24.252Z",
"updatedAt": "2025-07-03T03:54:24.252Z"
},
"categoryId": "text",
"name": "text",
"tokenTemplate": {
"prop1": {
"type": "SELECT",
"config": {
"required": {},
"label": "text",
"tooltip": "text",
"placeholder": "text",
"order": 1,
"childrenType": "SELECT",
"range": {
"min": 1,
"max": 1
},
"options": [
"text"
],
"float": true
},
"children": {}
},
"prop2": {
"type": "SELECT",
"config": {
"required": {},
"label": "text",
"tooltip": "text",
"placeholder": "text",
"order": 1,
"childrenType": "SELECT",
"range": {
"min": 1,
"max": 1
},
"options": [
"text"
],
"float": true
},
"children": {}
}
},
"deletedAt": "2025-07-03T03:54:24.252Z",
"createdAt": "2025-07-03T03:54:24.252Z",
"updatedAt": "2025-07-03T03:54:24.252Z",
"certificateTemplate": "text"
}
Get subcategory details
get
Get a subcategory by id
Authorizations
Path parameters
idstringRequired
companyIdstringRequired
Responses
200Success
application/json
401
Need user with one of these roles: superAdmin, admin
get
GET /{companyId}/subcategories/{id} HTTP/1.1
Host:
x-w3block-api-key: YOUR_API_KEY
Accept: */*
{
"id": "text",
"companyId": "text",
"category": {
"id": "text",
"companyId": "text",
"subcategories": [
{}
],
"name": "text",
"image": "text",
"createdAt": "2025-07-03T03:54:24.252Z",
"updatedAt": "2025-07-03T03:54:24.252Z"
},
"categoryId": "text",
"name": "text",
"tokenTemplate": {
"prop1": {
"type": "SELECT",
"config": {
"required": {},
"label": "text",
"tooltip": "text",
"placeholder": "text",
"order": 1,
"childrenType": "SELECT",
"range": {
"min": 1,
"max": 1
},
"options": [
"text"
],
"float": true
},
"children": {}
},
"prop2": {
"type": "SELECT",
"config": {
"required": {},
"label": "text",
"tooltip": "text",
"placeholder": "text",
"order": 1,
"childrenType": "SELECT",
"range": {
"min": 1,
"max": 1
},
"options": [
"text"
],
"float": true
},
"children": {}
}
},
"deletedAt": "2025-07-03T03:54:24.252Z",
"createdAt": "2025-07-03T03:54:24.252Z",
"updatedAt": "2025-07-03T03:54:24.252Z",
"certificateTemplate": "text"
}
Update subcategory
patch
Update a subcategory by id
Authorizations
Path parameters
idstringRequired
companyIdstringRequired
Body
categoryIdstringOptional
namestringOptional
tokenTemplateobjectOptional
certificateTemplatestringOptional
Responses
200Success
application/json
401
Need user with one of these roles: superAdmin, admin
patch
PATCH /{companyId}/subcategories/{id} HTTP/1.1
Host:
x-w3block-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 83
{
"categoryId": "text",
"name": "text",
"tokenTemplate": {},
"certificateTemplate": "text"
}
{
"id": "text",
"companyId": "text",
"category": {
"id": "text",
"companyId": "text",
"subcategories": [
{}
],
"name": "text",
"image": "text",
"createdAt": "2025-07-03T03:54:24.252Z",
"updatedAt": "2025-07-03T03:54:24.252Z"
},
"categoryId": "text",
"name": "text",
"tokenTemplate": {
"prop1": {
"type": "SELECT",
"config": {
"required": {},
"label": "text",
"tooltip": "text",
"placeholder": "text",
"order": 1,
"childrenType": "SELECT",
"range": {
"min": 1,
"max": 1
},
"options": [
"text"
],
"float": true
},
"children": {}
},
"prop2": {
"type": "SELECT",
"config": {
"required": {},
"label": "text",
"tooltip": "text",
"placeholder": "text",
"order": 1,
"childrenType": "SELECT",
"range": {
"min": 1,
"max": 1
},
"options": [
"text"
],
"float": true
},
"children": {}
}
},
"deletedAt": "2025-07-03T03:54:24.252Z",
"createdAt": "2025-07-03T03:54:24.252Z",
"updatedAt": "2025-07-03T03:54:24.252Z",
"certificateTemplate": "text"
}
Last updated