Existence of Distribution with Given Multivariate Marginals

Consider discrete random variables $$X_1,\cdots, X_n$$, and let $$D$$ be their joint distribution. For each subset $$S\subseteq[n]$$ let $$D_S$$ be the marginal distribution $$(X_i)_{i\in S}$$.

Fix $$k. Suppose you are given, for every $$S$$ of size $$k$$, a distribution $$D_S$$. Under what conditions do the distributions $$\{D_S\}_{S\subseteq[n],|S|=k}$$ correspond to marginals of some distribution joint $$D$$?

In the case $$k=1$$, the solution is trivial: every set of distributions $$(D_{\{i\}})_{i\in[n]}$$ is the set of marginal distributions of the product distribution $$D_{\{1\}}\times\cdots\times D_{\{n\}}$$.

For $$k>1$$, a necessary condition is that the $$D_S$$ are consistent: for any two sets $$S_0,S_1$$ of size $$k$$, let $$T=S_0\cap S_1$$. Then we require that the marginal distribution of $$D_{S_0}$$ restricted to $$T$$ is identical to the marginal distribution of $$D_{S_1}$$ restricted to $$T$$.

Is consistency sufficient for the extistence of a joint distribution $$D$$? If not, are there any simple conditions under which we can conclude that a joint distribution $$D$$ exists? Note that I only care about existence, and do not care if the joint distribution is unique or how to actually compute the joint distribution.

It turns out that consistency is not sufficient, even in the case $$k=2$$. Suppose the domain is just $$\{0,1\}$$. Consider the case where are the pairwise marginal distributions are uniform over pairs of distinct elements, that is uniform over $$\{01,10\}$$. Then all the variables $$X_i$$ are just uniform, giving consistency. However, any joint distribution $$D$$ with the given marginals would have to have all the $$X_i$$ be distinct. This is clearly impossible for $$n\geq 3$$.