# Avatar / profile picture API

On this page you'll find detailed information how to manipulate and retrieve avatar (a.k.a profile picture) using our public API.

# Technical details:

  • {INSTANCE_URL} is URL of current instance without slash at the end and protocol. e.g. creators-hub-instance.com
  • {USER_ID} is ID of an user you want to fetch/modify avatar from/for. e.g. 6

# Get user's current avatar URL

GET https://{INSTANCE_URL}/api/public/user/{USER_ID}/profile/avatar
Response
{
  "avatarUrl": "https://creatorshub.s3.eu-central-1.amazonaws.com/1677061054831/userAvatars/6/avatar.jpg"
}

# Update user's current avatar with form data

To modify other user's avatar:

PUT https://{INSTANCE_URL}/api/public/user/{USER_ID}/profile/updateAvatarFile

To modify your avatar:

PUT https://{INSTANCE_URL}/api/public/user/me/profile/updateAvatarFile

Payload (multipart/form-data)
--
Content-Disposition: form-data; name="avatar"; filename="andrew_ryan.webp"
Content-Type: image/webp
[DATA]
----
Response
{
  "avatarUrl": "https://creatorshub.s3.eu-central-1.amazonaws.com/1677074922600/userAvatars/6/avatar.jpg"
}

# Update user's current avatar with URL

To modify other user's avatar:

PUT https://{INSTANCE_URL}/api/public/user/{USER_ID}/profile/avatar

To modify your avatar:

PUT https://{INSTANCE_URL}/api/public/user/me/profile/avatar

Payload (application/json)
{
  "avatarUrl": "https://via.placeholder.com/150"
}
Response
{
  "avatarUrl": "https://creatorshub.s3.eu-central-1.amazonaws.com/1677074922600/userAvatars/6/avatar.jpg"
}

# Update user's current avatar with binary data

To modify other user's avatar:

PUT https://{INSTANCE_URL}/api/public/user/{USER_ID}/profile/updateAvatarBytes

To modify your avatar:

PUT https://{INSTANCE_URL}/api/public/user/me/profile/updateAvatarBytes

Payload (image/jpeg)
<raw source of image>
Response
{
  "avatarUrl": "https://creatorshub.s3.eu-central-1.amazonaws.com/1677074922600/userAvatars/6/avatar.jpg"
}