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

# User Versions

> List and retrieve historical versions of a user

# User Versions

Every change to a user entity creates a new version. Use these endpoints to view the version history and retrieve specific versions.

## List Versions

**id** `string` *required*

UUID of the user.

## Get Specific Version

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

**id** `string` *required*

UUID of the user.

**version** `string` *required*

Version number to retrieve, for example `0.2`.

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

from metadata.sdk import configure
from metadata.sdk.entities import Users

configure(
    host="https://your-company.getcollate.io/api",
    jwt_token="your-jwt-token"
)

# List all versions
versions = Users.get_versions("77655e6e-ad33-49da-bbca-db4ba4d4e2cd")
for v in versions:
    version = json.loads(v)
    print(f"Version {version['version']}: {version.get('description')}")

# Get a specific version
user_v1 = Users.get_specific_version(
    "77655e6e-ad33-49da-bbca-db4ba4d4e2cd",
    "0.1"
)
print(f"Original display name: {user_v1.displayName}")
```

```java GET /v1/users/{id}/versions theme={null}
// client is an initialized OpenMetadataClient.
var id = "77655e6e-ad33-49da-bbca-db4ba4d4e2cd";

// List all versions
var history = client.users().getVersionList(id);
for (var version : history.getVersions()) {
    System.out.println("Version: " + version);
}

// Get a specific version
var v1 = client.users().getVersion(id, 0.1);
System.out.println("Display Name: " + v1.getDisplayName());
```

```bash GET /v1/users/{id}/versions theme={null}
# List all versions
curl "{base_url}/api/v1/users/77655e6e-ad33-49da-bbca-db4ba4d4e2cd/versions" \
  -H "Authorization: Bearer {access_token}"

# Get a specific version
curl "{base_url}/api/v1/users/77655e6e-ad33-49da-bbca-db4ba4d4e2cd/versions/0.1" \
  -H "Authorization: Bearer {access_token}"
```

```json Response (List Versions) theme={null}
{
  "entityType": "user",
  "versions": [
    "{\"id\":\"77655e6e-ad33-49da-bbca-db4ba4d4e2cd\",\"name\":\"aaron_johnson0\",\"fullyQualifiedName\":\"aaron_johnson0\",\"version\":0.2,\"displayName\":\"Aaron M. Johnson\",\"email\":\"aaron_johnson0@gmail.com\",\"isBot\":false,\"isAdmin\":false}",
    "{\"id\":\"77655e6e-ad33-49da-bbca-db4ba4d4e2cd\",\"name\":\"aaron_johnson0\",\"fullyQualifiedName\":\"aaron_johnson0\",\"version\":0.1,\"displayName\":\"Aaron Johnson\",\"email\":\"aaron_johnson0@gmail.com\",\"isBot\":false,\"isAdmin\":false}"
  ]
}
```

***

## Returns

**List versions** returns an object with `entityType` and a `versions` array of serialized entity snapshots (newest first).

**Get specific version** returns the full user object as it existed at that version.

***

## Error Handling

| Code | Error Type | Description |
| - | - | - |
| `401` | `UNAUTHORIZED` | Invalid or missing authentication token |
| `404` | `NOT_FOUND` | User or version does not exist |


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