How valid_reactions comes inside topics post API?

I am trying to use this API https://meta.discourse.org/discourse-reactions/posts/1343035/custom-reactions/heart/toggle.json for post like/unlike, but this API is not working for me. Do we need to add some plugin for custom reactions?

Through reverse engineering, I saw that in this API they have a valid_reactions array. https://meta.discourse.org/t/313277.json?track_visit=true&forceLoad=true

When I call the same API, there is no valid_reactions array for me.