Document query endpoint