2020-10-26 17:08:22 -04:00
---
2021-04-23 11:09:37 -04:00
stage: Manage
group: Access
2020-11-26 01:09:20 -05:00
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
2020-10-26 17:08:22 -04:00
---
2018-05-18 04:49:02 -04:00
# Avatar API
2020-02-06 10:09:11 -05:00
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/19121) in GitLab 11.0.
2018-05-18 04:49:02 -04:00
## Get a single avatar URL
2021-03-12 16:09:12 -05:00
Get a single [avatar ](../user/profile/index.md#access-your-user-settings ) URL for a user with the given email address.
2018-05-18 04:49:02 -04:00
2019-01-15 13:27:21 -05:00
If:
- No user with the given public email address is found, results from external avatar services are
returned.
2020-11-19 16:09:07 -05:00
- Public visibility is restricted, response is `403 Forbidden` when unauthenticated.
2019-01-15 13:27:21 -05:00
2020-12-04 16:09:29 -05:00
NOTE:
2019-01-15 13:27:21 -05:00
This endpoint can be accessed without authentication.
2020-05-19 23:08:04 -04:00
```plaintext
2018-05-18 04:49:02 -04:00
GET /avatar?email=admin@example.com
```
2019-01-15 13:27:21 -05:00
Parameters:
2018-05-18 04:49:02 -04:00
2019-01-15 13:27:21 -05:00
| Attribute | Type | Required | Description |
|:----------|:--------|:---------|:----------------------------------------------------------------------------------------------------------------------------------------|
| `email` | string | yes | Public email address of the user. |
2021-01-07 16:10:18 -05:00
| `size` | integer | no | Single pixel dimension (because images are squares). Only used for avatar lookups at `Gravatar` or at the configured `Libravatar` server. |
2019-01-15 13:27:21 -05:00
Example request:
2020-01-30 10:09:15 -05:00
```shell
2020-05-27 20:08:37 -04:00
curl "https://gitlab.example.com/api/v4/avatar?email=admin@example.com& size=32"
2018-05-18 04:49:02 -04:00
```
Example response:
```json
{
2019-01-15 13:27:21 -05:00
"avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=64& d=identicon"
2018-05-18 04:49:02 -04:00
}
```