Tags
Tags are used to categorize and organize content, making it easier for users to find related items.
Schema
Tags
​
Fields​
Name | Type | Description | Example |
---|---|---|---|
id | ID | The unique tag ID | "ckmnpybisiy5x08abky4g2d1f" |
title | string | A unique name which describes the tag | "Important" |
type | TagType | Type of resource the tag belongs to | ORDER , INVENTORY_ITEM , REQUISITION , TOOL |
color | Color | The color of the tag in the UI. Not required, but if provided, must use one of the defined hex codes, including the # prefix | "#95de64" |
createdAt | DateTime | When this object was created | "2021-03-24 17:26:46.983Z" |
updatedAt | DateTime | When this object was last updated | "2021-03-24 17:26:46.983Z" |
Enums
TagType
​
Value | Description |
---|---|
ORDER | Order |
INVENTORY_ITEM | Inventory item |
REQUISITION | Requisition |
TOOL | Tool |
Color
​
Value | Description |
---|---|
#ff85c0 | magenta |
#ff7875 | red |
#ff9c6e | volcano |
#ffc069 | orange |
#ffd666 | gold |
#d3f261 | lime |
#95de64 | green |
#5cdbd3 | cyan |
#69b1ff | blue |
#85a5ff | geekblue |
#b37feb | purple |
#f0f0f0 | grey |
REST Endpoints
GET /tags
​
Get a list of all tags for an organization.
Parameters​
Accepts all standard pagination parameters.
Allowed orderBy fields: id
, createdAt
, title
, color
, updatedAt
, type
.
Allowed filter fields: id
, createdAt
, title
, color
, updatedAt
, type
.
Response​
A list of Tag
objects.
GET https://api.kojo.tech/tags
Example Response​
[
{
"title": "Important",
"color": "#f0f0f0",
"type": "ORDER",
"id": "ckmnpybisiy5x08abky4g2d1f"
},
{
"title": "Blocked",
"color": "#d3f261",
"type": "ORDER",
"id": "ckmnpybi7ag5x08abky4gdf8s"
}
]
GET /order/:orderId/tags
​
Get a list of all tags for an order.
Parameters​
Accepts all standard pagination parameters.
Allowed orderBy fields: id
, createdAt
, title
, color
, updatedAt
, type
.
Allowed filter fields: id
, createdAt
, title
, color
, updatedAt
, type
.
Response​
A list of Tag
objects.
GET https://api.kojo.tech/order/:orderId/tags
Example Response​
[
{
"title": "Important",
"color": "#b37feb",
"type": "ORDER",
"id": "ckmnpybisiy5x08abky4g2d1f"
},
{
"title": "Blocked",
"color": "#f0f0f0",
"type": "ORDER",
"id": "ckmnpybi7ag5x08abky4gdf8s"
}
]
POST /order/:orderId/tags
​
Creates new or uses existing tags to add to an order.
- To create and add a new tag to the order, do not provide an ID but do provide a unique, new title.
- To add an existing tag to the order, either provide the tag's ID, or, provide the exact case-sensitive title.
Parameters​
Request body should contain an array of one or more tags:
Name | Type | Default | Description | Example |
---|---|---|---|---|
id | ID | The unique tag ID. This will be auto-generated if not provided. If provided and a tag already exists with the ID, the tag color will be updated if different. | "ckmnpybisiy5x08abky4g2d1f" | |
title | string | A unique name which describes the tag. If a tag already exists with the title, the tag color will be updated if different. | "1840" | |
color | Color | null | The color of the tag in the UI. Not required, but if provided, must use one of the defined hex codes, including the # prefix | "#95de64" |
Example Request Body​
[
{
"title": "Important",
"color": "#d3f261"
},
{
"id": "ckmnpybi7ag5x08abky4gdf8s"
}
]
Response​
A list of Tag
objects which were added the order.
POST https://api.kojo.tech/order/:orderId/tags
Example Response​
[
{
"title": "Important",
"color": "#d3f261",
"id": "ckmnpybisiy5x08abky4g2d1f"
},
{
"title": "Blocked",
"color": "#b37feb",
"id": "ckmnpybi7ag5x08abky4gdf8s"
}
]
DELETE /order/:orderId/tags/:tagId
​
Removes the tag from the order.
info
The tag itself is not deleted and will not affect other resources utilizing it.
Response​
A boolean of true
if successful.
DELETE https://api.kojo.tech/order/:orderId/tags/:tagId
Example Response​
true