generate snippet rest api update