Manage data contracts with CLI or API
You can interact with the Data Contract service through a CLI or direct API calls. You can also use the Collibra user interface to create or manage data contracts.
CLI
The Collibra CLI packages API calls to enable automation and integration. Before you use the CLI, you need to install and configure it. Then, you can use its commands to create and maintain data contracts. You can perform the following tasks from the CLI. Detailed information and examples are available in the CLI.
| Command | Description | Permissions |
|---|---|---|
| collibra data-contract init |
Create a data contract with an initial manifest, or add a manifest to an existing, uninitialized Data Contract asset. The governed asset is optional. Provide the UUID of the governed asset to link it to the data contract, or provide a domain and name to create a data contract with no governed asset. |
|
| collibra data-contract draft | Generate a new manifest version based on Collibra metadata. |
|
| collibra data-contract push | Upload a new version of a manifest to Collibra. |
|
| collibra data-contract fetch | Retrieve a data contract. |
View permission on the Data Contract asset. |
| collibra data-contract list | List all data contracts and their metadata. | View permission on the Data Contract asset. |
| collibra data-contract list-versions | List versions and metadata for a data contract. | View permission on the Data Contract asset. |
| collibra data-contract set-active | Set a specific manifest version as active. |
|
| collibra data-contract apply |
Create and update relations, and also update the SLA attributes that match existing out-of-the-box SLA attributes on the Data Contract asset. Note
|
|
| collibra data-contract clear |
Depending on the Clearing the data contract deletes all versions and unlinks the manifest ID from the contract. |
|
| collibra data-contract delete | Permanently delete a specific manifest version. |
|
Tip The CLI includes a --help flag to retrieve the built-in reference documentation, for example, ./collibra data-contract --help.
API
If you prefer to work directly with API calls, you do not need to set up the CLI. You can use any API tool, such as Postman, cURL, or Insomnia, to interact with the Data Contract service. Refer to the API specifications for detailed information about all available endpoints, including endpoints for listing contract metadata, managing versions, and setting the active version.
The required permissions are as follows.
| API endpoint | Description | Permissions |
|---|---|---|
|
POST /dataContracts |
Create a data contract with an initial manifest, or add a manifest to an existing, uninitialized Data Contract asset. Note Initializing a data contract is the first step in linking a Data Contract asset to its initial manifest. By default, this creates a new Data Contract asset. To link the new asset to an existing governed asset (such as a Data Product Port), provide
governedAssetId. To create a standalone data contract with no governed asset, omit governedAssetId but provide domainId. To initialize an existing, uninitialized Data Contract asset, provide dataContractId instead. You can optionally provide an existing manifest to upload. If no manifest is provided during initialization, a template is generated from the associated Collibra metadata. Because a standalone data contract is not linked to a port, its generated template does not have a Schema section. Once a data contract is initialized, you can perform all other actions on it. |
|
| GET /dataContracts | List all data contracts and their metadata. | View permission on the Data Contract asset. |
| GET /dataContracts/{id} | Retrieve a specific data contract. | View permission on the Data Contract asset. |
| DELETE /dataContracts/{id} | Depending on the deleteAsset value, either clear the data contract or delete the Data Contract asset. Clearing the data contract deletes all versions and unlinks the manifest ID from the contract. |
|
| POST /dataContracts/addFromManifest | Upload a new manifest version for an existing data contract, using the Manifest ID inside the file to identify the target Data Contract asset. |
|
| GET /dataContracts/{id}/draftVersion | Generate a new manifest version based on Collibra metadata. | View permission on the Data Contract asset. |
|
POST /dataContracts/{id}/apply |
Create and update relations, and also update the SLA attributes that match existing out-of-the-box SLA attributes on the Data Contract asset. Note
|
|
| POST /dataContracts/{id}/versions | Upload a new version of a manifest to Collibra. |
|
| DELETE /dataContracts/{id}/versions | Permanently delete a specific manifest version. |
|
| GET /dataContracts/{id}/versions | List versions and metadata for a data contract. | View permission on the Data Contract asset. |
| GET /dataContracts/{id}/versions/manifest | Retrieve the manifest for a specific version. | View permission on the Data Contract asset. |
| GET /dataContracts/{id}/activeVersion | Retrieve metadata for the active manifest version. | View permission on the Data Contract asset. |
| PATCH /dataContracts/{id}/activeVersion | Set a specific manifest version as active. |
|
| GET /dataContracts/{id}/activeVersion/manifest | Retrieve the manifest for the active version. | View permission on the Data Contract asset. |