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

# Get audit logs

> Retrieve system audit logs with optional filtering.
    
    This endpoint returns a list of system audit logs that track various system events and user actions.
    The logs can be filtered by:
    - Event types
    - User ID
    - User email
    - Date range (start date and end date)
    
    Each log entry contains details about the event type, affected resource, user information,
    timestamp, and any changes made (old and new values).



## OpenAPI

````yaml /openapi/adm.openapi.en-0.2.2.json get /logs
openapi: 3.1.0
info:
  description: >
    ## Introduction

    The Data Management APIs comprehensively oversees the **diverse data** used
    by advertising and recommendation systems, ensuring that the Decision API
    runs accurately and efficiently.


    From registering, updating, and deleting campaigns and placements to **log
    and statistics analysis**, it provides the insights necessary for effective
    system operation.


    The resulting data and metrics are used by the Decision API to **optimize ad
    and content decisions**, ultimately boosting the overall performance of the
    advertising and recommendation system.
  title: Data Management APIs
  version: 0.1.3
servers: []
security: []
tags:
  - name: Audience Targeting
  - description: >

      The Audience Management APIs to seamlessly integrate Audience-related
      data.  


      References:

      - [First-Party
      Data](https://docs.aiderx.io/guides/about-a2/en/first-party-data)
    name: Audience
  - description: >
      APIs for collecting user activity data to enhance ad targeting and
      performance optimization.


      Activity Data captures actual user behavior data like product views,
      searches, cart additions, and purchases across all users, regardless of ad
      interactions.


      References:

      - [First-Party
      Data](https://docs.aiderx.io/guides/about-a2/en/first-party-data)
    name: Activity Log
  - description: >

      The Audience Attribute API provides access to audience attribute data.


      References:

      - [Audience
      Targeting](https://docs.aiderx.io/guides/about-a2/en/audience-targeting)
    name: Audience Attribute
  - description: >

      The Audience Segment API provides access to audience segment data.


      References:

      - [Audience
      Targeting](https://docs.aiderx.io/guides/about-a2/en/audience-targeting)
    name: Audience Segment
  - description: The Analytic API provides access to dashboard and A2 metric data.
    name: Analytic
  - description: >

      The Billing API manages billing information.

      A2 is configured to work with the payment systems used by your retail
      platform.


      To integrate payments, first you need to register an external channel.

      For more information about integrating A2 with external channels, check
      out [the External channels
      page](https://docs.aiderx.io/guides/about-a2/en/external-channel).
    name: Billing
  - description: |

      The Campaign API allows you to manage data related to campaigns.

      References:
      - [Campaign](https://docs.aiderx.io/guides/about-a2/en/campaign)
    name: Campaign
  - description: >

      The Creative API provides comprehensive functionalities for managing
      creative assets and related resources.


      References:

      - [Creative](https://docs.aiderx.io/guides/about-a2/en/creative)
    name: Creative
  - description: >

      The Allocation API provides comprehensive functionalities for managing
      allocation and related resources.


      References:

      - [Allocation](https://docs.aiderx.io/guides/about-a2/en/allocation)
    name: Allocation
  - description: >

      The Media Library API provides comprehensive functionalities for managing
      media library and related resources.


      References:

      - [Media Library](https://docs.aiderx.io/guides/about-a2/en/media-library)
    name: Media Library
  - description: >

      The Catalog Management API provides functionalities for managing catalogs
      and related resources.


      References:

      - [First-Party
      Data](https://docs.aiderx.io/guides/about-a2/en/first-party-data)
    name: Catalog
  - description: >

      The Placement Management API provides comprehensive functionalities for
      managing placements and related resources.


      References:

      - [Placement](https://docs.aiderx.io/guides/about-a2/en/placement)
    name: Placement
  - description: >

      Placement Catalog transforms the placement information into a structured
      “advertising product” that can be easily showcased to advertisers.


      References:

      - To be updated
    name: Placement Catalog
  - description: >

      The System APIs allow you to access and manage system-level settings and
      assets, such as logos and configuration values.


      References:

      - [Yield Optimization
      Settings](https://docs.aiderx.io/guides/about-a2/en/yield-optimization)
    name: System
  - description: >

      The Auth and User API provides authentication and user management
      functionalities.


      References:

      - [Account and
      Budget](https://docs.aiderx.io/guides/about-a2/en/account-and-budget)
    name: Auth and User
  - description: |

      The License API provides license management functionalities.
    name: License
paths:
  /logs:
    get:
      tags:
        - System
      summary: Get audit logs
      description: |-
        Retrieve system audit logs with optional filtering.
            
            This endpoint returns a list of system audit logs that track various system events and user actions.
            The logs can be filtered by:
            - Event types
            - User ID
            - User email
            - Date range (start date and end date)
            
            Each log entry contains details about the event type, affected resource, user information,
            timestamp, and any changes made (old and new values).
      operationId: handle_get_audit_logs_logs_get
      parameters:
        - in: query
          name: event_types
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            title: Event Types
        - in: query
          name: user_id
          required: false
          schema:
            anyOf:
              - format: uuid
                type: string
              - type: 'null'
            title: User Id
        - in: query
          name: user_email
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: User Email
        - in: query
          name: start_date
          required: false
          schema:
            anyOf:
              - format: date-time
                type: string
              - type: 'null'
            title: Start Date
        - in: query
          name: end_date
          required: false
          schema:
            anyOf:
              - format: date-time
                type: string
              - type: 'null'
            title: End Date
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/SystemAuditLogBaseSchema'
                title: Response Handle Get Audit Logs Logs Get
                type: array
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    SystemAuditLogBaseSchema:
      description: >-
        Schema for system audit log entity.


        This schema represents the base model for system audit logs. It includes
        fields for tracking

        system events, user actions, and changes to resources. The schema
        captures details such as:

        - Event type and description

        - User information (ID and email)

        - Timestamp of the event

        - Affected resource details

        - Previous and updated values for change tracking
      properties:
        affected_resource:
          anyOf:
            - type: string
            - type: 'null'
          description: The identifier or path of the resource that was modified
          title: Affected Resource
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: The detailed description of the event that occurred
          title: Description
        event_type:
          description: >-
            The type of event that triggered this audit log (e.g. create,
            update, delete)
          title: Event Type
          type: string
        id:
          description: The id of the audit log entry
          title: Id
          type: integer
        new_value:
          anyOf:
            - type: object
            - type: 'null'
          description: The JSON representation of the resource state after the change
          title: New Value
        old_value:
          anyOf:
            - type: object
            - type: 'null'
          description: The JSON representation of the resource state before the change
          title: Old Value
        timestamp:
          description: The datetime when this audit log entry was created
          format: date-time
          title: Timestamp
          type: string
        user_email:
          description: The email address of the user who performed the action
          title: User Email
          type: string
        user_id:
          description: The id of the user who performed the action
          format: uuid
          title: User Id
          type: string
      required:
        - id
        - event_type
        - user_id
        - user_email
      title: SystemAuditLogBaseSchema
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    OAuth2PasswordBearer:
      flows:
        password:
          scopes: {}
          tokenUrl: auth/jwt/login
      type: oauth2

````