The earliest reference I can find to the universal property of the presheaf construction is Remark 2.29 of Ulmer's Properties of Dense and Relative Adjoint Functors (1968). However, the proof is only lightly sketched, and in the introduction Ulmer states:
As an application of relative adjoints we will show in a subsequent paper that every category $\mathbf M'$ admits a free right complete category.
As far as I can tell, this paper never appeared. Note that Ulmer actually considers the universal property for arbitrary (possibly large) categories, by taking small presheaves rather than arbitrary presheaves.
There is an earlier reference for the universal property of the Ind-completion (i.e. cocompletion under filtered colimits) in Proposition 8.7.3 of SGA4 (dated 1963–1964, but published in 1972), which suggests the universal property of free cocompletion was also known as this time, though an explicit statement does not appear.
In the enriched context, the universal property first appears as Theorem 2.11 of Lindner's Morita equivalences of enriched categories (1974), where the Lindner attributes the unenriched result to Ulmer.