Skip to main content

Collections configuration

Every document carries labels such as relationship:client or channel:mail, derived from its parties and the workspace's relationship directory. A collection with a match holds every document that carries all of its labels, and an only limit narrows who may read the documents it holds. These tools read and change that setup as one document, and explain or correct where a single document sits.

The usual loop: `talonic_collections_get_config` (or `talonic_collections_propose` for a first draft), edit the document, then `talonic_collections_apply_config`. Apply previews by default: it reports every problem at once, what would be created, changed and removed, and for each limit how many documents it hides from how many people. Show that to the user and apply with dry_run: false only once they agree.

These tools are listed only when the connection can read the collections configuration. Every call is checked against the role and permissions of the person behind the connection, exactly as in the web app: applying a configuration, proposing one and correcting the directory need an Admin of the workspace.

talonic_collections_get_config

The workspace's collections as one configuration document: each keyed collection with its name, the labels it sorts by (match, or any for several label sets) and its children, plus relationship kinds, own domains and whether relationships may be inferred. Limits (only), configured directory entries and default views appear for a workspace owner only.

talonic_collections_apply_config

Apply a configuration document. Collections are matched by their path of keys, so applying the same document twice changes nothing; a top-level key left out leaves that part of the workspace as it is. Nothing is saved unless dry_run is false.

ParameterTypeDescription
documentobjectThe configuration document (`version: 1`, `collections`, …). Pass this or `yaml`.
yamlstringThe same document as YAML or JSON text.
dry_runbooleanCheck and preview only; false saves the change. Default: `true`
prunebooleanRemove keyed collections the document does not name (refused for one that still has a limit or documents placed by hand).

talonic_collections_propose

A configuration document built from the workspace's own documents, as far as the person may read them: one top-level collection per channel, children for common labels, and suggested relationship kinds. Saves nothing and never proposes a limit.

talonic_collections_explain_document

Why one document sits where it does: each label, whether it was derived or set by a person, the evidence the person may see behind it, and each collection it is in with why (rule, hand or held by a limit while its labels settle).

ParameterTypeDescription
document_id *UUIDThe document.

talonic_collections_set_labels

Add and remove labels on one document by hand. A person's labels are kept whenever the document's labels are derived again. Refused when the change would move the document into or out of a limited collection the person may not manage.

ParameterTypeDescription
document_id *UUIDThe document.
addstring[]Labels to add (at most 50).
removestring[]Labels to remove (at most 50).

talonic_collections_move_document

Take one document out of a collection, put it into one, or both. A collection that sorts by labels keeps the document out once it is moved out.

ParameterTypeDescription
document_id *UUIDThe document.
fromUUIDThe collection to leave.
toUUIDThe collection to join.

talonic_collections_set_parties

Hand over one document's parties as your system has them, the way a connected mailbox does at import. The document's labels are derived again at once; only a complete list whose every party is the workspace's own makes a document internal.

ParameterTypeDescription
document_id *UUIDThe document.
parties *object[]`{ id, role? }`: `id` is `email:…`, `domain:…`, `phone:…`, `handle:…` or `entity:…`; `role` is from, to, cc, attendee or author. At most 500.
completebooleantrue: the list names every party.

talonic_collections_list_directory

Who is who: each identifier with what that party is to the workspace and where that came from (person, config, record or read), shown only where the person may see its evidence.

talonic_collections_save_directory

Set directory entries as a person's correction and remove entries by id. The documents of every identifier touched are labelled again.

ParameterTypeDescription
entriesobject[]`{ match_value, relationship }`: a typed identifier and a relationship kind's slug, or `own` / `other`. At most 200.
removeUUID[]Entry ids to remove (from talonic_collections_list_directory).
waitbooleanWait up to 60 seconds for the documents to be labelled again.