Use this API to retrieve and upload avatars for users, groups, and projects.

Return avatar url for a user

GET /api/v4/avatar

Parameters

NameTypeDescription
email
Query, required
StringPublic email address of the user
size
Query
IntegerSingle pixel dimension for Gravatar images

Responses

CodeDescriptionSchema
200OKAPIEntitiesAvatar
400Bad Request—

Download a group avatar

GET /api/v4/groups/{id}/avatar

Downloads a group avatar image.

Parameters

NameTypeDescription
id
Path, required
StringThe ID of the group

Responses

CodeDescriptionSchema
200OKString (binary) (application/octet-stream)
400Bad Request—
404Not Found—

Download a project avatar

GET /api/v4/projects/{id}/avatar

Downloads a project avatar. You can access this endpoint without authentication if the project is publicly accessible. This feature was introduced in GitLab 16.9.

Parameters

NameTypeDescription
id
Path, required
String or integerID or URL-encoded path of the project

Responses

CodeDescriptionSchema
200OKString (binary) (application/octet-stream)
400Bad Request—
404Not Found—

Upload an avatar

PUT /api/v4/user/avatar

Uploads an avatar for the currently authenticated user. This feature was introduced in GitLab 17.0.

Request body (multipart/form-data)

PropertyTypeDescription
avatar
Required
String (binary)The avatar file (generated by Multipart middleware)

Responses

CodeDescriptionSchema
200OKAPIEntitiesAvatar
400Bad Request—

Schemas

Objects returned by the operations above and objects nested in their request bodies.

APIEntitiesAvatar

PropertyTypeDescription
avatar_urlString—