/public/avatars/{id} - Get user avatar image

GET /public/avatars/{id}

Serves a user's avatar image as binary data. This endpoint is public and requires no authentication. Returns the image with appropriate Content-Type header and browser caching headers.

Path parameters

  • id string Required

    User Logto ID or local database ID

Responses

  • 200 image/png

    Avatar image binary

    Hide headers attribute Show headers attribute
    • Cache-Control string
  • 404 application/json

    Resource not found

    Hide response attributes Show response attributes object
    • code integer

      HTTP error code

    • message string

      Error message

    • data object
      Hide data attributes Show data attributes object
      • type string

        Type of error

        Values are validation_error or external_api_error.

      • errors array[object]
        Hide errors attributes Show errors attributes object
        • key string

          Field name that failed validation

        • message string

          Error code or message

        • value string

          Value that failed validation

      • details

        Additional error details

GET /public/avatars/{id}
curl \
 --request GET 'https://api.your-domain.com/api/public/avatars/jf584cz36kce'
Response examples (404)
{
  "code": 400,
  "message": "validation failed",
  "data": {
    "type": "validation_error",
    "errors": [
      {
        "key": "username",
        "message": "required",
        "value": "string"
      }
    ]
  }
}