Skip to main content

Tags

Tags are used to categorize and organize content, making it easier for users to find related items.

Schema

Tags​

Fields​

NameTypeDescriptionExample
idIDThe unique tag ID"ckmnpybisiy5x08abky4g2d1f"
titlestringA unique name which describes the tag"Important"
typeTagTypeType of resource the tag belongs toORDER, INVENTORY_ITEM, REQUISITION, TOOL
colorColorThe color of the tag in the UI. Not required, but if provided, must use one of the defined hex codes, including the # prefix"#95de64"
createdAtDateTimeWhen this object was created"2021-03-24 17:26:46.983Z"
updatedAtDateTimeWhen this object was last updated"2021-03-24 17:26:46.983Z"

Enums

TagType​

ValueDescription
ORDEROrder
INVENTORY_ITEMInventory item
REQUISITIONRequisition
TOOLTool

Color​

ValueDescription
#ff85c0magenta
#ff7875red
#ff9c6evolcano
#ffc069orange
#ffd666gold
#d3f261lime
#95de64green
#5cdbd3cyan
#69b1ffblue
#85a5ffgeekblue
#b37febpurple
#f0f0f0grey

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:

NameTypeDefaultDescriptionExample
idIDThe 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"
titlestringA unique name which describes the tag. If a tag already exists with the title, the tag color will be updated if different."1840"
colorColornullThe 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