POST /api/v1/users/me/avatar
Uploads a new avatar image for the currently authenticated user. The image is stored in Cloudflare R2 and a public URL is returned.
Authentication​
Required. Bearer token must be included in the Authorization header.
Request​
Body​
Content-Type: multipart/form-data
| Field | Type | Required | Description |
|---|---|---|---|
avatar | file | Yes | Image file (JPEG, PNG, WebP, etc.) |
Example​
curl -X POST https://intotes.com/api/v1/users/me/avatar \
-H "Authorization: Bearer <token>" \
-F "avatar=@/path/to/photo.jpg"
Response​
200 OK​
{
"avatar_url": "https://cdn.intotes.com/avatars/42_1700000000.jpg"
}
Response Fields​
| Field | Type | Description |
|---|---|---|
avatar_url | string | Public URL of the newly uploaded avatar |
Errors​
| Status | Code | Description |
|---|---|---|
| 400 | missing_file | No file was provided in the avatar field |
| 400 | invalid_file_type | The uploaded file is not a supported image type |
| 400 | file_too_large | The uploaded file exceeds the size limit |
| 401 | unauthorized | Missing or invalid authentication token |