> ## Documentation Index
> Fetch the complete documentation index at: https://komga-sdk.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve authentication activity

> Required role: **ADMIN**



## OpenAPI

````yaml https://raw.githubusercontent.com/gotson/komga/1.25.0/komga/docs/openapi.json get /api/v2/users/authentication-activity
openapi: 3.1.0
info:
  description: >-
    Komga REST API.


    ## Reference


    Check the API reference:

    - on the [Komga website](https://komga.org/docs/openapi/komga-api)

    - on any running Komga instance at `/swagger-ui.html`

    - on
    [GitHub](https://raw.githubusercontent.com/gotson/komga/refs/heads/master/komga/docs/openapi.json)


    ## Authentication


    Most endpoints require authentication. Authentication is done using either:

    - Basic Authentication

    - Passing an API Key in the `X-API-Key` header


    ## Sessions


    Upon successful authentication, a session is created, and can be reused.


    - By default, a `KOMGA-SESSION` cookie is set via `Set-Cookie` response
    header. This works well for browsers and clients that can handle cookies.

    - If you specify a header `X-Auth-Token` during authentication, the session
    ID will be returned via this same header. You can then pass that header
    again for subsequent requests to reuse the session.


    If you need to set the session cookie later on, you can call
    `/api/v1/login/set-cookie` with `X-Auth-Token`. The response will contain
    the `Set-Cookie` header.


    ## Remember Me


    During authentication, if a request parameter `remember-me` is passed and
    set to `true`, the server will also return a `komga-remember-me` cookie.
    This cookie will be used to login automatically even if the session has
    expired.


    ## Logout


    You can explicitly logout an existing session by calling `/api/logout`. This
    would return a `204`.


    ## Deprecation


    API endpoints marked as deprecated will be removed in the next major
    version.
  license:
    name: MIT
    url: https://github.com/gotson/komga/blob/master/LICENSE
  title: Komga API
  version: 1.25.0
servers:
  - url: https://demo.komga.org
    description: Demo server
  - url: http://localhost:{port}
    description: Local development server
    variables:
      port:
        enum:
          - '8080'
          - '25600'
        default: '25600'
security:
  - basicAuth: []
  - apiKey: []
tags:
  - name: Deprecated
  - description: Manage libraries.
    name: Libraries
  - description: Manage series.
    name: Series
  - description: Manage posters for series.
    name: Series Poster
  - description: Manage books.
    name: Books
  - description: Manage posters for books.
    name: Book Poster
  - name: Book Pages
  - name: WebPub Manifest
  - name: Import
  - description: Provide font files and CSS for the Epub Reader.
    name: Fonts
  - description: Manage duplicate pages. Duplicate pages are identified by a page hash.
    name: Duplicate Pages
  - description: Manage collections.
    name: Collections
  - description: Manage posters for collections.
    name: Collection Poster
  - name: Collection Series
  - description: Manage readlists.
    name: Readlists
  - description: Manage posters for readlists.
    name: Readlist Poster
  - name: Readlist Books
  - description: Retrieve referential metadata from all items in the Komga server.
    name: Referential metadata
  - description: Manage current user.
    name: Current user
  - description: Manage users.
    name: Users
  - description: Manage API Keys
    name: API Keys
  - name: User session
  - description: List registered OAuth2 providers
    name: OAuth2
  - description: Sync points are automatically created during a Kobo sync.
    name: Sync points
  - description: Claim a freshly installed Komga server.
    name: Claim
  - description: Manage server tasks
    name: Tasks
  - description: Server events history
    name: History
  - description: List files from the host server's file system
    name: File system
  - description: Store and retrieve server settings
    name: Server settings
  - description: Retrieve releases information
    name: Releases
  - description: Retrieve announcements from the Komga website
    name: Announcements
  - description: Manage server
    name: Management
  - name: Mihon
  - name: ComicRack
  - description: >-
      Store and retrieve global and per-user settings. Those settings are not
      used by Komga itself, but can be stored for convenience by client
      applications.
    name: Client settings
externalDocs:
  description: Komga documentation
  url: https://komga.org
paths:
  /api/v2/users/authentication-activity:
    get:
      tags:
        - Users
      summary: Retrieve authentication activity
      description: 'Required role: **ADMIN**'
      operationId: getAuthenticationActivity
      parameters:
        - in: query
          name: unpaged
          required: false
          schema:
            type: boolean
        - description: Zero-based page index (0..N)
          in: query
          name: page
          schema:
            type: integer
            default: 0
        - description: The size of the page to be returned
          in: query
          name: size
          schema:
            type: integer
            default: 20
        - description: >-
            Sorting criteria in the format: property,(asc|desc). Default sort
            order is ascending. Multiple sort criteria are supported.
          in: query
          name: sort
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PageAuthenticationActivityDto'
          description: OK
        '400':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
          description: Bad Request
components:
  schemas:
    PageAuthenticationActivityDto:
      type: object
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/AuthenticationActivityDto'
        empty:
          type: boolean
        first:
          type: boolean
        last:
          type: boolean
        number:
          type: integer
          format: int32
        numberOfElements:
          type: integer
          format: int32
        pageable:
          $ref: '#/components/schemas/PageableObject'
        size:
          type: integer
          format: int32
        sort:
          $ref: '#/components/schemas/SortObject'
        totalElements:
          type: integer
          format: int64
        totalPages:
          type: integer
          format: int32
    ValidationErrorResponse:
      type: object
      properties:
        violations:
          type: array
          items:
            $ref: '#/components/schemas/Violation'
      required:
        - violations
    AuthenticationActivityDto:
      type: object
      properties:
        apiKeyComment:
          type: string
        apiKeyId:
          type: string
        dateTime:
          type: string
          format: date-time
        email:
          type: string
        error:
          type: string
        ip:
          type: string
        source:
          type: string
        success:
          type: boolean
        userAgent:
          type: string
        userId:
          type: string
      required:
        - dateTime
        - success
    PageableObject:
      type: object
      properties:
        offset:
          type: integer
          format: int64
        pageNumber:
          type: integer
          format: int32
        pageSize:
          type: integer
          format: int32
        paged:
          type: boolean
        sort:
          $ref: '#/components/schemas/SortObject'
        unpaged:
          type: boolean
    SortObject:
      type: object
      properties:
        empty:
          type: boolean
        sorted:
          type: boolean
        unsorted:
          type: boolean
    Violation:
      type: object
      properties:
        fieldName:
          type: string
        message:
          type: string
  securitySchemes:
    basicAuth:
      scheme: basic
      type: http
    apiKey:
      in: header
      name: X-API-Key
      type: apiKey

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.