Skip to main content

Assembly Configs

Configure how a Spec composes grouped documents into one record with an anchor plus amendments. List, create, update, and delete assembly profiles.

An assembly config tells a Spec how to compose several documents that belong together into a single composed record. Documents are grouped by grouping_field. Within a group, the anchor_field (matched against anchor_values) identifies the base document, and amendment documents may override only the fields listed in amendable_fields. Conflicts are resolved by override_rule_id, which defaults to newer-signed-overrides.

This is the configuration behind the Assembly stage of the Spec rail. A common shape is a base contract plus signed amendments: the base is the anchor, later signed amendments override the negotiated terms, and signed_field plus date_field drive the conflict ordering. Each Spec holds one row per assembly profile.

GET/v1/schemas/{id}/assembly-configs
POST/v1/schemas/{id}/assembly-configs
PATCH/v1/schemas/{id}/assembly-configs/{configId}
DELETE/v1/schemas/{id}/assembly-configs/{configId}

Response

Assembly config fields

idstringAssembly config UUID.
schema_idstringSpec (schema) UUID this config belongs to.
namestring | nullProfile name.
grouping_fieldstring | nullField that groups documents into one composed record.
anchor_fieldstring | nullField identifying the anchor document.
anchor_valuesstring[]Values that mark the anchor.
signed_fieldstring | nullField indicating signed status.
date_fieldstring | nullField used to order documents by date.
amendable_fieldsstring[]Fields an amendment may override.
override_rule_idstringConflict-resolution rule id.
created_atstringISO 8601 creation timestamp.
updated_atstringISO 8601 update timestamp.

Response (POST create)

{
  "id": "ab12cd34-ef56-7890-abcd-ef1234567890",
  "schema_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "name": "Contract + amendments",
  "grouping_field": "contract_number",
  "anchor_field": "document_kind",
  "anchor_values": ["base_contract"],
  "signed_field": "is_signed",
  "date_field": "effective_date",
  "amendable_fields": ["price", "term_months", "renewal_terms"],
  "override_rule_id": "newer-signed-overrides",
  "created_at": "2024-09-14T10:32:00.000Z",
  "updated_at": "2024-09-14T10:32:00.000Z"
}

PATCH and DELETE return { "ok": true }.

amendable_fields is a whitelist. An amendment document can only override the fields you list here. Everything else stays as it is on the anchor document, even if the amendment carries a value.

Errors

Error responses

400validation_errorInvalid body, or a field exceeds its length limit.
401unauthorizedMissing or invalid API key.
404not_foundNo Spec (schema) with this ID exists for your organization.
429rate_limitedToo many requests. Retry after the period indicated in the Retry-After header.