Auth API reference

Auth API · Consumer-Me

post/{app_slug}/v1/me/avatarAuth

Upload (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*string

Slug of the app.

Response · 201

avatar_url*string

Stable 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_TOKEN

Response

{
  "avatar_url": "https://api.auth.productcraft.co/my-app/v1/avatars/8f14…"
}