Restricted routing zones specified by a polygon

Is there any documentation or code example how to start?