# Get avatar

Get avatar image for an account using a unique ID.

To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) you'll need to specify the `/profile-enrichment.read` scope.

## GET

`/avatars/{uniqueID}`

## Ask

```shell
curl -X GET "https://api.moov.io/avatars/{uniqueID}" \
  -H "Authorization: Bearer {token}" \
  -H "X-Moov-Version: v2026.04.00"
```

## Ask

```typescript
import { Moov } from "@moovio/sdk";

const moov = new Moov({
  security: {
    username: "",
    password: "",
  },
});

async function run() {
  const result = await moov.avatars.get({
    uniqueID: "<id>",
  });

console.log(result);
}

run();
```

## Ask

```php
declare(strict_types=1);

require 'vendor/autoload.php';

use Moov\MoovPhp;
use Moov\MoovPhp\Models\Components;

$sdk = MoovPhp\Moov::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$response = $sdk->avatars->get(
    uniqueID: '<id>'
);

if ($response->bytes !== null) {
    // handle response
}
```

## Ask

```java
package hello.world;

import io.moov.sdk.Moov;
import io.moov.sdk.models.components.Security;
import io.moov.sdk.models.operations.GetAvatarResponse;
import java.lang.Exception;

public class Application {

public static void main(String[] args) throws Exception {

Moov sdk = Moov.builder()
                .security(Security.builder()
                    .username("")
                    .password("")
                    .build())
            .build();

GetAvatarResponse res = sdk.avatars().get()
                .uniqueID("<id>")
                .call();

if (res.responseStream().isPresent()) {
            // handle response
        }
    }
}
```

## Ask

```python
from moovio_sdk import Moov
from moovio_sdk.models import components

with Moov(
    security=components.Security(
        username="",
        password="",
    ),
) as moov:

res = moov.avatars.get(unique_id="<id>")

# Handle response
    print(res)
```

## Ask

```ruby
require 'moov_ruby'

Models = ::Moov::Models
s = ::Moov::Client.new(
  security: Models::Components::Security.new(
    username: '',
    password: ''
  )
)
res = s.avatars.get(unique_id: '<id>')

unless res.bytes.nil?
  # handle response
end
```

## Ask

```csharp
using Moov.Sdk;
using Moov.Sdk.Models.Components;

var sdk = new MoovClient(security: new Security() {
    Username = "",
    Password = "",
});

var res = await sdk.Avatars.GetAsync(uniqueID: "<id>");

// handle response
```

## The request has succeeded.

### File Response

Returns an image file (image/*).

### Response headers

A unique identifier used to trace requests.

### Error Responses

- The request contained missing or expired authentication.
- The user is not authorized to make the request.
- The requested resource was not found.
- Request was refused due to rate limiting.
- The request failed due to an unexpected error.
- The request failed because a downstream service failed to respond.

### Version Header

Set this header to v2026.04.00 to use the API described in this specification. When omitted, the server defaults to v2024.01.00, which may not match the behavior documented here.

### Possible values:

`v2026.04.00`

Any unique ID associated with an account such as accountID, representativeID, routing number, or userID.

Returns an image file (image/*).
