$\text{Cocone}(D,Y)\simeq \mathscr C(X,Y)\implies X=\text{colim} D$ I'm transferring here the discussion from the comments in this question.
The problem is as follows: Suppose $D:I\to \mathscr C$ is a diagram (= functor) and suppose there's a bijection $$\text{Cocone}(D,Y)\simeq \mathscr C(X,Y)$$
between the cocones on $D$ with vertex $Y$ and arrows $X\to Y$, and this bijection is natural in $Y$. How to prove that $X=\text{colim} D$? The definition of colimit can be found here (p. 126).
I understand how to prove the reverse implication, but the implication described above is unclear.
Consider a cocone $(f_i:D(i)\to Y)_{i\in I}$. We know that there is a unique arrow $\bar f:X\to Y$. That's all I can do. For example, it's not clear what the coprojections $D(i)\to X$ are.
 A: I'll follow tkf's hint.
Suppose we have a bijection $$\text{Cocone}(D,Y)\simeq \mathscr C(X,Y)$$ that is natural in $Y$.
Let's write $$\text{Cocone}(D,Y)\to\mathscr C(X,Y)$$ as $$(f_i)_{i\in I}\mapsto \bar f$$ and its inverse $$\mathscr C(X,Y)\to \text{Cocone}(D,Y)$$ as $$g\mapsto (\widehat g_i)_{i\in I}$$
We show that $((\widehat {1_X})_i: D(i)\to X)_{i\in I}$ is a limit cocone on $D$ in $\mathscr C$. Suppose $(f_i:D(i)\to Y)_{i\in I}$ is a cocone on $D$ in $\mathscr C$. We know that there exists a unique $\bar f:X\to Y$. To prove that $((\widehat {1_X})_i: D(i)\to X)_{i\in I}$ is a limit cocone, it remains to prove that $\bar f\circ (\widehat{1_X})_i=f_i$ for all $i\in I$.
To this end, we use the naturality of the given bijection in $Y$ with respect to $\bar f:X\to Y$. This naturality amounts to saying that the following diagram commutes:

Since bar and hat are inverses of each other, the equality at the bottom says $$(\bar f \circ (\widehat{1_X})_i)_{i\in I}=(f_i)_{i\in I}$$
implying that $\bar f\circ (\widehat{1_X})_i=f_i$ for all $i\in I$.
