Browse the API reference

Update Taxonomy Block

post/extensions/roboledger/{graph_id}/operations/update-taxonomy-block

Part 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-Key header.
  • Bearer token in the Authorization header.

Path parameters

NameTypeDescription
graph_idrequiredstringGraph Id

Header parameters

NameTypeDescription
Idempotency-KeyoptionalstringIdempotency-Key

Request body

Required, application/json.

FieldTypeDescription
taxonomy_idrequiredstring
nameoptionalstring
descriptionoptionalstring
versionoptionalstring
elements_to_addoptionalTaxonomyBlockElementRequest[]

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
FieldTypeDescription
qnamerequiredstring

Envelope-local element identifier. Must be unique within the envelope's ``elements`` list. Used as the reference token for associations, rules, and update patches.

namerequiredstring

Human-readable element name (e.g. 'Total Assets').

traitoptionalstring

FASB metamodel trait for the element. Required for ``chart_of_accounts`` blocks; optional for ``custom_ontology``.

balance_typeoptionalstring

'debit' | 'credit' | null for non-monetary concepts.

element_typeoptionalstring

'concept' | 'abstract' | 'axis' | 'member' | 'hypercube'.

Default: concept

period_typeoptionalstring

'instant' | 'duration' | null (null = derive from classification during validation).

is_monetaryoptionalboolean

True for dollar-denominated concepts.

Default: true

descriptionoptionalstring
codeoptionalstring

Optional chart-of-accounts code (e.g. '1000', '4100-02'). Only meaningful for ``chart_of_accounts`` blocks.

sub_classificationoptionalstring
parent_refoptionalstring

qname of the parent element — either another envelope-local qname or, for ``reporting_extension`` blocks, a library element qname.

metadataoptionalobject
elements_to_updateoptionalElementUpdatePatch[]

Partial-update patch for a single element, keyed by qname.

ElementUpdatePatch fields
FieldTypeDescription
qnamerequiredstring

qname identifier of the element to update.

nameoptionalstring
descriptionoptionalstring
traitoptionalstring
balance_typeoptionalstring
period_typeoptionalstring
is_monetaryoptionalboolean
codeoptionalstring
parent_refoptionalstring
metadataoptionalobject
is_activeoptionalboolean

Retire (`false`) or reactivate (`true`) a chart account. Retiring keeps its history and hides it from account pickers and the chart tree, and new line items on it are refused — the way to take an account with activity out of use, since removal needs no facts and no line items.

elements_to_removeoptionalstring[]

qnames of elements to remove.

structures_to_addoptionalTaxonomyBlockStructureRequest[]

Structure definition inside a Taxonomy Block envelope.

TaxonomyBlockStructureRequest fields
FieldTypeDescription
namerequiredstring

Envelope-local structure name (unique within envelope).

block_typerequiredstring

DB ``structures.block_type`` enum. CoA blocks use ``chart_of_accounts``; reporting extensions use the statement family, ``regulatory_disclosure`` (disclosure notes), or ``custom``; custom ontology uses ``custom``.

One of: chart_of_accounts, custom, balance_sheet, income_statement, cash_flow_statement, equity_statement, coa_mapping, schedule, rollforward, reconciliation, policy, metric, regulatory_disclosure

concept_arrangementoptionalstring

Concept Arrangement Pattern (CAP) — how the structure's concepts relate (mirrors the ``structures.concept_arrangement`` CHECK vocabulary). A disclosure note footing members to a total is ``roll_up``. Null leaves the pattern unset.

One of: set, roll_up, roll_forward, roll_forward_info, adjustment, variance, arithmetic, text_block, level1_textblock, level2_textblock, level3_textblock, level4_detail, table_equivalent_textblock, grid, compound_fact

descriptionoptionalstring
role_urioptionalstring
metadataoptionalobject
structures_to_updateoptionalStructureUpdatePatch[]

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
FieldTypeDescription
structure_idrequiredstring

Structure id to update.

nameoptionalstring
descriptionoptionalstring
role_urioptionalstring
concept_arrangementoptionalstring

One of: set, roll_up, roll_forward, roll_forward_info, adjustment, variance, arithmetic, text_block, level1_textblock, level2_textblock, level3_textblock, level4_detail, table_equivalent_textblock, grid, compound_fact

metadataoptionalobject
structures_to_removeoptionalstring[]

Structure ids to remove.

associations_to_addoptionalTaxonomyBlockAssociationRequest[]

Association (arc) between two elements, scoped to a structure.

TaxonomyBlockAssociationRequest fields
FieldTypeDescription
structure_refrequiredstring

Envelope-local structure name (references a structure declared in the same envelope).

from_refrequiredstring

qname of the source element.

to_refrequiredstring

qname of the target element.

association_typerequiredstring

DB ``associations.association_type`` enum. ``presentation`` = parent-child hierarchy; ``calculation`` = summation arc.

One of: presentation, calculation, mapping, equivalence, general-special, essence-alias

order_valueoptionalnumber
arcroleoptionalstring
weightoptionalnumber

Calculation-arc coefficient (+1 / -1 for summation, other values for weighted rollups). Null for non-calculation arcs.

metadataoptionalobject
associations_to_removeoptionalstring[]

Association ids to remove.

rules_to_addoptionalTaxonomyBlockRuleRequest[]

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
FieldTypeDescription
namerequiredstring

Rule identifier, unique within envelope.

descriptionoptionalstring
rule_categoryrequiredstring

One of 8 cm:VerificationRule subclasses.

One of: AutomatedAccountingAndReportingChecks, DisclosureMechanicsRule, FundamentalAccountingConceptRelation, PeerConsistencyRule, PriorPeriodConsistencyRule, ReportLevelModelStructureRule, ReportingSystemSpecificRule, ToDoManualTask, XBRLTechnicalSyntaxRule

rule_patternrequiredstring

One of the cm:BusinessRulePattern mechanisms. 'Derive' rules COMPUTE a value from bound operand facts (compute-metrics) rather than verify one — the tenant-authored-metric pattern.

One of: Adjustment, CoExists, Derive, EqualTo, Exists, GreaterThan, GreaterThanOrEqualToZero, LessThan, RollForward, RollUp, SumEquals, Variance

expressionrequiredstring

XPath-flavored predicate body (the rule expression).

variablesoptionalobject[]

``$Variable`` → qname bindings. Each entry is ``{'variable_name': str, 'variable_qname': str}``.

severityoptionalstring

One of: info, warning, error

Default: error

target_structure_refoptionalstring

Envelope-local structure name this rule targets (for structure-scoped rules). Mutually exclusive with the other target_* fields.

target_element_qnameoptionalstring

qname of the element this rule targets. Mutually exclusive with the other target_* fields.

target_taxonomy_selfoptionalboolean

True iff the rule targets the envelope's own taxonomy row (``target_kind='taxonomy'``). Mutually exclusive with the other target_* fields.

Default: false

messageoptionalstring
metadataoptionalobject
rules_to_removeoptionalstring[]

Rule ids to remove.

Example request

curl
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

FieldTypeDescription
operationrequiredstring

Kebab-case operation name

operationIdrequiredstring

op_-prefixed ULID for audit and SSE correlation

statusrequiredstring

Operation lifecycle state

One of: completed, pending, failed

resultoptionalTaxonomyBlockEnvelope

Command-specific result payload

TaxonomyBlockEnvelope fields
FieldTypeDescription
idrequiredstring

Taxonomy row id.

namerequiredstring
taxonomy_typerequiredstring

Block-type discriminator — 'reporting_standard' | 'reporting_extension' | 'chart_of_accounts' | 'custom_ontology'.

display_namerequiredstring

Registry-sourced display label.

categoryrequiredstring

Registry-sourced sidebar grouping.

parent_taxonomy_idoptionalstring
parent_taxonomy_nameoptionalstring
versionoptionalstring
standardoptionalstring
namespace_urioptionalstring
is_lockedoptionalboolean

Default: false

elementsoptionalTaxonomyBlockElement[]

Element projection for the Taxonomy Block envelope.

TaxonomyBlockElement fields
FieldTypeDescription
idrequiredstring
qnameoptionalstring
namerequiredstring
traitoptionalstring
balance_typeoptionalstring
period_typeoptionalstring
element_typeoptionalstring

Default: concept

is_monetaryoptionalboolean

Default: true

parent_qnameoptionalstring
depthoptionalinteger
originrequiredstring

Provenance — 'library' if the element's taxonomy is locked (``is_locked=true``), else 'tenant'.

One of: library, tenant

structuresoptionalTaxonomyBlockStructure[]

Structure projection for the Taxonomy Block envelope.

TaxonomyBlockStructure fields
FieldTypeDescription
idrequiredstring
namerequiredstring
block_typerequiredstring
descriptionoptionalstring
role_urioptionalstring
associationsoptionalTaxonomyBlockAssociation[]

Association projection for the Taxonomy Block envelope.

TaxonomyBlockAssociation fields
FieldTypeDescription
idrequiredstring
structure_idrequiredstring
from_element_qnamerequiredstring
to_element_qnamerequiredstring
association_typerequiredstring
order_valueoptionalnumber
arcroleoptionalstring
weightoptionalnumber
rulesoptionalTaxonomyBlockRule[]

Rule projection for the Taxonomy Block envelope. Exactly one of ``rule_pattern`` (arithmetic) or ``rule_check_kind`` (model-structure) is non-null per row, enforced by the ``check_rule_pattern_kind_xor`` DB constraint.

TaxonomyBlockRule fields
FieldTypeDescription
idrequiredstring
namerequiredstring
rule_categoryrequiredstring
rule_patternoptionalstring
rule_check_kindoptionalstring
rule_expressionrequiredstring
severityoptionalstring

Default: error

originoptionalstring

'forked' | 'native' | 'auto' — matches DB CHECK.

Default: native

target_kindoptionalstring
target_refoptionalstring

Polymorphic display string — structure_id, element qname, association_id, or taxonomy_id depending on ``target_kind``.

verification_resultsoptionalobject[]
element_countoptionalinteger

Default: 0

structure_countoptionalinteger

Default: 0

association_countoptionalinteger

Default: 0

atrequiredstring

ISO-8601 UTC timestamp

createdByoptionalstring

User ID that initiated the operation (null for legacy callers)

idempotentReplayoptionalboolean

True when this envelope came from the idempotency cache — the underlying command did not execute again. False on fresh executions.

Default: false

StatusMeaning
400Invalid request
401Authentication required
403Access denied
404Resource not found
409Idempotency-Key conflict — key reused with different body
422Validation error
429Rate limit exceeded
500Internal server error