polyline

Is there a "create polyline" that allows the user to start drawing a polyline in the API? I am interested the code that creates this.