> ## Documentation Index
> Fetch the complete documentation index at: https://developer.rocket.chat/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Avatars

> Note:
  * This is a RESTful endpoint that sits separately from the REST API in the server codebase and behaves slightly differently.
  * The `rc_uid` and `rc_token` can alternately be provided as cookies (already present in the web interface), but not as auth headers.
  * When requesting the avatar of a user, if they have a custom avatar set, this will override the user's choices of format or size.
  * If no uploaded avatar exists for a user, a default one will be generated for them based on the initial of their username in a randomly colored square.
  * If `UI_Use_Name_Avatar` is set and the user has a real name set, the generated avatar will be based on their actual name instead of the username.
  * If no format is requested, or the format requested isn't supported, the format returned will be SVG.

## OpenAPI

````json GET /api/v1/avatar/{subject}
{
  "openapi": "3.0.0",
  "info": {
    "version": "1.0.0",
    "title": "User Management"
  },
  "servers": [
    {
      "url": "https://apiexplorer.support.rocket.chat"
    }
  ],
  "tags": [
    {
      "name": "LDAP"
    },
    {
      "name": "Permissions"
    },
    {
      "name": "Roles"
    },
    {
      "name": "Users"
    }
  ],
  "paths": {
    "/api/v1/avatar/{subject}": {
      "parameters": [
        {
          "schema": {
            "type": "string"
          },
          "example": "alice, @general",
          "name": "subject",
          "in": "path",
          "required": "true",
          "description": "Name of the user or channel.  Channels are always preceded by an `@` symbol. Rooms that are DMs are always represented by the other participant's user avatar."
        }
      ],
      "get": {
        "summary": "Get Avatars",
        "operationId": "get-api-v1-avatar-subject",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "image/svg+xml": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          }
        },
        "description": "Note:\n  * This is a RESTful endpoint that sits separately from the REST API in the server codebase and behaves slightly differently.\n  * The `rc_uid` and `rc_token` can alternately be provided as cookies (already present in the web interface), but not as auth headers.\n  * When requesting the avatar of a user, if they have a custom avatar set, this will override the user's choices of format or size.\n  * If no uploaded avatar exists for a user, a default one will be generated for them based on the initial of their username in a randomly colored square.\n  * If `UI_Use_Name_Avatar` is set and the user has a real name set, the generated avatar will be based on their actual name instead of the username.\n  * If no format is requested, or the format requested isn't supported, the format returned will be SVG.",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "example": "png",
            "in": "query",
            "name": "format",
            "description": "Format of the image requested.  The values can be one of: jpg, jpeg, png."
          },
          {
            "schema": {
              "type": "integer"
            },
            "example": "50",
            "in": "query",
            "name": "size",
            "description": "Width and height of the image. Default: 200"
          },
          {
            "schema": {
              "type": "string"
            },
            "example": "aobEdbYhXfu5hkeqG",
            "in": "query",
            "name": "rc_uid",
            "description": "User ID for authenticating is only required if `Accounts_AvatarBlockUnauthenticatedAccess` is enabled."
          },
          {
            "schema": {
              "type": "string"
            },
            "example": "9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq",
            "in": "query",
            "name": "rc_token",
            "description": "User auth token for authenticating is only required if `Accounts_AvatarBlockUnauthenticatedAccess` is enabled."
          }
        ],
        "tags": [
          "Users"
        ]
      }
    }
  }
}
````

