  We introduce and study the notion of functorial Borel complexity for Polish
groupoids. Such a notion aims at measuring the complexity of classifying the
objects of a category in a constructive and functorial way. In the particular
case of principal groupoids such a notion coincide with the usual Borel
complexity of equivalence relations. Our main result is that on one hand for
Polish groupoids with essentially treeable orbit equivalence relation,
functorial Borel complexity coincides with the Borel complexity of the
associated orbit equivalence relation. On the other hand for every countable
equivalence relation $E$ that is not treeable there are Polish groupoids with
different functorial Borel complexity both having $E$ as orbit equivalence
relation. In order to obtain such a conclusion we generalize some fundamental
results about the descriptive set theory of Polish group actions to actions of
Polish groupoids, answering a question of Arlan Ramsay. These include the
Becker-Kechris results on Polishability of Borel $% G $-spaces, existence of
universal Borel $G$-spaces, and characterization of Borel $G$-spaces with Borel
orbit equivalence relations.
