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

# Get Avatar

> Get a contact's profile picture

Get the profile picture URL for a WhatsApp contact.

## Query Parameters

<ParamField query="phone" type="string" required>
  Phone number to get avatar for
</ParamField>

<ParamField query="preview" type="boolean">
  If `true`, returns thumbnail (96x96). If `false`, returns full image. Default: `false`
</ParamField>

## Response Fields

<ResponseField name="url" type="string">
  Direct URL to the profile picture
</ResponseField>

<ResponseField name="id" type="string">
  Picture ID (changes when picture is updated)
</ResponseField>

<ResponseField name="type" type="string">
  `preview` or `image`
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  # Get full image
  curl -X GET "https://api.livchat.ai/v1/contacts/avatar?phone=5511999999999" \
    -H "Authorization: Bearer YOUR_API_KEY"

  # Get thumbnail
  curl -X GET "https://api.livchat.ai/v1/contacts/avatar?phone=5511999999999&preview=true" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const phone = "5511999999999";
  const response = await fetch(
    `https://api.livchat.ai/v1/contacts/avatar?phone=${phone}&preview=true`,
    {
      headers: {
        Authorization: "Bearer YOUR_API_KEY",
      },
    }
  );

  const { url } = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "url": "https://pps.whatsapp.net/v/t61.24694-24/...",
    "id": "1645308319",
    "type": "preview",
    "directPath": "/v/t61.24694-24/..."
  }
  ```

  ```json 404 theme={null}
  {
    "error": {
      "code": 404,
      "message": "Profile picture not found"
    }
  }
  ```
</ResponseExample>

<Note>
  Profile picture URLs are temporary and may expire. Cache the image data, not the URL.
</Note>
