企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# Avatar API > 原文:[https://docs.gitlab.com/ee/api/avatar.html](https://docs.gitlab.com/ee/api/avatar.html) * [Get a single avatar URL](#get-a-single-avatar-url) # Avatar API[](#avatar-api "Permalink") 在 GitLab 11.0 中[引入](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/19121) . ## Get a single avatar URL[](#get-a-single-avatar-url "Permalink") 使用给定的电子邮件地址为用户获取一个[头像](../user/profile/index.html#profile-settings) URL. If: * 找不到具有给定公共电子邮件地址的用户,返回来自外部化身服务的结果. * 公开可见性受到限制,未经身份验证时,响应将为`403 Forbidden` . **注意:**无需身份验证即可访问此端点. ``` GET /avatar?email=admin@example.com ``` Parameters: | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `email` | string | yes | 用户的公共电子邮件地址. | | `size` | integer | no | 单像素尺寸(因为图像是正方形). 仅用于在`Gravatar`或已配置的`Libravatar`服务器上的头像查找. | 请求示例: ``` curl "https://gitlab.example.com/api/v4/avatar?email=admin@example.com&size=32" ``` 响应示例: ``` { "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=64&d=identicon" } ```