/v1/me/avatarAuthUpload (or replace) the caller's avatar. PNG/JPEG/WEBP only — SVG is rejected because user-uploaded SVG from a productcraft.co origin is a stored-XSS vector. ≤2 MB. Magic bytes are sniffed; a mislabeled file is rejected.
Response · 200
avatar_url*stringURL of the uploaded avatar image.
Example
Request
POST https://api.platform-auth.productcraft.co/v1/me/avatar
Authorization: Bearer YOUR_TOKENimport { PlatformAuth } from "@productcraft/platform-auth";
// Reads PRODUCTCRAFT_API_KEY from the environment; administration
// calls take a person's session: { auth: { type: "bearer", token } }
const platform = new PlatformAuth();
const avatarUrl = await platform.me.avatar.upload({ file: new File(["…"], "image.png", { type: "image/png" }) });platform.me.avatar.upload(params, options?): PlatformAuth.AvatarUrl
Response
{
"avatar_url": "string"
}