Add in leaveDoc end point