Skip to main content

Knowledge Objects in actions

Actions can read and write Knowledge Object instances through the KnowledgeObject client, exposed by the action SDK. It calls the same governed instance operations as the REST API — validation, options, filters, and versioning all apply — and runs as the action’s user, on the action’s project.
Instances are addressed by their opaque _key (returned by get, list, and create). Operations run on the main branch by default; pass branch= to target another branch.

Constructing a client

  • name — the object’s name (e.g. "Employee").
  • branch — (optional) branch to read/write on. Defaults to the project’s main branch.

Methods

get

Fetch a single instance by its _key. Pass add_relationships=True to also resolve the object’s relationship fields (one level deep) under an _relationships key.

list

Returns an iterator over pages; each page exposes .items (a list of instance dicts) and .total_count. Pages are fetched lazily as you iterate.
  • filters — a list of {"column", "operator", "value"} objects, combined with AND. Operators: equal, not_equal, contains, not_contains, greater_than, less_than.
  • fields — restrict the columns returned (the meta fields _key and _version are always included).

update

Partially update an instance by its _key; returns the full updated instance. Primary key fields cannot be changed.

delete

Delete an instance by its _key.

batch_upsert

Insert or update up to 1000 instances in one call. A payload whose primary key does not exist is inserted; one that already exists is updated (a new version). Returns a summary.

Full example

Next steps