Skip to content

Tag ​

Tags attachable to business entities

INFO

Каждый ответ приходит в общем конверте — code, message, messages, status_code, time — а полезная нагрузка лежит в data. Таблицы ниже описывают содержимое data.

POST /tag/create ​

Create a new tag. Tags can be scoped to one or more entity types (customer, supplier, product, employee, crm_order). is_active defaults to true.

Тело запроса

ПолеТипОбязательноОписание
namestringДаTag display name
entity_scopesstring[]ДаEntity types this tag can be applied to — at least one required
colorstringНетHex color code, format #RRGGBB (e.g. #FF5733)
is_activebooleanНетWhether this tag is active. Defaults to true.
json
{
  "name": "string",
  "entity_scopes": [
    "customer"
  ],
  "color": "string",
  "is_active": false
}

Ответ

ПолеТипОписание
_idstringTag ObjectId
namestringTag display name
colorstringHex color code, format #RRGGBB (e.g. #FF5733)
entity_scopesstring[]Entity types this tag can be applied to
is_systembooleanSystem tags are created by Bito and cannot be deleted
is_activebooleanWhether this tag is active and available for use
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "_id": "string",
    "name": "string",
    "color": "string",
    "entity_scopes": [
      "customer"
    ],
    "is_system": false,
    "is_active": false
  },
  "time": "2025-05-01T12:00:00Z"
}

GET /tag/get-by-id/{id} ​

Fetch a single tag by its ObjectId.

Параметры пути

ПараметрТипОбязательноОписание
idstringДаTag ObjectId

Тело запроса

Тело запроса не требуется.

Ответ

Структура ответа совпадает с POST /tag/create.

POST /tag/get-paging ​

Paginated list of tags. Filter by entity_scopes and/or is_active.

Тело запроса

ПолеТипОбязательноОписание
pagenumberДаПо умолчанию: 1
limitnumberДаПо умолчанию: 20
entity_scopesstring[]НетFilter by entity type(s)
is_activebooleanНетFilter by active state. Omit to return all tags.
json
{
  "page": 1,
  "limit": 20,
  "entity_scopes": [
    "customer"
  ],
  "is_active": false
}

Ответ

ПолеТипОписание
totalnumber
listobject[]
list[]._idstringTag ObjectId
list[].namestringTag display name
list[].colorstringHex color code, format #RRGGBB (e.g. #FF5733)
list[].entity_scopesstring[]Entity types this tag can be applied to
list[].is_systembooleanSystem tags are created by Bito and cannot be deleted
list[].is_activebooleanWhether this tag is active and available for use
json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": {
    "total": 0,
    "list": [
      {
        "_id": "string",
        "name": "string",
        "color": "string",
        "entity_scopes": [],
        "is_system": false,
        "is_active": false
      }
    ]
  },
  "time": "2025-05-01T12:00:00Z"
}

PUT /tag/update/{id} ​

Update an existing tag by ObjectId. All fields are optional; only provided fields are updated. entity_scopes must have at least one value if provided.

Параметры пути

ПараметрТипОбязательноОписание
idstringДаTag ObjectId to update

Тело запроса

ПолеТипОбязательноОписание
namestringНетUpdated tag display name
entity_scopesstring[]НетUpdated entity scopes — at least one required if provided
colorstringНетUpdated hex color code, format #RRGGBB
is_activebooleanНетToggle tag active state
json
{
  "name": "string",
  "entity_scopes": [
    "customer"
  ],
  "color": "string",
  "is_active": false
}

Ответ

Структура ответа совпадает с POST /tag/create.

DELETE /tag/delete/{id} ​

Soft-delete a tag by ObjectId (sets is_deleted=true). Returns 400 if the tag is a system tag (is_system=true) — system tags cannot be deleted.

Параметры пути

ПараметрТипОбязательноОписание
idstringДаTag ObjectId to delete

Тело запроса

Тело запроса не требуется.

Ответ

json
{
  "code": 0,
  "message": "Success",
  "status_code": 200,
  "data": "ok",
  "time": "2025-05-01T12:00:00Z"
}

Эта страница сгенерирована из спецификации OpenAPI.

Bito 2.0 Integration API