Chuyển đến nội dung

Board

client.boards là kho dữ liệu cốt lõi cho CRM pipelines — leads, deals, tasks, hoặc bất kỳ dữ liệu có cấu trúc nào. Mỗi board có các trường tùy chỉnh và items. Board cũng có thể liên kết với Knowledge Hub để tìm kiếm bằng AI.

Để xem hướng dẫn chi tiết, tham khảo DataBoards trong SDK guide.


Schema

Board

FieldTypeMô tả
object_namestring?Định danh loại đối tượng
idstringID duy nhất của board
organization_idstringTổ chức sở hữu board này
namestringTên hiển thị của board
descriptionstring?Mô tả tùy chọn
workflow_idstring?ID workflow liên kết
hiddenboolean?Board có bị ẩn hay không
team_idsstring[]?Nhóm có quyền truy cập
created_atstringISO 8601 thời gian tạo
updated_atstringISO 8601 thời gian cập nhật

BoardField

FieldTypeMô tả
_idstringID duy nhất của trường
namestringTên hiển thị của trường
typestringKiểu trường (text, number, date, select, v.v.)
optionsobject[]?Cấu hình theo kiểu
requiredboolean?Trường có bắt buộc không

CreateBoardInput

FieldTypeRequiredMô tả
namestringTên board
descriptionstringMô tả tùy chọn
typestringLoại board
fieldsobject[]Định nghĩa trường ban đầu
team_idsstring[]ID nhóm có quyền truy cập
show_idbooleanHiển thị cột ID

Methods

Board CRUD

MethodTypeScriptPythonMô tả
List boardslistlistDanh sách tất cả board
Get boardgetgetLấy board theo ID
Create boardcreatecreateTạo board mới
Update boardupdateupdateCập nhật tên/mô tả board
Delete boarddeletedeleteXóa board
Reorder boardsreorderreorderThay đổi thứ tự hiển thị

Import / Export

MethodTypeScriptPythonMô tả
Export CSVexportCsvexport_csvXuất tất cả items dưới dạng CSV
Import CSVimportCsvimport_csvNhập items từ file CSV
Import ExcelimportExcelimport_excelNhập items từ file Excel
Get import progressgetImportProgressget_import_progressKiểm tra trạng thái import đang chạy

Fields

MethodTypeScriptPythonMô tả
Create fieldcreateFieldcreate_fieldThêm cột vào board
Update fieldupdateFieldupdate_fieldSửa cấu hình trường
Delete fielddeleteFielddelete_fieldXóa trường
Reorder fieldsreorderFieldsreorder_fieldsThay đổi thứ tự cột
Bulk update fieldsbulkUpdateFieldsbulk_update_fieldsCập nhật nhiều trường cùng lúc

Items

MethodTypeScriptPythonMô tả
List itemslistItemslist_itemsDanh sách items có phân trang
Get itemgetItemget_itemLấy một item
Create itemcreateItemcreate_itemThêm item vào board
Update itemupdateItemupdate_itemCập nhật giá trị trường của item
Delete itemdeleteItemdelete_itemXóa item
Bulk deletebulkDeleteItemsbulk_delete_itemsXóa nhiều items theo ID
SearchsearchsearchTìm kiếm toàn văn trong board
Link itemslinkItemslink_itemsLiên kết item với item board khác
Unlink itemsunlinkItemsunlink_itemsXóa liên kết giữa các items

Segments

MethodTypeScriptPythonMô tả
List segmentslistSegmentslist_segmentsDanh sách các view filter đã lưu
Create segmentcreateSegmentcreate_segmentLưu filter thành segment
Update segmentupdateSegmentupdate_segmentCập nhật filter của segment
Delete segmentdeleteSegmentdelete_segmentXóa segment

list / list

const { data: boards } = await client.boards.list({ limit: 20 });
for (const board of boards) {
console.log(board.id, board.name);
}

create / create

const board = await client.boards.create({
name: "Enterprise Leads",
description: "Leads from the enterprise segment",
fields: [
{ name: "Company", type: "text" },
{ name: "Deal Size", type: "number" },
{ name: "Stage", type: "select", options: { choices: ["Prospect", "Qualified", "Closed"] } },
],
});

createItem / create_item

Truyền một mảng fields với mỗi phần tử có board_field_id (_id của BoardField) và value tương ứng.

const item = await client.boards.createItem("board_id", {
fields: [
{ board_field_id: "field_id_company", value: "Acme Corp" },
{ board_field_id: "field_id_deal_size", value: 50000 },
{ board_field_id: "field_id_stage", value: "Qualified" },
],
});

listItems / list_items

const page = await client.boards.listItems("board_id", { limit: 50, skip: 0 });
console.log(`${page.data.length} of ${page.total} items`);

Tìm kiếm toàn văn trong các items của board.

const results = await client.boards.search("board_id", {
q: "Acme",
limit: 20,
offset: 0,
});

importCsv / import_csv

const formData = new FormData();
formData.append("file", csvBlob, "leads.csv");
const result = await client.boards.importCsv("board_id", formData);
console.log(`Imported: ${result.imported}, Errors: ${result.errors}`);

createField / create_field

const field = await client.boards.createField("board_id", {
name: "Priority",
type: "select",
options: { choices: ["Low", "Medium", "High"] },
});