> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corgea.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Get User Login Attempts

> Retrieve successful login attempts for a specific user



## OpenAPI

````yaml /api-reference/openapi.json get /users/{user_id}/logins
openapi: 3.0.0
info:
  title: Corgea API
  version: 1.0.0
  description: >-
    API for interacting with Corgea's scanning and vulnerability management
    features
servers:
  - url: https://www.corgea.app/api/v1
    description: Production server
security:
  - CorgeaToken: []
  - BearerAuth: []
paths:
  /users/{user_id}/logins:
    get:
      tags:
        - Authentication
      summary: Get User Login Attempts
      description: Retrieve successful login attempts for a specific user
      operationId: getUserLogins
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: integer
          description: User ID to fetch logins for
        - name: page
          in: query
          required: false
          schema:
            type: integer
            default: 1
          description: The page number for pagination
        - name: page_size
          in: query
          required: false
          schema:
            type: integer
            default: 20
            maximum: 50
          description: The number of results per page
        - name: from_date
          in: query
          required: false
          schema:
            type: string
            format: date-time
          description: Only include logins after this ISO 8601 timestamp
        - name: to_date
          in: query
          required: false
          schema:
            type: string
            format: date-time
          description: Only include logins before this ISO 8601 timestamp
        - name: sort
          in: query
          required: false
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
          description: Sort order for results
      responses:
        '200':
          description: Login attempts retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  page:
                    type: integer
                  total_pages:
                    type: integer
                  total_logins:
                    type: integer
                  logins:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                        timestamp:
                          type: string
                          format: date-time
                        user_agent:
                          type: string
                        path:
                          type: string
        '400':
          description: Invalid user ID format
        '401':
          description: Invalid or missing token
        '403':
          description: Insufficient permissions
        '404':
          description: User not found
components:
  securitySchemes:
    CorgeaToken:
      type: apiKey
      in: header
      name: CORGEA-TOKEN
      description: API key for authentication
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: OAuth2 access token (JWT) in the Authorization header

````