# Set my photo

Upload the CALLER's own photo as `{"data": <base64>}` — a PNG, JPEG, WebP or SVG up to 5MB and 4096 pixels a side — and make it their profile's avatar. The service reads the type from the bytes, drops their metadata (EXIF GPS, XMP, comments; a JPEG's orientation is applied first) and refuses an SVG that could run script or load anything. Answers 201 with the stored picture and its public `url`, which the roster and /v1/me now carry as the avatar. Needs a seat: the picture is stored under the caller's workspace. 503 with no file storage or no public base URL.

Access class: `workspace`.

## Endpoint

`POST /v1/me/avatar`

## Request body

Content type: `application/json`.

```json
{
  "data": "string",
  "purpose": "string"
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "contentType": "string",
    "createdAt": "2026-01-01T00:00:00Z",
    "height": 1,
    "id": "",
    "purpose": "string",
    "sizeBytes": 1,
    "width": 1
  },
  "url": "string"
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
