Skip to content

Collection

A Collection is a Thing with members, either listed one by one or defined by a saved query.

Properties

PropertyTypeRequiredDescription
queryjsonThe saved query that defines a dynamic Collection.
Inherited from Thing: 4 properties
PropertyTypeRequiredDescription
idstringrequiredThe stable identifier, which never changes.
typelist of NounrequiredThe Nouns this Thing is an instance of.
statestringThe current state in its lifecycle.
outsidejsonThe ids this Thing has in outside tools, one per Integration, so a re-run matches instead of duplicating.

Object

JSON
{
  "$id": "https://api.sb/kilnbakery.com/collections/collection_1",
  "$type": "Collection",
  "id": "Example id",
  "type": [
    "noun_1"
  ],
  "state": "Example state",
  "outside": {},
  "query": {}
}

Relationships

  • A Collection contains many Things: Members are listed one by one or matched by the Collection’s saved query; a Thing can belong to many Collections. contains, inverse memberOf.

Verbs

  1. createCreates a Collection.
    POST /{namespace}/collectionsdoCollection.created
  2. getReturns one Collection by id.
    GET /{namespace}/collections/{id}readNo Event
  3. listReturns Collections, newest first, one page at a time.
    GET /{namespace}/collectionsreadNo Event
  4. updateChanges the given properties of a Collection.
    PATCH /{namespace}/collections/{id}doCollection.updated
  5. deleteDeletes a Collection; its history is kept.
    DELETE /{namespace}/collections/{id}doCollection.deleted
  6. exportExport writes a Collection’s records to a file or the Startup’s warehouse, once or on a schedule.
    POST /{namespace}/collections/{collection}/exportdoCollection.exported
  7. queryQuery reads any Nouns the caller’s Permissions allow, by SQL or a Relationship path, across every System in one call.
    POST /{namespace}/collections/querydoCollection.queried

Permissions

Which Access level may call each Verb. One-way Verbs wait their delay window.

Operationowneradminmemberviewer
Collection.createYesYesYesNo
Collection.getYesYesYesYes
Collection.listYesYesYesYes
Collection.updateYesYesYesNo
Collection.deleteYesYesYesNo
Collection.exportYesYesYesNo
Collection.queryYesYesYesNo

Call it

Text
Query the latest collection.

Example

The Collection "enterprise Customers" is a saved query for Customers with more than 50 seats. A new Customer at 51 seats joins it at once.