> 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/brand-kits/brand-kit-colors.md).

# Brand kit colors

## List brand kit color palettes

This endpoint makes an HTTP GET request to list the color palettes of a brand kit.

### Request

* Method: GET
* Endpoint: `https://api.thebrief.ai/v1/brandkit/{brandkitId}/colors`

```
curl -X 'GET' \
  'https://api.thebrief.ai/v1/brandkit/{brandkitId}/colors \
  -H 'Authorization: Bearer eyJ...'
```

### Response

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

```json
{
    "response": {
        "brandKitColorPalettes": [
            {
                "id": number,
                "name": string,
                "colors": [
                    {
                        "name": string | null, 
                        "hex": string
                    }
                ],
             }
         ]
    }
}
```

## Create brand kit color palette

This endpoint allows you to create a color palettes in a brand kit.

### Request

* Method: POST
* Endpoint: `https://api.thebrief.ai/v1/brandkit/{brandkitId}/colors`
* Body:
  * `name` (integer, optional): The name of the color palette.
  * `colors` (array, required): The array of colors in the color palette. (can be an empty array)
    * `name` (string, optional): The name of the color.
    * `hex` (string, required): Hex code of the color

```
  curl -s -X POST \
  'https://api.thebrief.ai/v1/brandkit/{brandkitId}/colors' \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Palette name","colors":[{"hex":"#ffffff","name":"white"},{"hex":"#33FF57"}]}'
```

### Response

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

```json
{
    "response": {
        "id": number,
        "name": string,
        "colors": [
            {
                "name": string | undefined, 
                "hex": string
            }
        ],
     }
}
```

## Delete brand kit color palette

This endpoint allows you to delete a color palette from a brandkit.

### Request

* Method: DELETE
* Endpoint: `https://api.thebrief.ai/v1/brandkit/{brandkitId}/colors`
* Body:
  * `paletteId` (integer, required): The ID of the color palette you want to be deleted.

```
 curl -s -X DELETE \
   'https://api.thebrief.ai/v1/brandkit/1333124/colors' \
   -H "Authorization: Bearer $TOKEN" \
   -H "Content-Type: application/json" \
   -d '{"paletteId":1377221}'
```

### Response

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

## Update brand kit color palette

This endpoint allows you to update a color palette in a brand kit.

### Request

* Method: PUT
* Endpoint: `https://api.thebrief.ai/v1/brandkit/{brandkitId}/colors`
* Body:
  * `paletteId` (integer, optional): The id of the color palette.
  * `name` (integer, optional): The name of the color palette.
  * `colors` (array, required): The array of colors in the color palette. (can be an empty array)
    * `name` (string, optional): The name of the color.
    * `hex` (string, required): Hex code of the color

```
curl -s -X PUT \
  'https://api.thebrief.ai/v1/brandkit/{brandkitId}/colors' \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"paletteId":11222,"name":"Palette name","colors":[{"hex":"#ffffff","name":"white"}]}'
```

### Response

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

```json
{
    "response": {
        "id": number,
        "name": string,
        "colors": [
            {
                "name": string | undefined, 
                "hex": string
            }
        ],
     }
}
```
