Connected Workers Lists

The Connected Workers Lists API lets you build structured, table‑like reference data sets at the workspace level — the generic lookup tables your operation needs that aren't places or physical assets: priorities, categories, work centers, status codes, and the like. Places live in Locations and physical assets in Assets; everything else is a list.

  • List — a table. Has a name, a key, and rows. Can be nested into a hierarchy.
  • Column — a field definition on the table (name, key, data type, ordering, display behavior).
  • Item — a row: an object mapping each column's key to its value ({ "priok": "1", "name": "Emergency" }). Rows belong to the list.
Workspace 7
└── List 30 "Priorities"  (key: priorities)
    ├── Columns:  PRIOK (key: priok, text, primary key) · Name (key: name, text, title)
    └── Items (rows):
          { "id": 1, "priok": "1", "name": "Emergency" }
          { "id": 2, "priok": "2", "name": "High" }

The model is identical across all three CW table entities. This page gives the full reference for lists; Locations documents the same mechanics in depth and is the best companion read.

Base URL & auth

Every endpoint is scoped to a workspace and served under:

https://api.treedis.com/v2/api/workspaces/{workspaceId}/cw/lists

All endpoints require authentication (OAuth2 Bearer token or API key), and the caller must have access to the workspace. workspaceId is always a numeric ID. An API key is bound to a single workspace and can only address its own.

Authentication How to obtain and send an OAuth2 access token.

Keys — address tables and columns by id or slug

Tables and columns each have a key — a URL‑safe slug (lowercase, no spaces), generated automatically from the name on create (or passed). Keys are unique within their scope and never all‑numeric.

  • Anywhere a path takes {listId} or {columnId}, pass either the numeric id or the key (e.g. …/cw/lists/priorities/columns/priok). A purely numeric value is an id; anything else is a key.
  • Rows reference columns by key — the property names in a row object are column keys.
  • Items (rows) have no key — address them by their numeric id.

Endpoints

Method Path (under /v2/api/workspaces/{workspaceId}/cw/lists) Purpose
GET / POST `` (collection) List lists / create one
POST /bulk Batch insert lists
GET / PUT / DELETE /{listId} Get / update / delete a list
POST /{listId}/bulk Batch insert into a list (columns + rows)
GET / POST /{listId}/columns List columns / create a column
GET / PUT / DELETE /{listId}/columns/{columnId} Get / update / delete a column
GET / POST /{listId}/items List rows / insert a row
GET / PUT / DELETE /{listId}/items/{itemId} Get / update / delete a row
POST /{listId}/items/truncate Truncate items (delete all rows)

List endpoints return shallow objects; the single‑list GET returns the full list with its columns (definitions) and items (rows).

Lists

Create takes no list id — the id and key are assigned and returned.

  • GET / POST /v2/api/workspaces/{workspaceId}/cw/lists
  • GET / PUT / DELETE /v2/api/workspaces/{workspaceId}/cw/lists/{listId}
Field Type Notes
name string Required. Table name.
key string URL‑safe slug. Auto‑generated from name if omitted; unique within the workspace; never all‑numeric.
status active | inactive Required.
parentId number | string | null Parent list — id or key.
curl -X POST "https://api.treedis.com/v2/api/workspaces/7/cw/lists" \
  -H "Authorization: Bearer your-access-token" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Priorities", "status": "active" }'

A single GET /{listId} (by id or key) returns the list with its columns (definitions) and items (rows):

{
  "success": true, "code": 200, "message": "Success",
  "data": {
    "id": 30, "workspaceId": 7, "key": "priorities", "name": "Priorities",
    "status": "active", "itemsCount": 2,
    "columns": [
      { "id": 41, "key": "priok", "name": "PRIOK", "type": "text", "isPrimaryKey": true, "order": 0 },
      { "id": 42, "key": "name", "name": "Name", "type": "text", "isTitle": true, "order": 1 }
    ],
    "items": [
      { "id": 1, "priok": "1", "name": "Emergency" },
      { "id": 2, "priok": "2", "name": "High" }
    ]
  }
}

Columns

Define the fields of the list. Create takes no column id; the key is derived from the name (or pass your own, unique within the list).

  • GET / POST /v2/api/workspaces/{workspaceId}/cw/lists/{listId}/columns
  • GET / PUT / DELETE …/columns/{columnId}
Field Type Notes
name string Required. Column name — unique within the list.
key string URL‑safe slug; auto‑generated from name if omitted. Used as the property name in rows.
type enum Required. See the column types below.
order number Display order.
isRequired boolean Whether a value is required.
settings object Type‑specific settings (e.g. maxLength, pattern).
status active | inactive Column status.
isTitle boolean Marks the column shown as the row's display title in the worker view. Display only.
isPrimaryKey boolean Marks the list's primary key — the column whose value uniquely identifies a row across the workspace.
isVisible boolean Whether the column shows in the UI.

Column types (type): text · number · date · checkbox · hierarchyParent (links a row to a parent row) · reference (links to another table/entity) · locationTag (ties the value to a tour location/tag) · space (a space/environment) · tagStatus (a status tag).

curl -X POST "https://api.treedis.com/v2/api/workspaces/7/cw/lists/priorities/columns" \
  -H "Authorization: Bearer your-access-token" \
  -H "Content-Type: application/json" \
  -d '{ "name": "PRIOK", "type": "text", "isRequired": true, "status": "active", "isVisible": true }'

Items (rows)

An item is a row — an object mapping each column's key to its value. Responses add the row id. Rows belong to the list.

  • GET / POST /v2/api/workspaces/{workspaceId}/cw/lists/{listId}/items
  • GET / PUT / DELETE …/items/{itemId}
# insert a row
curl -X POST "https://api.treedis.com/v2/api/workspaces/7/cw/lists/priorities/items" \
  -H "Authorization: Bearer your-access-token" \
  -H "Content-Type: application/json" \
  -d '{ "priok": "1", "name": "Emergency" }'
{ "success": true, "code": 200, "message": "Item created successfully",
  "data": { "id": 1, "priok": "1", "name": "Emergency" } }

A PUT on …/items/{itemId} updates the row's values; send only the columns you want to change. List rows with ?filter[…], ?page / ?limit, and ?sortBy / ?sortOrder.

Batch insert

Columns are matched by name/key within their list — an existing column is reused, only a new name creates a new column. A key is optional on lists and columns (omit to auto‑generate from the name).

Batch insert into a list

POST /v2/api/workspaces/{workspaceId}/cw/lists/{listId}/bulk — optionally define columns, then insert rows.

curl -X POST "https://api.treedis.com/v2/api/workspaces/7/cw/lists/priorities/bulk" \
  -H "Authorization: Bearer your-access-token" \
  -H "Content-Type: application/json" \
  -d '{
    "columns": [
      { "name": "PRIOK", "key": "priok", "type": "text" },
      { "name": "Name", "type": "text" }
    ],
    "items": [
      { "priok": "1", "name": "Emergency" },
      { "priok": "2", "name": "High" }
    ]
  }'

Batch insert lists

POST /v2/api/workspaces/{workspaceId}/cw/lists/bulk — create multiple lists at once, each with its columns and rows.

curl -X POST "https://api.treedis.com/v2/api/workspaces/7/cw/lists/bulk" \
  -H "Authorization: Bearer your-access-token" \
  -H "Content-Type: application/json" \
  -d '{
    "lists": [
      {
        "name": "Priorities", "key": "priorities", "status": "active",
        "columns": [ { "name": "PRIOK", "key": "priok", "type": "text", "isPrimaryKey": true }, { "name": "Name", "type": "text" } ],
        "items": [
          { "priok": "1", "name": "Emergency" },
          { "priok": "2", "name": "High" }
        ]
      }
    ]
  }'

The unified batch endpoint can include lists alongside locations and assets — POST /v2/api/workspaces/{workspaceId}/cw/bulk with a tables array where each table sets its own type ("type": "list" for these). See Batch insert by type.

Workspace‑owned

Lists — like locations and assets — are workspace‑owned: one set of tables per workspace, fully writable here. There is no per‑project copy or per‑project filtering; every CW table lives at the workspace and is addressed by workspaceId. If your source system exports one big lookup table (SAP and most factory systems do), send the whole thing once as a workspace batch.

POST /v2/api/workspaces/7/cw/lists/bulk
{
  "lists": [
    {
      "name": "Work Centers",
      "columns": [
        { "name": "PM_WKCTR", "type": "text", "isPrimaryKey": true },
        { "name": "Name", "type": "text" }
      ],
      "items": [
        { "pm_wkctr": "WC-100", "name": "Mechanical Shop" },
        { "pm_wkctr": "WC-200", "name": "Electrical Shop" }
      ]
    }
  ]
}

You can slice any column ad‑hoc on read with ?filter[pm_wkctr]=WC-100.

Delete & truncate

  • Delete a single recordDELETE …/lists/{listId}, …/columns/{columnId}, or …/items/{itemId}.
  • Truncate itemsPOST …/lists/{listId}/items/truncate removes all rows, keeping the list and its columns.
curl -X POST "https://api.treedis.com/v2/api/workspaces/7/cw/lists/priorities/items/truncate" \
  -H "Authorization: Bearer your-access-token"

Truncate responses report how many rows were removed (data.deleted).

Errors

Errors use the same envelope with success: false and an optional details object:

{ "success": false, "code": 400, "message": "Cannot create a hierarchical loop",
  "details": { "error": "A table cannot have a parent that would create a circular reference" } }
Status When
400 Validation failed, circular hierarchy, duplicate single‑use column type, or a key/column that can't be resolved
404 Table, column, or item not found

See the Connected Workers Lists tag in the API Reference for the full request and response schemas.