# Trello Rest API - Card Colors/Covers

**URL:** <https://community.developer.atlassian.com/t/trello-rest-api-card-colors-covers/38865>\
**Category:** Trello\
**Tags:** rest-api\
**Created:** [June 3, 2020, 9:04pm UTC](https://community.developer.atlassian.com/t/trello-rest-api-card-colors-covers/38865 "2020-06-03T21:04:59Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrfischer](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/jrfischer/32/40093_2.png) [@jrfischer](https://community.developer.atlassian.com/u/jrfischer)\
**Post date:** [June 3, 2020, 9:05pm UTC](https://community.developer.atlassian.com/t/trello-rest-api-card-colors-covers/38865/1 "2020-06-03T21:05:00Z")

</div>

Apologies if this has been asked/answered; I didn’t find any threads.

Will the Rest API be updated to allow for control over a card’s cover/color?

---

<div class="post-metadata">

**Author:** ![bentley](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/bentley/32/36116_2.png) [@bentley](https://community.developer.atlassian.com/u/bentley)\
**Post date:** [June 9, 2020, 6:37pm UTC](https://community.developer.atlassian.com/t/trello-rest-api-card-colors-covers/38865/2 "2020-06-09T18:37:23Z")

</div>

Great question! It _isn’t_ documented yet (on my to-do, I promise!).

Let me see if I can’t give a rough outline of it here:

On a PUT to `/1/cards/{idCard}` you can pass in a `cover` key and object with the following option key/values:

| Option | Values | About |
| --- | --- | --- |
| color | `pink`, `yellow`, `lime`, `blue`, `black`, `orange`, `red`, `purple`, `sky`, `green` | Makes the cover a solid color . |
| brightness | `dark`, `light` | Determines whether the text on the cover should be dark or light. |
| url | An unsplash URL: [https://images.unsplash.com](https://images.unsplash.com) | Used if making an image the cover. Only Unsplash URLs work. |
| idAttachment | ID of an attachment on the card | Used if setting an attached image as the cover. |
| size | `normal`, `full` | Determines whether to show the card name on the cover, or below it. |

`brightness` can be sent alongside any of the other parameters, but all of the other parameters are mutually exclusive; you can not have the cover be a `color` and an `idAttachment` at the same time.

On the `brightness` options, setting it to `light` will make the text on the card cover dark:  
 ![05%20PM](https://global.discourse-cdn.com/atlassiandeveloper/original/3X/a/2/a27159ae57d13175ab93be2355f6e83c24a22419.png)

And vice versa, setting it to `dark` will make the text on the card cover light:  
 ![31%20PM](https://global.discourse-cdn.com/atlassiandeveloper/original/3X/d/c/dcb36e2db66930b62cddeba6155b8ef2ed4c0cb3.png)

Additionally, we added a `setCover` to the attachments POST endpoint that accepts a Boolean value. If `true` the attached image will be made the card cover.

```auto
POST https://trello.com/1/cards/{idCard}/attachments

{
  file: [fileData],
  setCover: true,
}

```

---

<div class="post-metadata">

**Author:** ![jrfischer](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/jrfischer/32/40093_2.png) [@jrfischer](https://community.developer.atlassian.com/u/jrfischer)\
**Post date:** [June 9, 2020, 7:09pm UTC](https://community.developer.atlassian.com/t/trello-rest-api-card-colors-covers/38865/3 "2020-06-09T19:09:46Z")

</div>

Perfect! That’ll do for me for now! Thank you!

Also, anything on your roadmap that will allow custom RGB values for card covers? Considering the brightness setting, I think this would be an awesome and useful option!

Thanks again!

---

<div class="post-metadata">

**Author:** ![bentley](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/bentley/32/36116_2.png) [@bentley](https://community.developer.atlassian.com/u/bentley)\
**Post date:** [June 10, 2020, 6:52pm UTC](https://community.developer.atlassian.com/t/trello-rest-api-card-colors-covers/38865/4 "2020-06-10T18:52:41Z")

</div>

As far as I know, that isn’t on the roadmap right now.

But I’ll happily pass along the idea! 🙂

---

<div class="post-metadata">

**Author:** ![bartuercumen](https://avatars.discourse-cdn.com/v4/letter/b/4491bb/32.png) [@bartuercumen](https://community.developer.atlassian.com/u/bartuercumen)\
**Post date:** [July 10, 2020, 5:07pm UTC](https://community.developer.atlassian.com/t/trello-rest-api-card-colors-covers/38865/5 "2020-07-10T17:07:05Z")

</div>

Hey @bentley

> [@bentley](#):
>
> On a PUT to `/1/cards/{idCard}` you can pass in a `cover` key and object with the following option key/values:

I tried this today but was not able to set the cover on the card, can you confirm current API supports this?

---

<div class="post-metadata">

**Author:** ![bentley](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/bentley/32/36116_2.png) [@bentley](https://community.developer.atlassian.com/u/bentley)\
**Post date:** [July 14, 2020, 12:52pm UTC](https://community.developer.atlassian.com/t/trello-rest-api-card-colors-covers/38865/6 "2020-07-14T12:52:22Z")

</div>

> [@bartuercumen](#):
>
> I tried this today but was not able to set the cover on the card, can you confirm current API supports this?

Yes, I’m certain the API supports this. Here is the blog announcing this feature: [How (and why) to customize Trello board card covers and colors | Trello](https://blog.trello.com/card-covers-and-colors).

If you open your browser’s network tab and watch the requests made by the Trello web client to the server, you’ll see a `cover` object in the payload when you make changes to the card cover via this widget on the right of the card back:  
[![](https://blog.trello.com/hs-fs/hubfs/card_cover_menu_small.png?width=5384&name=card_cover_menu_small.png) ](https://blog.trello.com/hs-fs/hubfs/card_cover_menu_small.png?width=5384&name=card_cover_menu_small.png)

The API documented and available to you is the same one that the web client (and mobile clients!) use, as well.

---

<div class="post-metadata">

**Author:** ![DennisEagles](https://avatars.discourse-cdn.com/v4/letter/d/d26b3c/32.png) [@DennisEagles](https://community.developer.atlassian.com/u/DennisEagles)\
**Post date:** [August 16, 2020, 11:05am UTC](https://community.developer.atlassian.com/t/trello-rest-api-card-colors-covers/38865/7 "2020-08-16T11:05:26Z")

</div>

I’m also not able to get this API endpoint to work.

I’m confused re how & what format I need to provide the cover info.

I can easily change items such as ‘desc’ (which are string format), but per [API reference](https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-id-put) card is an object.

For example, (and i’m using python), using the sample code in the URL above, I can update say the ‘desc’ by adding ‘desc’: ‘updated text in desc field’ to the query dictionary.

But I cant work out how to update the ‘cover’. Getting card data, it appears ‘cover’ is a dictionary in python, as I get the following in response.text  
“cover”:{“idAttachment”:null,“color”:null,“idUploadedBackground”:null,“size”:“normal”,“brightness”:“light”}

I’ve tried passing a cover dictionary via the query. eg attempting to set cover to purple:  
‘cover’: {‘idAttachment’: None, ‘color’: ‘purple’, ‘idUploadedBackground’: None, ‘size’: ‘normal’, ‘brightness’: ‘light’}

How should the cover be specified in the put request’s query parameter ?

---

<div class="post-metadata">

**Author:** ![GauravSrivastava](https://avatars.discourse-cdn.com/v4/letter/g/f1d935/32.png) [@GauravSrivastava](https://community.developer.atlassian.com/u/GauravSrivastava)\
**Post date:** [August 30, 2020, 3:26pm UTC](https://community.developer.atlassian.com/t/trello-rest-api-card-colors-covers/38865/8 "2020-08-30T15:26:14Z")

</div>

@DennisEagles @bentley  
I am facing same issue. Tried to update card cover color but even though I am getting success response, card cover is not updating. Below is the screenshot of the PUT request. Please suggest.

 ![image](https://global.discourse-cdn.com/atlassiandeveloper/original/3X/6/3/637901d7b4bf0181854df28447d4b88ff70be79f.png)

---

<div class="post-metadata">

**Author:** ![RudigerWolf](https://avatars.discourse-cdn.com/v4/letter/r/c6cbf5/32.png) [@RudigerWolf](https://community.developer.atlassian.com/u/RudigerWolf)\
**Post date:** [September 1, 2020, 9:31am UTC](https://community.developer.atlassian.com/t/trello-rest-api-card-colors-covers/38865/9 "2020-09-01T09:31:09Z")

</div>

@GauravSrivastava@DennisEagles  
I am using VSCode “REST.Client” add-in [REST Client - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=humao.rest-client) to work with the Trello API.

The following test\_trello.http file to update a Trello card worked for me.  
Getting a status code of 200 with updated card info.

Update the variables.

```auto
###
@trello_api = https://api.trello.com

@trello_token = 70XXXXXXXXXXb2
# This grants access to the data. This needs to be KEPT SECRET.
# On the same page as https://trello.com/app-key, click the hyperlinked "Token" under the API key.
# click "Allow".

@trello_key = 5XXXXXXXXXXXXXXXXXXXXXXXXc
# You can get your API key by logging into Trello and visiting https://trello.com/app-key
# An API key by itself doesn't grant access to a user's Trello data and could be public.

@trello_card = 5XXXXXXXXXXXXXXX6
# Get the card ID by opening a card on your test Trello board, then delete the name in URL and add .json to the URL, press enter to get a web page with card data, including card ID.

###
# Let check that PUT call is working with simple card name change
PUT {{trello_api}}/1/cards/{{trello_card}}?key={{trello_key}}&token={{trello_token}} HTTP/1.1
content-type: application/json

{
    "name":"Let us change the name to test PUT."
}

###
# Update card cover colour

PUT {{trello_api}}/1/cards/{{trello_card}}?key={{trello_key}}&token={{trello_token}} HTTP/1.1
content-type: application/json

{
"cover":{
            "color":"purple",
            "idAttachment":null,
            "idUploadedBackground":null,
            "size":"normal",
            "brightness":"light"
            }
}

```

---

<div class="post-metadata">

**Author:** ![GauravSrivastava](https://avatars.discourse-cdn.com/v4/letter/g/f1d935/32.png) [@GauravSrivastava](https://community.developer.atlassian.com/u/GauravSrivastava)\
**Post date:** [September 1, 2020, 4:20pm UTC](https://community.developer.atlassian.com/t/trello-rest-api-card-colors-covers/38865/10 "2020-09-01T16:20:04Z")

</div>

> [@RudigerWolf](#):
>
> application/json

@RudigerWolf Thank ou Rudiger. Adding content-type: application/json solved my issue.

---

<div class="post-metadata">

**Author:** ![DennisEagles](https://avatars.discourse-cdn.com/v4/letter/d/d26b3c/32.png) [@DennisEagles](https://community.developer.atlassian.com/u/DennisEagles)\
**Post date:** [September 2, 2020, 5:19am UTC](https://community.developer.atlassian.com/t/trello-rest-api-card-colors-covers/38865/11 "2020-09-02T05:19:24Z")

</div>

Interesting … I was using the example code from Atlassian trello api docs and couldnt get it to work … but with the help of a genius on stackoverflow was able to get it working by passing a ‘json’ parameter in the request with the cover stuff, in addition to the ‘params’ parameter with the key/token.

---

<div class="post-metadata">

**Author:** ![4cello](https://avatars.discourse-cdn.com/v4/letter/4/b9e5f3/32.png) [@4cello](https://community.developer.atlassian.com/u/4cello)\
**Post date:** [February 14, 2021, 12:16am UTC](https://community.developer.atlassian.com/t/trello-rest-api-card-colors-covers/38865/12 "2021-02-14T00:16:30Z")

</div>

Does the API support changing the style of the cover (as seen in the blogpost)? Haven’t found anything about changing the style of a card in the docs, but I could just have been looking in the wrong places.

 ![Different cover styles](https://blog.trello.com/hubfs/Card%20Covers%20%26%20Colors%20GTM!.png)

---

<div class="post-metadata">

**Author:** ![anon96974232](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@anon96974232](https://community.developer.atlassian.com/u/anon96974232)\
**Post date:** [April 5, 2021, 5:39am UTC](https://community.developer.atlassian.com/t/trello-rest-api-card-colors-covers/38865/13 "2021-04-05T05:39:22Z")

</div>

> [@bentley](#):
>
> On the `brightness` options, setting it to `light` will make the text on the card cover dark:  
> And vice versa, setting it to `dark` will make the text on the card cover light:

This is bizarre, flipped logic. The option description above it says:

```
brightness `dark` , `light` Determines whether the text on the cover should be dark or light.

```

So by making the text ‘light’ it comes out black, and by making it ‘dark’ it comes out white?

Really, `brightness` refers to the brightness of what’s BEHIND the text, and you’re setting the color of the text to be the opposite.

---

<div class="post-metadata">

**Author:** ![ShaneReeves](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@ShaneReeves](https://community.developer.atlassian.com/u/ShaneReeves)\
**Post date:** [June 2, 2021, 10:33pm UTC](https://community.developer.atlassian.com/t/trello-rest-api-card-colors-covers/38865/14 "2021-06-02T22:33:53Z")

</div>

Hi @bentley,

Thanks for this information, it has been very useful. I think a recent change with unsplash has perhaps made the image cover no longer function.

When I use the image URL from unsplash, in this instance [black sailing boat digital wallpaper photo – Free Boat Image on Unsplash](https://unsplash.com/photos/DKix6Un55mw)

I get an error “400 url must be from an allowed image service”

If I has images before the domain, that is [https://images.unsplash.com/photos/DKix6Un55mw](https://images.unsplash.com/photos/DKix6Un55mw)

I instead get an error “400 Failed to get image from url”.

I assume based on these two errors that the api is looking for “images.unsplash” to validate that it is an allowed service. However it seems unsplash may not be using this address.

Keen for your insight!

Cheers  
Shane

---

<div class="post-metadata">

**Author:** ![JonasHertz](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@JonasHertz](https://community.developer.atlassian.com/u/JonasHertz)\
**Post date:** [June 11, 2021, 4:35pm UTC](https://community.developer.atlassian.com/t/trello-rest-api-card-colors-covers/38865/15 "2021-06-11T16:35:17Z")

</div>

This is a very neat function but I cannot find any method to remove the Cover from a Card once it is set. Is it possible via the API?

---

<div class="post-metadata">

**Author:** ![JeremiahFischer](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/jeremiahfischer/32/40093_2.png) [@JeremiahFischer](https://community.developer.atlassian.com/u/JeremiahFischer)\
**Post date:** [June 24, 2021, 2:10pm UTC](https://community.developer.atlassian.com/t/trello-rest-api-card-colors-covers/38865/16 "2021-06-24T14:10:51Z")

</div>

@JonasHertz Passing `{"cover": ""}` as the json payload seems to work.

---

<div class="post-metadata">

**Author:** ![TedMead](https://avatars.discourse-cdn.com/v4/letter/t/e79b87/32.png) [@TedMead](https://community.developer.atlassian.com/u/TedMead)\
**Post date:** [January 10, 2022, 10:36pm UTC](https://community.developer.atlassian.com/t/trello-rest-api-card-colors-covers/38865/17 "2022-01-10T22:36:41Z")

</div>

Thank you, thank you, thank you. I thought I tried every combination. Now I just need someone to fix all the head-shaped holes in my walls.

---

<div class="post-metadata">

**Author:** ![bentley](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/bentley/32/36116_2.png) [@bentley](https://community.developer.atlassian.com/u/bentley)\
**Post date:** [August 8, 2022, 8:35pm UTC](https://community.developer.atlassian.com/t/trello-rest-api-card-colors-covers/38865/18 "2022-08-08T20:35:13Z")

</div>

Split this topic on August 8, 2022, 8:35pm UTC

A post was split to a new topic: [Question about POSTing with card covers](https://community.developer.atlassian.com/t/question-about-posting-with-card-covers/60514)
