ChirpStack v4 rest api get Event

how can i get uplink events with rest api ?
or how can i set retain flag for ChirpStack Mqtt ?

There is an api method to retrieve a devices events (I use the gRPC so I can’t help you with REST), but by default Chirpstack does not store the uplinks for long (I think only 10 uplinks at a time) so retrieving uplinks / device metrics through the API is less than ideal. The recommended way to retrieve data from Chirpstack is by using the integrations. I would recommend the postgres one for storage of device events.