Api save data and duplicate helppp!

Hello two days ago I am with the same and sure is a simple checkbox

I record data from an api when the user is logged in but how do I do it to run only once and then only update the data that enters modified?

gracias perdon mi ignorancia