**Purely imaginary $B$**
The real $A$ is unique. This is because when $z=\rho e^{i\theta}\in\mathbb{C}\backslash\\{0\\}$ where $\rho\in\mathbb{R}^+$ and $\theta\in\mathbb{R}$, $\rho$ is unique as $\rho=|z|$. To have the desired form, the only possibility for $A$ is such that $e^{-A}=\rho$, and that is $A=-\ln{\rho}=\ln{\frac{1}{\rho}}$.
$B$, on the other hand, is not unique. Recall that $$\forall\theta\in\mathbb{R},\,e^{i\theta}=\cos\theta+i\sin\theta$$ and since $\cos$ and $\sin$ are $2\pi$-periodic, we have $$\forall\theta\in\mathbb{R},\forall n\in\mathbb{Z},e^{i\theta}=e^{i(\theta+2\pi n)}$$
Thus, if $B$ is such that $z=e^{-A}e^{-B}$ then for any $n\in\mathbb{Z}$, $B_n=B+2\pi n$ satisfies $z=e^{-A}e^{-B_n}$ and $B_n$ is purely imaginary.
**Complex $B$**
When you don't ask for $B$ to be purely imaginary, even $A$ isn't unique:$$z=e^{-A}e^{-B}=e^{-\frac{A}{2}}e^{-\left(\frac{A}{2}+B\right)}=e^{-(A+B)}$$