Update Taxonomy Block
/extensions/roboledger/{graph_id}/operations/update-taxonomy-blockPart of Extensions: RoboLedger.
Incrementally mutate a taxonomy block via typed delta lists (elements/structures/associations/rules to add, update, remove). Dispatches by the target taxonomy's stored taxonomy_type. For a chart of accounts: add, rename and reclassify accounts freely; an account with facts or line items is never removed — retire it with elements_to_update[].is_active=false (history stays, new postings are refused, pickers hide it; true reactivates). Removal and whole-chart delete work only with no activity. Library-origin block types (reporting_standard) surface 501. reporting_extension / custom_ontology authoring may be disabled per environment (TAXONOMY_AUTHORING_ENABLED) — disabled surfaces 403. Closed months are immutable against curation: a mapping arc added or removed for an account with landed history in a closed month, or a balance_type / period_type / trait change on such an account, is refused (422, protected_facts) naming the months to reopen first.
Idempotency: supply an Idempotency-Key header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
Authentication
Authenticate in any one of these ways — not all of them:
- API key in the
X-API-Keyheader. - Bearer token in the
Authorizationheader.
Path parameters
| Name | Type | Description |
|---|---|---|
graph_idrequired | string | Graph Id |
Header parameters
| Name | Type | Description |
|---|---|---|
Idempotency-Keyoptional | string | Idempotency-Key |
Request body
Required, application/json.
| Field | Type | Description | |||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
taxonomy_idrequired | string | ||||||||||||||||||||||||||||||||||||||||
nameoptional | string | ||||||||||||||||||||||||||||||||||||||||
descriptionoptional | string | ||||||||||||||||||||||||||||||||||||||||
versionoptional | string | ||||||||||||||||||||||||||||||||||||||||
elements_to_addoptional | TaxonomyBlockElementRequest[] | Element definition inside a Taxonomy Block envelope. ``qname`` is the envelope-local identifier — must be unique within the envelope's ``elements`` list and is used by association / rule / patch payloads as the reference token. ``parent_ref`` may reference another envelope-local qname or, for ``reporting_extension`` blocks, a library element qname. TaxonomyBlockElementRequest fields
| |||||||||||||||||||||||||||||||||||||||
elements_to_updateoptional | ElementUpdatePatch[] | Partial-update patch for a single element, keyed by qname. ElementUpdatePatch fields
| |||||||||||||||||||||||||||||||||||||||
elements_to_removeoptional | string[] | qnames of elements to remove. | |||||||||||||||||||||||||||||||||||||||
structures_to_addoptional | TaxonomyBlockStructureRequest[] | Structure definition inside a Taxonomy Block envelope. TaxonomyBlockStructureRequest fields
| |||||||||||||||||||||||||||||||||||||||
structures_to_updateoptional | StructureUpdatePatch[] | Partial-update patch for a single structure, keyed by structure_id. ``concept_arrangement`` makes a mis-CAP'd structure repairable in place (e.g. promoting a ``set`` note to ``roll_up`` so it gains a footing rule); ``block_type`` stays immutable — it drives block-type routing, so changing it is a re-create, not an edit. StructureUpdatePatch fields
| |||||||||||||||||||||||||||||||||||||||
structures_to_removeoptional | string[] | Structure ids to remove. | |||||||||||||||||||||||||||||||||||||||
associations_to_addoptional | TaxonomyBlockAssociationRequest[] | Association (arc) between two elements, scoped to a structure. TaxonomyBlockAssociationRequest fields
| |||||||||||||||||||||||||||||||||||||||
associations_to_removeoptional | string[] | Association ids to remove. | |||||||||||||||||||||||||||||||||||||||
rules_to_addoptional | TaxonomyBlockRuleRequest[] | Rule definition inside a Taxonomy Block envelope. Exactly one of ``target_structure_ref``, ``target_element_qname``, or ``target_taxonomy_self`` must be set (or all null for a global rule). The ``model_validator`` enforces this contract at the Pydantic layer. Only **arithmetic** rule patterns are user-creatable via this API (the ``rule_pattern`` Literal below). The 6 model-structure check kinds (``NoCycles``, ``NoOrphanArcs``, ``ParentBeforeChild``, ``LeafHasClassification``, ``LibraryOriginImmutability``, ``UniqueQNameInTaxonomy``) are system-managed — they're auto-emitted by :func:`emit_auto_rules` at taxonomy-block creation time and populate ``rules.rule_check_kind`` instead of ``rule_pattern``. TaxonomyBlockRuleRequest fields
| |||||||||||||||||||||||||||||||||||||||
rules_to_removeoptional | string[] | Rule ids to remove. |
Example request
curl -X POST "https://api.robosystems.ai/extensions/roboledger/{graph_id}/operations/update-taxonomy-block" \
-H "X-API-Key: $ROBOSYSTEMS_API_KEY" \
-H "Idempotency-Key: <Idempotency-Key>" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme CoA (v2)",
"taxonomy_id": "tax_acme_coa",
"version": "2.0"
}'Responses
200 Successful Response
| Field | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
operationrequired | string | Kebab-case operation name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
operationIdrequired | string | op_-prefixed ULID for audit and SSE correlation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
statusrequired | string | Operation lifecycle state One of: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
resultoptional | TaxonomyBlockEnvelope | Command-specific result payload TaxonomyBlockEnvelope fields
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
atrequired | string | ISO-8601 UTC timestamp | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
createdByoptional | string | User ID that initiated the operation (null for legacy callers) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
idempotentReplayoptional | boolean | True when this envelope came from the idempotency cache — the underlying command did not execute again. False on fresh executions. Default: |
| Status | Meaning |
|---|---|
| 400 | Invalid request |
| 401 | Authentication required |
| 403 | Access denied |
| 404 | Resource not found |
| 409 | Idempotency-Key conflict — key reused with different body |
| 422 | Validation error |
| 429 | Rate limit exceeded |
| 500 | Internal server error |