# 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"
    }
}
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.thebrief.ai/public-api/rest-api/design-versions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
