Create Taxonomy Block
/extensions/roboledger/{graph_id}/operations/create-taxonomy-blockPart of Extensions: RoboLedger.
Create a taxonomy block atomically: one envelope carrying the taxonomy row plus its structures, elements, associations, and rules. Dispatches by taxonomy_type — chart_of_accounts (declarative tenant CoA), reporting_extension, and custom_ontology are supported; reporting_standard is library-origin (501). reporting_extension / custom_ontology authoring may be disabled per environment (TAXONOMY_AUTHORING_ENABLED) — disabled surfaces 403. NOT the path for a functional close schedule: a structure with block_type='schedule' here is a bare ontology row with none of the schedule machinery (per-period facts, schedule_entry_due obligations, closing-entry generator). To create a working schedule use create-information-block(block_type='schedule').
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 | |||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
namerequired | string | Taxonomy display name. | |||||||||||||||||||||||||||||||||||||||
taxonomy_typerequired | string | Block-type discriminator. ``chart_of_accounts`` and ``custom_ontology`` construct from scratch; ``reporting_extension`` extends an existing library ``reporting_standard``. One of: | |||||||||||||||||||||||||||||||||||||||
parent_taxonomy_idoptional | string | Required when ``taxonomy_type == 'reporting_extension'`` — the id of the library ``reporting_standard`` being extended. | |||||||||||||||||||||||||||||||||||||||
versionoptional | string | ||||||||||||||||||||||||||||||||||||||||
descriptionoptional | string | ||||||||||||||||||||||||||||||||||||||||
standardoptional | string | ||||||||||||||||||||||||||||||||||||||||
namespace_urioptional | string | ||||||||||||||||||||||||||||||||||||||||
elementsoptional | 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
| |||||||||||||||||||||||||||||||||||||||
structuresoptional | TaxonomyBlockStructureRequest[] | Structure definition inside a Taxonomy Block envelope. TaxonomyBlockStructureRequest fields
| |||||||||||||||||||||||||||||||||||||||
associationsoptional | TaxonomyBlockAssociationRequest[] | Association (arc) between two elements, scoped to a structure. TaxonomyBlockAssociationRequest fields
| |||||||||||||||||||||||||||||||||||||||
rulesoptional | 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
| |||||||||||||||||||||||||||||||||||||||
metadataoptional | object |
Example request
curl -X POST "https://api.robosystems.ai/extensions/roboledger/{graph_id}/operations/create-taxonomy-block" \
-H "X-API-Key: $ROBOSYSTEMS_API_KEY" \
-H "Idempotency-Key: <Idempotency-Key>" \
-H "Content-Type: application/json" \
-d '{
"elements": [
{
"balance_type": "debit",
"code": "1000",
"name": "Cash",
"qname": "acme:Cash",
"trait": "asset"
},
{
"balance_type": "credit",
"code": "2000",
"name": "Accounts Payable",
"qname": "acme:AccountsPayable",
"trait": "liability"
}
],
"name": "Acme CoA",
"structures": [
{
"block_type": "chart_of_accounts",
"name": "main"
}
],
"taxonomy_type": "chart_of_accounts"
}'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 |