> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open-metadata.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Data Contract Versions

> Track version history of data contract changes

# Data Contract Versions

Every change to a data contract creates a new version. Use the versions API to list all versions and retrieve a specific version.

## List Versions

**id** `string` *required*

UUID of the data contract.

## Get Specific Version

Use `GET /v1/dataContracts/{id}/versions/{version}` to retrieve a specific version.

**version** `string` *required*

Version number in `major.minor` format, for example `0.1`, `0.2`, `1.0`.

```python GET /v1/dataContracts/{id}/versions theme={null}
import json

from metadata.sdk import client, configure
from metadata.sdk.entities import DataContracts

configure(
    host="https://your-company.open-metadata.org/api",
    jwt_token="your-jwt-token"
)
rest = client().ometa.client

# List all versions
history = rest.get("/dataContracts/f7a1b2c3-d4e5-6789-0abc-def123456789/versions")
for item in history["versions"]:
    v = json.loads(item)
    print(f"v{v['version']}: {v['updatedBy']} at {v['updatedAt']}")

# Get specific version
contract_v1 = DataContracts.get_specific_version(
    "f7a1b2c3-d4e5-6789-0abc-def123456789",
    "0.1"
)
```

```java GET /v1/dataContracts/{id}/versions theme={null}
// client is an initialized OpenMetadataClient.
// List versions using the client
var history = client.dataContracts().listVersions(contractId);
for (var version : history.getVersions()) {
    System.out.println("v" + version.getVersion());
}
```

```bash GET /v1/dataContracts/{id}/versions theme={null}
# List all versions
curl "{base_url}/api/v1/dataContracts/f7a1b2c3-d4e5-6789-0abc-def123456789/versions" \
  -H "Authorization: Bearer {access_token}"

# Get specific version
curl "{base_url}/api/v1/dataContracts/f7a1b2c3-d4e5-6789-0abc-def123456789/versions/0.2" \
  -H "Authorization: Bearer {access_token}"
```

```json Response (List Versions) theme={null}
{
  "entityType": "dataContract",
  "versions": [
    "{\"id\":\"f7a1b2c3-d4e5-6789-0abc-def123456789\",\"name\":\"sales-orders-contract\",\"version\":0.2,\"entityStatus\":\"Approved\"}",
    "{\"id\":\"f7a1b2c3-d4e5-6789-0abc-def123456789\",\"name\":\"sales-orders-contract\",\"version\":0.1,\"entityStatus\":\"Draft\"}"
  ]
}
```

***

## Version Numbering

| Change Type | Version Impact | Example |
| - | - | - |
| Minor field updates (description, display name) | Minor bump (`0.1` → `0.2`) | Update description |
| Major structural changes (status, schema, entity) | Major bump (`0.2` → `1.0`) | Change status to Approved |

***

## Error Handling

| Code | Error Type | Description |
| - | - | - |
| `401` | `UNAUTHORIZED` | Invalid or missing authentication token |
| `403` | `FORBIDDEN` | User lacks permission |
| `404` | `NOT_FOUND` | Data contract or version not found |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.