As pointed out to me by Marta Bunge, the observation that the presheaf construction exhibits the free small-cocompletion for a small category is due to Pitts, and is proven as Corollary 1.3 of [On product and change of base for toposes](https://www.cl.cam.ac.uk/~amp12/papers/procbt/procbt.pdf) (1985). Andrew Pitts confirmed that he did not believe the result had been observed earlier, and was not part of the categorical folklore before that point.