Beam segments selector

I’m able to use the API to control the Beam.
If I have just 3 segments connected, is there a way I can change color of segment 1 and 2 but not 3 ?

Yes, by using a multizone selector, described at the bottom of this page:

The LIFX Z and Beam work the same way as linear multizone devices.