Back to Gitlabhq

Avatar API

doc/api/avatar.md

18.11.21.4 KB
Original Source

{{< details >}}

  • Tier: Free, Premium, Ultimate
  • Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated

{{< /details >}}

Use this API to interact with user avatars.

Retrieve user account avatar

Retrieves the URL of a user account avatar associated with a specified public email address. This endpoint does not require authentication.

  • If successful, returns the URL of the avatar.
  • If no account is associated with the given email address, returns results from external avatar services.
  • If the public visibility is restricted and the request isn't authenticated, returns 403 Forbidden.
plaintext
GET /[email protected]

Parameters:

AttributeTypeRequiredDescription
emailstringyesPublic email address of the account.
sizeintegernoSingle pixel dimension. Only used for avatar lookups at Gravatar or a configured Libravatar server.

Example request:

shell
curl --request GET \
  --url "https://gitlab.example.com/api/v4/[email protected]&size=32"

Example response:

json
{
  "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=64&d=identicon"
}