\[ P(\theta \mid y) = \frac{P(y \mid \theta)\,P(\theta)} {P(y)} \]
If
\[ Y \mid \theta \sim \text{Bin}(n,\theta), \qquad \theta \sim \text{Beta}(\alpha,\beta) \]
then the posterior distribution is
\[ \theta \mid y \sim \text{Beta}(\alpha+y,\;\beta+n-y) \]
Posterior mean:
\[ E(\theta \mid y) = \frac{\alpha+y}{\alpha+\beta+n} \]