PUT/v2/user/avatar

Upload an avatar

Uploads an avatar for the authenticated user's account. Send the image as the avatar field in a multipart form request; the response contains the updated user profile.

1 body field

Multipart form data containing the avatar file.

avatarstringrequired
The image file to use as the authenticated user's avatar.

5 status codes
200Returns the updated user profile, including the avatar details, account ID, username, and account status fields.
accountTypestringrequired
Allowed:LOCALMANAGEDTHIRD_PARTY
avatarobjectoptional
deletablebooleanrequired
domainstringoptional
emailAwaitingVerificationstringoptional
globalServerRolestringrequired
Allowed:USERADMINSUPPORTER
idintegerrequired
mfaEnabledbooleanrequired
namestringoptional
needsSuperJwtTokenbooleanrequired
thirdPartyAuthTypestringoptional
Allowed:GOOGLEGITHUBOAUTH2SSOSSO_GLOBAL
usernamestringrequired
400Returned when the `avatar` field is missing or the upload request is invalid.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
401Returned when the request is unauthenticated.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
403Returned when the authenticated user is not permitted to change the profile.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
404Returned when the user profile cannot be found.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional

Error handling

A 400 is returned when the avatar field is missing or the upload request is invalid. A 401 is returned when the request is unauthenticated, a 403 when the authenticated user is not permitted to change the profile, and a 404 when the user profile cannot be found. Include the file in the avatar multipart form field.