Skip to content

Update Avatar

Update user avatar.

Endpoint

http
POST /api/v1/user/avatar

Parameters

Body parameters

ParameterTypeRequiredDescription
avatarfileyesThe user avatar image file. Allowed are png, jpg or jpeg.

Request example

sh
curl --location --request POST 'https://files.ro/api/v1/user/avatar' \
--header 'Content-Type: multipart/form-data' \
--header 'Authorization: Bearer {token}' \
--form 'avatar=@/path/to/file'

Response

json
{
  "type": "success",
  "message": "The avatar was successfully updated."
}
json
{
  "type": "error",
  "message": "You are not authorized"
}
json
{
  "message": "The given data was invalid.",
  "errors": {
    "field": [
      "The field is required."
    ]
  }
}