Channel Points API - Background Color

I’m working with the create custom rewards endpoint and am having trouble with the background color. When I submit a request it returns:
{
error: ‘Bad Request’,
status: 400,
message: ‘CREATE_CUSTOM_REWARD_BACKGROUND_COLOR_INVALID’
}
The background color is a hex color(including the # sign) and of type string. The only time I don’t get this error is when I hard code the example hex color they provide in the docs(’#00E5CB’). If I choose another hex color and hard code it in, it stops working.

Is there only one option for which color to use? Or am I missing something?

Can you provide an example request/payload that you are sending

Sure!

This request body seems to work just fine:
{“title”:“testreward”,“prompt”:“test”,“cost”:“5”,“is_enabled”:true,“background_color”:"#00E5CB",“is_user_input_required”:false,“is_max_per_user_per_stream_enabled”:false,“is_global_cooldown_enabled”:false,“global_cooldown_seconds”:0,“should_redemptions_skip_request_queue”:false}

whereas this one does not seem to work:
{“title”:“testreward”,“prompt”:“test”,“cost”:“5”,“is_enabled”:true,“background_color”:"#71f1b1",“is_user_input_required”:false,“is_max_per_user_per_stream_enabled”:false,“is_global_cooldown_enabled”:false,“global_cooldown_seconds”:0,“should_redemptions_skip_request_queue”:false}
{

Use #71F1B1 not #71f1b1

Hex colours need to be in ALLCAPS

Update: I opened a documentation fix request https://github.com/twitchdev/issues/issues/262

1 Like

You are a genius! Thank you sir :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.