POST /api/my-account/user-assets/avatar

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.

multipart/form-data

Body

  • file

    The avatar image file to upload. Must be an allowed image type and not exceed the maximum upload file size.

Responses

  • 200 application/json

    The asset was uploaded successfully.

    Hide response attribute Show response attribute object
    • url string Required
  • 400

    The request is invalid (e.g. file too large, image type not allowed, storage is not configured, or the avatar field is not editable).

  • 401

    Permission denied, the access token does not include the profile scope.

  • 403

    Permission denied for the current account center state.

  • 500

    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"
}