Skip to main content
GET
Export ODCS

Import & Export

Data contracts can be imported and exported using the Open Data Contract Standard (ODCS) v3.1.0 format. Both JSON and YAML are supported, with smart merge and full replace modes for updates.

Export to ODCS

Export by ID (JSON)

GET /v1/dataContracts/{id}/odcs

Export by ID (YAML)

GET /v1/dataContracts/{id}/odcs/yaml

Export by FQN (JSON)

GET /v1/dataContracts/name/{fqn}/odcs

Export by FQN (YAML)

GET /v1/dataContracts/name/{fqn}/odcs/yaml
string
UUID of the data contract.
string
Fully qualified name of the data contract.
string
Fields to include in the export. Defaults to owners,reviewers,extension,schema,sla,security.
Export ODCS

Import from ODCS

Create from ODCS JSON

POST /v1/dataContracts/odcs

Create from ODCS YAML

POST /v1/dataContracts/odcs/yaml

Create or Update from ODCS JSON

PUT /v1/dataContracts/odcs

Create or Update from ODCS YAML

PUT /v1/dataContracts/odcs/yaml
string
required
UUID of the entity to attach the contract to.
string
required
Type of the entity (e.g., table, topic, apiEndpoint).
string
default:"merge"
Import mode for PUT endpoints: merge (preserves existing fields not in the import) or replace (fully overwrites the contract).
string
Schema object name to import for multi-object ODCS contracts. If not specified, auto-selects based on entity name.
Import ODCS
Import ODCS
Import ODCS

Preserving ODCS-Only Fields

ODCS documents can carry data OpenMetadata doesn’t model directly, such as quality rules or element-level authoritativeDefinitions and transformSourceObjects. Rather than dropping this data, OpenMetadata stores it as a passthrough and restores it on export.
A plain PUT /v1/dataContracts that omits these fields from its payload leaves them untouched—only an explicit empty array in the payload clears them, the same way PUT /odcs?mode=replace does with a document that omits them. A PATCH that explicitly removes them also works.
Current limitations:
  • The UI doesn’t render these passthrough fields yet—they’re accessible via the API only.
  • If the schema element an extension is attached to can’t be matched on export (for example, it was renamed or removed), authoritativeDefinitions fall back to the contract level rather than being lost. transformSourceObjects have no such fallback. For an unmatched element, they’re dropped instead.
  • Several other ODCS attributes aren’t mapped yet and don’t round-trip: businessName, classification, examples, customProperties, transformLogic, transformDescription, logicalTypeOptions (except maxLength, which round-trips through the column’s dataLength), and element-level tags.

Parse ODCS YAML

Preview an ODCS YAML contract without importing. Useful for inspecting multi-object contracts. POST /v1/dataContracts/odcs/parse/yaml
Parse YAML
Response

Validate ODCS YAML

Validate an ODCS YAML contract against a target entity without creating it. POST /v1/dataContracts/odcs/validate/yaml
string
required
UUID of the entity to validate against.
string
required
Type of the entity.
string
Schema object name for multi-object contracts.
Validate YAML
Response

Supported ODCS Versions


Error Handling