:::endpoint POST /v1/me/avatar

Replaces the picture on your profile, here and on the website. Like every
upload in this API it is base64 inside JSON. It is cut to a square and stored
as WebP, as the website does.

## Request

```bash
curl -X POST https://api.proppertrading.com/v1/me/avatar \
  -H "Authorization: Bearer ptat_9f2c1a44_3b8e7d2f5c9a1b4e6d8f0a2c4e6b8d1f" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 1f0e3c2a-7b9d-4e6f-8a1c-3d5b7f9e1a2c" \
  -d '{"data": "iVBORw0KGgoAAAANSUhEUgAA..."}'
```

| Field  | Type   | Description |
| ------ | ------ | ----------- |
| `data` | string | The file, base64. A JPEG, PNG or WebP of at most 2 MB. The type is read from the bytes |

## Response

[Your profile](/docs/api/apps/profile), with the new `avatar_url`.

## Errors

| Status | Code                  | Meaning                                         |
| ------ | --------------------- | ----------------------------------------------- |
| 400    | `invalid_avatar`      | Not base64, empty, or not a JPEG, PNG or WebP   |
| 400    | `avatar_too_large`    | Over 2 MB                                       |
| 403    | `insufficient_scope`  | This device does not hold `me:write`            |
| 429    | `rate_limit_exceeded` | Ten a minute                                    |