Avatar URL changed via platform does not return complete

When changing the user’s avatar via the discourse platform or via the api, it does not return the complete url with the cdn, it only returns the avatar path.
ex:
how to return /avatar_test/test/…png

as it should:
https://cdn.example.com/avatar_test/test/......png
How do I always return the full url.