> ## Documentation Index
> Fetch the complete documentation index at: https://gowa-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# User Avatar



## OpenAPI

````yaml /openapi.yml get /user/avatar
openapi: 3.0.0
info:
  title: WhatsApp API MultiDevice
  version: 9.7.0
  description: |
    This API is used for sending whatsapp via API.

    The web dashboard is a separate project (gowa-ui); the server downloads its
    latest release asset and serves it at `/` (or returns a JSON banner when
    APP_UI_ENABLED=false).

    Device scoping:
    - Send `X-Device-Id` on all device-scoped REST calls.
    - WebSocket: connect to `/ws?device_id=<id>`.
    - WebSocket auth (when basic auth is enabled): browsers cannot set an
      Authorization header on WebSocket connections, so also pass
      `&authorization=<base64(user:pass)>` in the query string. Use TLS in
      production since the credential is visible in the URL.
servers:
  - url: http://localhost:3000
security:
  - basicAuth: []
tags:
  - name: app
    description: Initial Connection to Whatsapp server
  - name: device
    description: Device management for multi-device support
  - name: user
    description: Getting information
  - name: send
    description: Send Message (Text/Image/File/Video).
  - name: message
    description: Message manipulation (revoke/react/update).
  - name: call
    description: Call management (reject incoming calls)
  - name: chat
    description: Chat conversations and messaging
  - name: group
    description: Group setting
  - name: newsletter
    description: newsletter setting
  - name: chatwoot
    description: Chatwoot integration for customer support
paths:
  /user/avatar:
    get:
      tags:
        - user
      summary: User Avatar
      operationId: userAvatar
      parameters:
        - $ref: '#/components/parameters/DeviceIdHeader'
        - name: phone
          in: query
          schema:
            type: string
          example: 6289685028129@s.whatsapp.net
          description: Phone number with country code
        - name: is_preview
          in: query
          schema:
            type: boolean
          example: true
          description: Whether to fetch a preview of the avatar
        - name: is_community
          in: query
          schema:
            type: boolean
          example: false
          description: Whether to fetch a community avatar
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserAvatarResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBadRequest'
        '403':
          description: >-
            AVATAR_HIDDEN: the contact hides the picture from this account (says
            nothing about whether one exists)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorForbidden'
              example:
                code: AVATAR_HIDDEN
                message: the user has hidden their profile picture from you
        '404':
          description: >-
            The contact has no profile picture (AVATAR_NOT_SET) or the device is
            unknown (DEVICE_NOT_FOUND). Check `code`, not only the status.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorNotFound'
              examples:
                avatarNotSet:
                  summary: The contact has no profile picture
                  value:
                    code: AVATAR_NOT_SET
                    message: that user or group does not have a profile picture
                deviceNotFound:
                  summary: Unknown device
                  value:
                    code: DEVICE_NOT_FOUND
                    message: >-
                      device not found; create a device first from /api/devices
                      or provide a valid X-Device-Id
                    results:
                      device_id: my-device
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInternalServer'
components:
  parameters:
    DeviceIdHeader:
      name: X-Device-Id
      in: header
      required: false
      description: >
        Device identifier for multi-device support. Required when multiple
        devices are registered.

        If only one device is registered, it will be used as the default.

        Can also be provided as `device_id` query parameter.
      schema:
        type: string
        example: my-device-id
  schemas:
    UserAvatarResponse:
      type: object
      properties:
        code:
          type: string
          example: SUCCESS
        message:
          type: string
          example: Success
        results:
          type: object
          properties:
            url:
              type: string
              example: >-
                https://pps.whatsapp.net/v/t61.24694-24/181358562_385581386633509_6230178822944778044_n.jpg?ccb=11-4&oh=df36c5b990497b8a5758a0f1ad8118a8&oe=620AA726
            id:
              type: string
              example: '1635239861'
            type:
              type: string
              example: image
    ErrorBadRequest:
      type: object
      properties:
        code:
          type: string
          example: 400
          description: HTTP Status Code
        message:
          type: string
          example: field cannot be blank
          description: Detail error message
        results:
          type: object
          example: null
          description: additional data
    ErrorForbidden:
      type: object
      properties:
        code:
          type: string
          example: AVATAR_HIDDEN
          description: SYSTEM_CODE_ERROR
        message:
          type: string
          example: the user has hidden their profile picture from you
          description: Detail error message
        results:
          type: object
          description: additional data
    ErrorNotFound:
      type: object
      properties:
        code:
          type: string
          example: 404
          description: HTTP Status Code
        message:
          type: string
          example: Chat not found
          description: Detail error message
        results:
          type: object
          example: null
          description: additional data
    ErrorInternalServer:
      type: object
      properties:
        code:
          type: string
          example: INTERNAL_SERVER_ERROR
          description: SYSTEM_CODE_ERROR
        message:
          type: string
          example: you are not loggin
          description: Detail error message
        results:
          type: object
          example: null
          description: additional data
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````

## Related topics

- [User Change Avatar](https://gowa-docs.mintlify.site/api-reference/user/user-change-avatar.md)
- [Errors](https://gowa-docs.mintlify.site/api-reference/errors.md)
- [User Info](https://gowa-docs.mintlify.site/api-reference/user/user-info.md)
- [User My List Groups](https://gowa-docs.mintlify.site/api-reference/user/user-my-list-groups.md)
- [Get list of user contacts](https://gowa-docs.mintlify.site/api-reference/user/get-list-of-user-contacts.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.