Let $\{X_1 \rightrightarrows X_0\}$ be a smooth groupoid object in the category of affine schemes ($X_0 \to X_1$, $X_1 \to X_1$ and $X_1 \times_{X_0} X_1 \to X_1$ also belong to the datum). Equivalently, we have a smooth commutative Hopf algebroid. Let $X$ be the associated algebraic stack. Thus, we have a presentation $X_0 \twoheadrightarrow X$ (which is smooth, surjective and affine) with $X_0 \times_X X_0 = X_1$, and $X$ is geometric. Every geometric stack arises this way.

**Question.** If $Y$ is a scheme, how can we describe $X(Y)$ explicitly in terms of $Y$ and the $X_i$?

This should be somewhere in the literature? For example, if $X_0 = \mathrm{Spec}(\mathbb{Z})$, then $X_1$ is a group scheme, $X$ is its classifying stack, so that $X(Y)$ consists of $X_1$-torsors on $Y$, right?

In general, I expect that the answer will be some kind of "torsors under the groupoid". A morphism $Y \to X$ may be pulled back to $Y_0 \to X_0$, where $Y_0 \to Y$ is smooth, surjective and affine. Conversely, if $Y_0 \to Y$ is smooth, surjective and affine, and $Y_0 \to X_0$ is a morphism, then an extension to $Y \to X$ corresponds to a descent datum of $Y_0 \to X_0 \to X$ with respect to the fpqc cover $Y_0 \to Y$. But this still involves $X$. How can we get rid of $X$ in the description of morphisms $Y \to X$?