Ontology API reference
Impact preview, versioned saves with breaking-change confirmation, proposals, and actions from suggested inputs to invocation.
This page lists the ontology API: changing object types, link types and interfaces safely, and defining and invoking actions. For how these work in the product, read Changing the ontology safely and Actions. For authentication, read API fundamentals.
Paths are under:
/api/v1/vegagraph/orgs/{org_id}/workspaces/{workspace_id}In the ontology routes, kind is object_type, link_type or interface.
Preview impact
POST /vegagraph/ontology:preview-impactNothing is saved by a preview.
{
"kind": "object_type",
"key": "party",
"op": "put",
"definition": { "key": "party", "display_name": "Party", "...": "..." }
}| Field | Description |
|---|---|
kind | object_type, link_type or interface. |
key | The definition's key. |
op | put (default) or delete. |
definition | The definition as it would be saved. |
Response:
{
"impact": {
"kind": "object_type",
"key": "party",
"op": "put",
"classification": "breaking",
"classes": [
{ "class": "property_type_changed", "property": "risk_score", "level": "breaking" }
],
"dependents": {
"object_types": [],
"actions": [{ "key": "escalate_party", "broken_properties": ["risk_score"] }],
"link_types": [],
"interfaces": [],
"hidden_count": 2
},
"consumers": { "by_type": {}, "hidden_count": 0, "truncated": false }
},
"requires_accept_breaking": true,
"ontology_direct_edits": true,
"proposal_required": false,
"can_publish_directly": true,
"could_not_check": []
}| Field | Description |
|---|---|
impact.classes | Each change class with its level. See Compatible and breaking changes for the class names. |
impact.dependents | Readable definitions that depend on this one, plus hidden_count. |
impact.consumers | Readable things built on the definition, with its own hidden_count. |
could_not_check | What the preview could not look at. |
can_publish_directly | Whether the change can go live now. See below. |
can_publish_directly
It is false when the workspace requires proposals, or when an interface no longer fits a type that implements it.
It can also be false only because could_not_check contains action_dependencies_unchecked, meaning some actions could not be read. That case is advice, not a block: the server still accepts a compatible change. Deleting an object type or interface in this state is refused, because the check is needed to know what would break.
A preview that would be too large to compute fails with 422 rather than publishing without a check.
Save a definition
PUT /vegagraph/ontology/object-types/party{ "definition": { "key": "party", "...": "..." }, "expected_version": 4 }An update must name the version it replaces in expected_version. Without it the save is refused with 428. A save against an out-of-date version returns 412; load the newer version first.
Confirm a breaking change
A breaking direct save is refused first:
HTTP/1.1 409 Conflict{
"code": "ontology_breaking_confirmation_required",
"message": "publication is breaking; review impact and set accept_breaking",
"impact": { "classification": "breaking", "classes": [ { "class": "property_removed", "property": "risk_band", "level": "breaking" } ] },
"dependents": { "object_types": [], "actions": [ { "key": "escalate_party", "broken_properties": ["risk_band"] } ], "link_types": [], "interfaces": [], "hidden_count": 0 }
}Show the impact to the person. If they agree, send the same request again with accept_breaking:
{ "definition": { "key": "party", "...": "..." }, "expected_version": 4, "accept_breaking": true }Link type and interface saves take the same field. The accepted version is recorded in the definition's history.
accept_breaking acknowledges breaking classes only. It does not override:
- the workspace setting that requires proposals;
- a type that no longer fits an interface;
- a version conflict;
- a deletion that is blocked.
A draft save, or the first publication of a new definition, needs no confirmation.
Direct-edits setting
GET /vegagraph/ontology/settings{ "ontology_direct_edits": false }When ontology_direct_edits is false, every change to an object type, link type or interface goes through a proposal. Updating the setting needs the workspace govern permission.
Proposals
| Operation | Route |
|---|---|
| Create | POST /vegagraph/ontology/proposals with title and optional description |
| Stage a change | PUT /vegagraph/ontology/proposals/{id}/changes/{kind}/{key} with op (put or delete) and definition |
| Remove a staged change | DELETE /vegagraph/ontology/proposals/{id}/changes/{kind}/{key} |
| Preview impact | POST /vegagraph/ontology/proposals/{id}:preview-impact |
| Merge | POST /vegagraph/ontology/proposals/{id}:merge |
| Close without merging | POST /vegagraph/ontology/proposals/{id}:close |
| List | GET /vegagraph/ontology/proposals?state=draft |
A merge approves the combined impact, so it needs no accept_breaking. When direct edits are off, merging needs the workspace govern permission.
Actions
| Route | What it does |
|---|---|
POST /vegagraph/actions:suggest-inputs | Suggest form fields from a pipeline's input model. |
POST /vegagraph/actions:check | Check an action definition without saving it. |
PUT /vegagraph/actions/{action_key} | Create or update an action. |
POST /vegagraph/objects/{object_type}/{object_id}/actions/{action_key}/invocations | Invoke an action on an object. |
POST /vegagraph/actions:visual-impact | Compare saved actions with a visual pipeline's current draft and list the ones the draft would break. |
POST /vegagraph/actions/{action_key}:check-newer-version | Check a Python action against newer published versions of its pipeline. |
:check, :visual-impact and :check-newer-version write nothing.
A typical flow is: suggest inputs, check the definition, save it, then invoke it.
Suggest inputs
POST /vegagraph/actions:suggest-inputs{
"target": {
"kind": "pipeline_asset",
"id": "refund-pipeline",
"version_id": "ver_8f2c",
"environment_id": "env_prod"
},
"applies_to": { "object_types": ["account"] }
}The response lists up to 128 fields:
{
"fields": [
{
"key": "amount",
"title": "Amount",
"description": "",
"kind": "decimal",
"required": true,
"nullable": false,
"limits": { "minimum": "0.01", "maximum": "10000.00" },
"parameter": { "type": "string", "format": "decimal", "title": "Amount" },
"mapping": { "input": "amount" }
},
{
"key": "as_of",
"title": "As of",
"description": "",
"kind": "date",
"required": true,
"nullable": false,
"limits": {},
"parameter": { "type": "string", "format": "date", "title": "As of" },
"mapping": { "input": "as_of" }
},
{
"key": "note",
"title": "Note",
"description": "",
"kind": "text",
"required": false,
"nullable": true,
"limits": {},
"parameter": { "type": "string", "title": "Note" },
"mapping": { "input": "note" }
}
]
}parameteris ready to paste into the action'sinput_schema.properties. Add the key toinput_schema.requiredwhenrequiredis true.- A field the action cannot fill has a
reasoninstead of amapping.
Check a definition
POST /vegagraph/actions:checkThe body is the same action definition you would save. The response lists every problem and warning, each with the field_key and a pointer to the part of the definition that is wrong:
{
"problems": [
{
"code": "action_work_mapping_invalid",
"message": "missing required work parameter: as_of",
"pointer": "/definition/edits/0/work/parameters/as_of",
"field_key": "as_of"
}
],
"warnings": []
}Problems block a save; warnings do not. See Checks before saving.
Save an action
PUT /vegagraph/actions/refund_account{
"action_key": "refund_account",
"display_name": "Refund account",
"kind": "graph_edit",
"enabled": true,
"effects": "MAY_WRITE",
"applies_to": { "object_types": ["account"] },
"input_schema": {
"type": "object",
"required": ["amount", "as_of"],
"properties": {
"amount": {
"type": "string",
"format": "decimal",
"title": "Amount",
"x-vega-minimum": "0.01",
"x-vega-maximum": "10000.00"
},
"as_of": { "type": "string", "format": "date", "title": "As of" },
"note": { "type": "string", "title": "Note" }
}
},
"submission": { "conditions": [] },
"approval": { "mode": "none" },
"edits": [
{
"op": "run_job",
"work": {
"target": {
"kind": "pipeline_asset",
"id": "refund-pipeline",
"version_id": "ver_8f2c",
"environment_id": "env_prod"
},
"parameters": {
"account_id": { "property": "account_id" },
"amount": { "input": "amount" },
"as_of": { "input": "as_of" },
"note": { "input": "note" }
}
}
}
]
}Each entry in work.parameters takes its value from a form field (input), an object property (property) or a fixed value. See Mapping an input.
A save runs the same checks as :check and returns the same problems with status 422. The saved action has a definition_version. To change an existing action, send its current version in If-Match (for example If-Match: "3"). If someone saved a newer version first, the save is refused; reload before trying again.
Invoke an action
POST /vegagraph/objects/account/A-1042/actions/refund_account/invocations
Idempotency-Key: 6c1b0f1e-0d7f-4d63-9a6a-2f0c7d4a9a11{
"definition_version": 3,
"input": { "amount": "125.50", "as_of": "2026-11-20" }
}The invocation returns with state RUNNING and a tracking URL. Poll it until it reports the run and its final state, SUCCEEDED or FAILED. Repeating the request with the same Idempotency-Key returns the same invocation instead of starting a second run.
Check newer versions
POST /vegagraph/actions/{action_key}:check-newer-version returns a status:
| Status | Meaning |
|---|---|
current | The action runs the newest version. |
newer_version_fits | A newer published version accepts what the action sends. |
newer_version_does_not_fit | A newer version changed its inputs. The action stays on its version. |
pinned_version_missing | The version the action runs was deleted. |
Error codes
| Status | Code or message | Cause |
|---|---|---|
| 409 | ontology_breaking_confirmation_required | A breaking direct save without accept_breaking. |
| 412 | — | The save named an out-of-date expected_version. |
| 422 | — | The impact preview would be too large to compute. |
| 422 | interface_not_satisfied | A merge found a type that does not fit its interface. Nothing is published. |
| 422 | Action problems, such as action_work_mapping_invalid | An action save failed its checks. The body lists the problems as :check does. |
| 428 | — | An ontology definition update without expected_version. |
| — | "this change breaks a definition you can't see" | The change would break an interface or type the caller cannot read. |
| — | "interface is unavailable" | The named interface does not exist, or the caller cannot read it. |