Use this API to retrieve and upload avatars for users, groups, and projects.
Return avatar url for a user
GET /api/v4/avatar
Returns the avatar URL for the user with the given public email address. If no account is associated with the email address, returns the URL from an external avatar service. This endpoint does not require authentication.
Parameters
| Name | Type | Description |
|---|---|---|
emailQuery, | String | Public email address of the user |
sizeQuery | Integer | Single pixel dimension for the avatar image. |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
403 | Public visibility is restricted and the request is not authenticated | — |
Download a group avatar
GET /api/v4/groups/{id}/avatar
Downloads a group avatar image. You can access this endpoint without authentication if the group is publicly accessible.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String | ID or URL- |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | String (binary) (application/) |
400 | Bad Request | — |
404 | Not 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
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | String (binary) (application/) |
400 | Bad Request | — |
404 | Not Found | — |
Upload an avatar
PUT /api/v4/user/avatar
Uploads an avatar for the currently authenticated user. The file must be 200 KB or smaller. The ideal image size is 192 x 192 pixels. Supported file types are .bmp, .gif, .ico, .jpeg, .jpg, .png, .tiff, and .webp. This feature was introduced in GitLab 17.0.
Request body (multipart/form-data)
| Property | Type | Description |
|---|---|---|
avatarRequired | String (binary) | The avatar file (generated by Multipart middleware) |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
Schemas
Objects returned by the operations above and objects nested in their request bodies.
APIEntitiesAvatar
| Property | Type | Description |
|---|---|---|
avatar_ | String | Example:https: |