> For the complete documentation index, see [llms.txt](https://docs.umbraco.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.umbraco.com/ai-in-umbraco/management-api/versions.md).

# Versions

Unified API for accessing version history across all AI entities.

The Versions API provides centralized access to version history for all versioned AI entities. Rather than per-entity version endpoints, this unified API handles versioning for connections, profiles, contexts, prompts, and agents.

## Endpoints

| Method | Endpoint                                                                                                                                  | Description                               |
| ------ | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- |
| GET    | [`/umbraco/ai/management/api/v1/versions/supported-types`](/ai-in-umbraco/management-api/versions/supported-types.md)                     | List entity types that support versioning |
| GET    | [`/umbraco/ai/management/api/v1/versions/{entityType}/{entityId}`](/ai-in-umbraco/management-api/versions/history.md)                     | Get version history for an entity         |
| GET    | [`/umbraco/ai/management/api/v1/versions/{entityType}/{entityId}/{version}`](/ai-in-umbraco/management-api/versions/get-version.md)       | Get a specific version snapshot           |
| GET    | [`/umbraco/ai/management/api/v1/versions/{entityType}/{entityId}/{from}/compare/{to}`](/ai-in-umbraco/management-api/versions/compare.md) | Compare two versions                      |
| POST   | [`/umbraco/ai/management/api/v1/versions/{entityType}/{entityId}/{version}/rollback`](/ai-in-umbraco/management-api/versions/rollback.md) | Rollback to a previous version            |

## Base URL

```
/umbraco/ai/management/api/v1
```

## Supported Entity Types

| Entity Type  | Package           | Description                     |
| ------------ | ----------------- | ------------------------------- |
| `connection` | Umbraco.AI        | API connections and credentials |
| `profile`    | Umbraco.AI        | AI profile configurations       |
| `context`    | Umbraco.AI        | Context resources and content   |
| `prompt`     | Umbraco.AI.Prompt | Prompt templates                |
| `agent`      | Umbraco.AI.Agent  | Agent definitions               |

## Version Object

{% code title="Version" %}

```json
{
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "entityId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "entityType": "profile",
    "version": 3,
    "dateCreated": "2024-01-20T14:45:00Z",
    "createdByUserId": "user-guid",
    "changeDescription": "Updated temperature setting"
}
```

{% endcode %}

## Properties

| Property            | Type     | Description                     |
| ------------------- | -------- | ------------------------------- |
| `id`                | guid     | Version record identifier       |
| `entityId`          | guid     | ID of the versioned entity      |
| `entityType`        | string   | Type discriminator              |
| `version`           | int      | Sequential version number       |
| `dateCreated`       | datetime | When this version was created   |
| `createdByUserId`   | guid     | User who created this version   |
| `changeDescription` | string   | Optional description of changes |

## Version Snapshots

When you request a specific version, the response includes a `snapshot` field containing the complete entity state at that version:

{% code title="Version with Snapshot" %}

```json
{
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "entityId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "entityType": "profile",
    "version": 3,
    "dateCreated": "2024-01-20T14:45:00Z",
    "snapshot": {
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "alias": "content-assistant",
        "name": "Content Assistant",
        "capability": "Chat",
        "model": {
            "providerId": "openai",
            "modelId": "gpt-4o"
        },
        "settings": {
            "$type": "chat",
            "temperature": 0.7
        }
    }
}
```

{% endcode %}

## Related

* [Version History Concept](/ai-in-umbraco/concepts/versioning.md)
* [Version History Backoffice](/ai-in-umbraco/backoffice/version-history.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.umbraco.com/ai-in-umbraco/management-api/versions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
