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 Data Contract 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. |
|
| collibra data-contract draft | Generate a new manifest draft 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 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 end point | Permissions |
|---|---|
|
POST /dataContracts Initializing a data contract is the first step in creating a new Data Contract asset and linking it to its initial manifest. You can provide an existing manifest to upload. If you do not provide one, a template is generated from the associated Collibra content. Once a data contract is initialized, you can use all other actions on it. |
|
| GET /dataContracts | View permission on the Data Contract asset. |
| GET /dataContracts/{id} | View permission on the Data Contract asset. |
| DELETE /dataContracts/{id} |
|
| POST /dataContracts/addFromManifest |
|
| GET /dataContracts/{id}/draftVersion | View permission on the Data Contract asset. |
|
POST /dataContracts/{id}/apply The |
|
| POST /dataContracts/{id}/versions |
|
| DELETE /dataContracts/{id}/versions |
|
| GET /dataContracts/{id}/versions | View permission on the Data Contract asset. |
| GET /dataContracts/{id}/versions/manifest | View permission on the Data Contract asset. |
| GET /dataContracts/{id}/activeVersion | View permission on the Data Contract asset. |
| PATCH /dataContracts/{id}/activeVersion |
|
| GET /dataContracts/{id}/activeVersion/manifest | View permission on the Data Contract asset. |