Skip to main content

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

FieldTypeRequiredDescription
avatarfileYesImage 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​

FieldTypeDescription
avatar_urlstringPublic URL of the newly uploaded avatar

Errors​

StatusCodeDescription
400missing_fileNo file was provided in the avatar field
400invalid_file_typeThe uploaded file is not a supported image type
400file_too_largeThe uploaded file exceeds the size limit
401unauthorizedMissing or invalid authentication token