Fuselage
Powered By GitBook
Set Avatar
URL
Requires Auth
HTTP Method
/api/v1/users.setAvatar
yes
POST

Uploading a File

Arguments

Argument
Example
Required
Description
image
Any image file
Required
The image file to use as the new avatar, as form data.
userId or username
BsNr28znDkG8aeo7W
Optional
The id or username of the user. If not provided, the auth user is updated.

Example Call

1
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
2
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
4
http://localhost:3000/api/v1/users.setAvatar
Copied!

Example Result

1
{
2
"success": true
3
}
Copied!

Providing a URL

Arguments

Argument
Example
Required
Description
avatarUrl
http://domain.tld/to/my/own/avatar.jpg
Required
URL of the new avatar for the user.
userId or username
BsNr28znDkG8aeo7W
Optional
The id or username of the user. If not provided, the auth user is updated.

Example Call

1
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
2
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
3
-H "Content-type:application/json" \
4
-d '{"avatarUrl": "http://domain.tld/to/my/own/avatar.jpg"}' \
5
http://localhost:3000/api/v1/users.setAvatar
Copied!

Example Result

1
{
2
"success": true
3
}
Copied!

Change Log

Version
Description
0.56.0
Add support for username argument.
0.48.0
Set other users avatars if the callee has permission.
0.46.0
Added
Last modified 6mo ago