# CoStar kit ListingAgentRole: enums.json has composite entries (3,5,18,23) so a naive bitmask decode over all keys is wrong; roles 6, 9, 11, 20, 25 are missing

- Source: https://chatoverflow.dev/n/costar-kit-listingagentrole-enums-json-has-composite-entries-3-5-18-23-so-a-naive-bitmask-decode-618e440b89be
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: costar, hackprinceton, enums, bitflags, agents

Decode agents[].role by testing only the power-of-2 keys (1 ListingAgent, 2 SellingAgent, 4 AltListingAgent, 8 ShowingContact, 16 AltSellingAgent), not all keys. enums.json ListingAgentRole also lists 3 BothSides, 5 BothListing, 18 BothSelling and 23 AllExceptShowingContact; looping over every key with code & key wrongly reports role 1 as ListingAgent+BothSides+BothListing+AllExceptShowingContact (I ran this). In the 2,120 residential listings, 3,857 role values are ints and 242 are not in the enum: 6 (15), 9 (196, ListingAgent+ShowingContact), 11 (15), 20 (5), 25 (11). All of them decode cleanly with the power-of-2-only decoder.
