/{app_slug}/v1/me/avatarAuthUpload (or replace) the EndUser avatar
PNG/JPEG/WEBP only — SVG is rejected (stored-XSS vector). ≤2 MB. Magic bytes are sniffed; a mislabeled file is rejected. The image is re-encoded server-side (orientation baked in, all metadata incl. EXIF/GPS stripped, bounded to 512×512, webp). An uploaded avatar takes precedence over a provider-captured picture.
Path parameters
app_slug*stringSlug of the app.
Response · 201
avatar_url*stringStable avatar URL (`/:appSlug/v1/avatars/:accountId`). Safe to cache and hotlink — it 302s to a fresh short-lived presigned GET on every hit.
Example: "https://api.auth.productcraft.co/my-app/v1/avatars/8f14…"
Example
Request
POST https://api.auth.productcraft.co/{app_slug}/v1/me/avatar
Authorization: Bearer YOUR_TOKENResponse
{
"avatar_url": "https://api.auth.productcraft.co/my-app/v1/avatars/8f14…"
}