# Templates (Designs)

## List Templates (designs)

List all templates you have access to with the user assigned to the credentials.

This endpoint makes an HTTP GET request to retrieve a list of templates from the specified API endpoint.

### **Request**

* Method: GET
* Endpoint: `https://api.thebrief.ai/v1/templates`
* Query Parameters:
  * `keyword` (string, optional): The keyword to search for a template name
  * `projectId` (string, optional): Return only templates from a specific project
  * `folderId` (string, optional): Return only templates from a specific folder
  * `limit` (integer, optional): The maximum number of templates to be returned.
  * `cursor`  (string, optional): A cursor for pagination.
  * `apiGenerated` (boolean, optional): Return only designs generated by API (excluded without this true)
  * `onlyTemplates` (boolean, optional): Return only designs (marked as custom templates) from a team
  * `exactSearch` (boolean, optional): If true, it will return only the templates with the name equal to the keyword. (For ex. keyword = 'Template 1' will return only designs with the name 'Template 1')
  * `orderBy` (enum, optional): option to order the response results by the next fields:&#x20;

    ```typescript
    ID
    NAME
    CREATED_AT
    UPDATED_AT
    ```
  * `orderDirection` (enum, optional): option to order the response by direction:

    ```
    ASC
    DESC
    ```

### Response

Upon a successful execution with a status code of 200, the response will be in JSON format and will include a "response" object containing an array of "nodes" with "id" and "name" properties, as well as a "pageInfo" object with "hasNextPage" and "endCursor" properties.

Request example:

```bash
curl --location 'https://api.thebrief.ai/v1/templates' \
--header 'Authorization: Bearer eyJ...'
```

Response example:

```json
{
    "response": {
        "nodes": [
            {
                "id": "3pqqql",
                "name": "Untitled design",
                "isTemplate": true,
                "projectId": 826801,
                "folderId": 152322,
                "apiGenerated": false,
                "thumbUrl": "https://creatopy-cdn-ed8ea45.s3.eu-central-1.amazonaws.com/resize/designs/ppxmex/small?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIASCU4ALRBLWFY5GGB%2F20250411%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20250411T104109Z&X-Amz-Expires=43200&X-Amz-Signature=7c9bd2845cf13a6f78fb9617fc95518a7bf5cd04f5e83f7abd3a3ff61cbaf0bd&X-Amz-SignedHeaders=host"
            },
            {
                "id": "lwp7dy",
                "name": "Untitled design",
                "isTemplate": true,
                "projectId": 826801,
                "folderId": 512322,
                "apiGenerated": false,
                "thumbUrl": "https://creatopy-cdn-ed8ea45.s3.eu-central-1.amazonaws.com/resize/designs/ppxmex/small?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIASCU4ALRBLWFY5GGB%2F20250411%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20250411T104109Z&X-Amz-Expires=43200&X-Amz-Signature=7c9bd2845cf13a6f78fb9617fc95518a7bf5cd04f5e83f7abd3a3ff61cbaf0bd&X-Amz-SignedHeaders=host"
            },
            {
                "id": "m0rg1n",
                "name": "Car test",
                "isTemplate": true,
                "projectId": 826801,
                "folderId": 243454,
                "apiGenerated": false,
                "thumbUrl": "https://creatopy-cdn-ed8ea45.s3.eu-central-1.amazonaws.com/resize/designs/ppxmex/small?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIASCU4ALRBLWFY5GGB%2F20250411%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20250411T104109Z&X-Amz-Expires=43200&X-Amz-Signature=7c9bd2845cf13a6f78fb9617fc95518a7bf5cd04f5e83f7abd3a3ff61cbaf0bd&X-Amz-SignedHeaders=host"
            },
            ...
            {
                "id": "q8lx0r",
                "name": "Zapi temp 2 - long name here for testing",
                "isTemplate": false,
                "projectId": 826801,
                "folderId": 12555,
                "apiGenerated": false,
                "thumbUrl": "https://creatopy-cdn-ed8ea45.s3.eu-central-1.amazonaws.com/resize/designs/ppxmex/small?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIASCU4ALRBLWFY5GGB%2F20250411%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20250411T104109Z&X-Amz-Expires=43200&X-Amz-Signature=7c9bd2845cf13a6f78fb9617fc95518a7bf5cd04f5e83f7abd3a3ff61cbaf0bd&X-Amz-SignedHeaders=host"
            },
            {
                "id": "jdeglo",
                "name": "Zapi temp_300x250px_Fri Sep 01 2023 copy",
                "isTemplate": true,
                "projectId": 826801,
                "folderId": null,
                "apiGenerated": false,
                "thumbUrl": "https://creatopy-cdn-ed8ea45.s3.eu-central-1.amazonaws.com/resize/designs/ppxmex/small?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIASCU4ALRBLWFY5GGB%2F20250411%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20250411T104109Z&X-Amz-Expires=43200&X-Amz-Signature=7c9bd2845cf13a6f78fb9617fc95518a7bf5cd04f5e83f7abd3a3ff61cbaf0bd&X-Amz-SignedHeaders=host"
            },
            {
                "id": "mexkl7",
                "name": "Zapi temp_300x250px_Mon Sep 04 2023",
                "isTemplate": false,
                "projectId": 826801,
                "folderId": null,
                "apiGenerated": true,
                "thumbUrl": "https://creatopy-cdn-ed8ea45.s3.eu-central-1.amazonaws.com/resize/designs/ppxmex/small?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIASCU4ALRBLWFY5GGB%2F20250411%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20250411T104109Z&X-Amz-Expires=43200&X-Amz-Signature=7c9bd2845cf13a6f78fb9617fc95518a7bf5cd04f5e83f7abd3a3ff61cbaf0bd&X-Amz-SignedHeaders=host"
            },
            {
                "id": "ydk1lz",
                "name": "Zapi temp",
                "isTemplate": true,
                "projectId": 826801,
                "folderId": null,
                "apiGenerated": false,
                "thumbUrl": "https://creatopy-cdn-ed8ea45.s3.eu-central-1.amazonaws.com/resize/designs/ppxmex/small?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIASCU4ALRBLWFY5GGB%2F20250411%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20250411T104109Z&X-Amz-Expires=43200&X-Amz-Signature=7c9bd2845cf13a6f78fb9617fc95518a7bf5cd04f5e83f7abd3a3ff61cbaf0bd&X-Amz-SignedHeaders=host"
            },
        ],
        "pageInfo": {
            "hasNextPage": true,
            "endCursor": "eyJsaW1pdCI6NTAsImxhc3RJZCI6MzEzNDI0Mn0="
        }
    }
}
```

The thumbUrl is valid for 12 hours, after which it must be rerun the query to regenerate it.

## Delete Template (design)

This endpoint allows you to delete a design (template).

### Request

* Method: DELETE
* Endpoint: `https://api.thebrief.ai/v1/templates`
* Body:
  * `hash` (string, required): The hash of the template(design) you want to be deleted.

```bash
Request example

curl --location --request DELETE 'https://api.thebrief.ai/v1/templates' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhdXRobSVV6STFOa...' \
--data '{
    "hash": "rfg5d6"
}'
```

### Response

The response will be in JSON format:

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