The idea that stacks can be identified with groupoids internal to the base site $S$ up to what is variously called essential/Morita equivalence is well known. The basic idea is that one takes the 2-category of internal groupoids and localises with respect to internal functors $f:X\to Y$ such that
$$X\_1 \simeq X\_0^2\times\_{f\_0^2,Y\_0^2,(s,t)} Y\_1$$
("$f$ is fully faithful") and the composite map
$$X\_0\times\_{f\_0,Y\_0,s}Iso(Y\_1) \stackrel{pr\_2}{\to} Iso(Y\_1) \stackrel{t}{\to} Y\_0 \qquad (1)$$
is some sort of "surjective" map. What this means depends on the site one works with. For example, one could be working with Lie groupoids, then (1) is a surjective submersion. Or topological groupoids and (1) admits local sections. The oldest reference I know to this sort of functor is in



> 
> M. Bunge and R. Paré, Stacks and equivalence of indexed categories, Cahiers Topologie
> Geom. Differentielle 20 (1979), no. 4, 373–399.
> 
> 
> 


where they take $S$ to be finitely complete and regular, and (1) to be a regular epimorphism. Bunge and Paré call the externalisation of such an internal functor a weak equivalence.


Is this the earliest reference to this idea of weak equivalences of internal categories/groupoids?



Who first came up with the idea of essential/Morita equivalence of internal groupoids/categories?
The stacks studied in the reference [1] are fibrations over a base topos **S** not internal to a site S. The notion of an intrinsic stack originates with Lawvere, where one replace a site S with the site consisting of the class epimorphisms in the topos **S**. In this sense, the reference given is the first one in the literature. It is not needed that
**S** be a topos as mentioned above by David Roberts.


[1] Marta Bunge and Robert Pare, Stacks and Equivalence of Indexed Categories, Cahiers de Topologie et Geometrie Differentielle Categoriques XX-4 (1979) 373-399


