Upload a single avatar image to the configured storage provider and return the public URL of the uploaded asset. Requires the profile scope and the avatar field to be editable in the account center configuration. The returned URL can then be used as the value for the avatar field via PATCH /api/my-account.
Responses
-
The asset was uploaded successfully.
-
The request is invalid (e.g. file too large, image type not allowed, storage is not configured, or the avatar field is not editable).
-
Permission denied, the access token does not include the
profilescope. -
Permission denied for the current account center state.
-
Failed to upload the file to the storage provider.
POST
/api/my-account/user-assets/avatar
curl \
--request POST 'https://[tenant_id].logto.app/api/my-account/user-assets/avatar' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: multipart/form-data"
Response examples (200)
{
"url": "string"
}