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
List subcategories of a company
all
Need user with one of these roles: superAdmin, admin
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-09-01T20:43:42.636Z",
"updatedAt": "2025-09-01T20:43:42.636Z"
},
"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-09-01T20:43:42.636Z",
"createdAt": "2025-09-01T20:43:42.636Z",
"updatedAt": "2025-09-01T20:43:42.636Z",
"certificateTemplate": "text"
}
]
Create a subcategory
Create a new subcategory
Need user with one of these roles: superAdmin, admin
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-09-01T20:43:42.636Z",
"updatedAt": "2025-09-01T20:43:42.636Z"
},
"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-09-01T20:43:42.636Z",
"createdAt": "2025-09-01T20:43:42.636Z",
"updatedAt": "2025-09-01T20:43:42.636Z",
"certificateTemplate": "text"
}
Get subcategory details
Get a subcategory by id
Need user with one of these roles: superAdmin, admin
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-09-01T20:43:42.636Z",
"updatedAt": "2025-09-01T20:43:42.636Z"
},
"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-09-01T20:43:42.636Z",
"createdAt": "2025-09-01T20:43:42.636Z",
"updatedAt": "2025-09-01T20:43:42.636Z",
"certificateTemplate": "text"
}
Update subcategory
Update a subcategory by id
Need user with one of these roles: superAdmin, admin
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-09-01T20:43:42.636Z",
"updatedAt": "2025-09-01T20:43:42.636Z"
},
"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-09-01T20:43:42.636Z",
"createdAt": "2025-09-01T20:43:42.636Z",
"updatedAt": "2025-09-01T20:43:42.636Z",
"certificateTemplate": "text"
}
Last updated