Create new flight plan using SDK while in-flight

I’m thinking about building a flight planner that can become the new flight
plan for a given flight while in-flight. Does anyone know how to do this? Or a
reference to the API methods that can do this?