Skip to main content

Document Sets

Group documents that belong together into sets, follow assembly groups, link a rule set, and evaluate each set as one whole through /v1/compliance/sets.

A document set holds documents that belong together, for example a contract, its order and its declaration, and is judged as one whole. Every member's text goes to each model call, so a rule that asks for another document can pass or fail instead of staying unclear. A verdict's quote names the member it comes from (document_id on the result), and its reason refers to members as [D1], [D2] and so on, in the order of the evaluation's member_ids.

A set has a source. A manual set is picked by hand. An assembly set follows an assembly group of a pipeline: its members are read anew from the group at each evaluation, and source_ref names the pipeline and group key. Changing the documents of an assembly set turns it into a hand-picked set. A set holds from 2 documents up to the configured maximum (20 by default); frameworks are not accepted as members.

Without a rule_set_id a set is judged against every rule of the ON frameworks. With one, it is judged only against that rule set's rules of ON frameworks. A set evaluation is outdated when the ON frameworks or rule count changed, when the set's rule set was swapped or edited, or when the set's documents were edited. A set evaluation can also contain consistency findings: inconsistencies between members, stored as failed results without a rule (rule_id null, codes C-01, C-02, ...).

GET/v1/compliance/sets

Set fields

idstring (uuid)The set.
namestringThe set's name.
sourcestringmanual or assembly.
source_refobject | nullFor an assembly set: { pipeline_id, group_key }.
documents[]arrayMembers, each with id, filename and display_name.
rule_set_id / rule_set_namestring | nullThe rule set the set is judged against; null means every rule of the ON frameworks.
created_atstring (date-time)When the set was created.
POST/v1/compliance/sets

Body fields

name*string1 to 200 characters.
document_ids*string[] (uuid)2 to 100 documents; the configured maximum (20 by default) applies on top. Frameworks are refused.
rule_set_idstring (uuid) | nullThe rule set to judge the set against; omitted or null means every rule of the ON frameworks.

cURL: Create a set and evaluate it

curl -X POST "https://api.talonic.com/v1/compliance/sets" \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "ACME delivery 2026-10",
    "document_ids": ["5b7e2a91-6c44-4d0f-9a3e-71c8d2f0b6a5", "a83c06d2-9e1f-4b57-8c20-4d7f1e95a6b3"],
    "rule_set_id": "e41b9d07-2c85-4a3f-b6d1-90f7c2a8e553"
  }'

curl -X POST "https://api.talonic.com/v1/compliance/sets/evaluate" \
  -H "Authorization: Bearer $TALONIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"set_ids": ["<set id from the response above>"]}'
GET/v1/compliance/sets/assembly-groups
POST/v1/compliance/sets/from-assemblies

Body fields

groups*object[]1 to 100 entries of { pipeline_id (uuid), group_key (string, up to 1000 characters) }.
rule_set_idstring (uuid) | nullThe rule set to judge the sets against; omitted or null means every rule of the ON frameworks.
PATCH/v1/compliance/sets/{setId}

Path and body

setId*string (uuid)Path parameter: the set.
namestring1 to 200 characters.
document_idsstring[] (uuid)2 to 100 documents; the configured maximum (20 by default) applies on top.
rule_set_idstring (uuid) | nullNull returns the set to every rule of the ON frameworks.
DELETE/v1/compliance/sets/{setId}
POST/v1/compliance/sets/evaluate

Body fields

set_ids*string[] (uuid)1 to 100 sets.

The response is { "data": [...] } with one evaluation per set; set_id is filled and document_id is null. Evaluating is refused with 422 when no framework with rules is ON, when the set has no documents, or when the set's rule set has no rule of a framework that is ON.

GET/v1/compliance/sets/evaluations
GET/v1/compliance/sets/{setId}/evaluation
Read member_ids together with the results. [D1] in a reason is the first id in member_ids, the order in which the decider saw the members, which can differ from the order of documents on the set.

Frequently asked questions

When should I use a document set instead of a single-document evaluation?+
Use a set when a rule needs more than one document, such as a declaration that must match an order. A single-document evaluation judges only what that document states, so a rule about another document stays not applicable or unclear there. A set puts every member in front of each call.
What is an assembly set?+
A set that follows an assembly group of a pipeline. Its members are read anew from the group at each evaluation, so it tracks the group as the pipeline changes. Editing its documents by hand turns it into a manual set.
How many documents can a set hold?+
From 2 up to the configured maximum, 20 by default. The request schema allows up to 100 ids, but the configured maximum applies on top. An assembly group with more documents keeps its first documents when a set is created from it.
Why does a set evaluation contain a result without a rule?+
It is a consistency finding: an inconsistency between members or against the frameworks' text. It is stored as a failed result with rule_id null and a code such as C-01, so the worklist, the export and other tools show it like any failed check.