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

# Design Versions

## List design versions

This endpoint makes an HTTP GET request to retrieve a list of design versions

### Request

* Method: GET
* Endpoint: `https://api.thebrief.ai/v1/designVersion`
* Query Parameters:
  * `hash` (string, required): The hash of the design.

**Response Body**

* `response` (array)
  * `id` (string): The version id.
  * `lastModified` (date): The last modification date of the design.
  * `lastModifiedByName` (string): The user's name who made the last modifications to the design.
  * `lastModifiedByProfilePicture` (string): The user's profilePicture who made the last modifications to the design.
  * `versionName` (string): The name of the version.
  * `sizeHash` (string): The size's hash from the set

```json
{
    "response": [
        {
            "id": "w8Tz8D_sdUs1dr1PxyB6CoeG8pllRLFF",
            "lastModified": "2024-11-13T08:18:29.000Z",
            "lastModifiedByName": "User name",
            "lastModifiedByProfilePicture": "",
            "versionName": "",
            "sizeHash": "gry44d"
        },
        {
            "id": "pY3_mntBqded4dvBwOyT9uSYXmNyfw4q",
            "lastModified": "2024-11-13T08:09:09.000Z",
            "lastModifiedByName": "User Name",
            "lastModifiedByProfilePicture": "",
            "versionName": "",
            "sizeHash": "uhuh7"
        },
    ]
}
```

## Create a new design version

This endpoint allows you to create a new version for a design.

### Request

* Method: `POST`
* Endpoint: `https://api.thebrief.ai/v1/designVersion`
* Body:
  * `hash` (string, required): The hash of the design.
  * `versionName` (string, required): The new version's name.

### Response

The response will be in JSON format with the following structure:

* `response` (object)&#x20;
  * `status` (enum) - (succes, failed)

```json
{
    "response": {
        "status": "success"
    }
}
```

## Update version name

This endpoint allows you to update a version's name.

### Request

* Method: `PUT`
* Endpoint: `https://api.thebrief.ai/v1/designVersion`
* Body:
  * `hash` (string, required): The hash of the design.
  * `versionName` (string, required): The new name of the design version.
  * `versionId` (string, required): The versionId of the design version.

### Response

The response will be in JSON format:

```json
{
    "response": {
        "status": "success"
    }
}
```

## Restore a design version

This endpoint allows you to restore a version of a design.

### Request

* Method: `POST`
* Endpoint: `https://api.thebrief.ai/v1/designVersion/restore`
* Body:
  * `hash` (string, required): The hash of the design
  * `versionId` (string, required): The versionId of the version.

### Response

The response will be in JSON format:

```json
{
    "response": {
        "status": "success"
    }
}
```
