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

# Get Audit Logs

> Retrieve audit logs for your organization with support for search, sorting, pagination, and date filtering.



## OpenAPI

````yaml GET /api/audit-logs
openapi: 3.1.0
info:
  title: Audit Logs API
  version: 0.1.0
servers:
  - url: https://anaconda.com
    description: Anaconda Cloud
security: []
paths:
  /api/audit-logs:
    get:
      summary: Get Audit Logs
      description: >-
        Retrieve audit logs for your organization with support for search,
        sorting, pagination, and date filtering.
      operationId: get_audit_logs__get
      parameters:
        - description: >-
            Filter audit logs by field values. Use the format
            `column_name:value1,value2` to match entries where the column
            contains any of the specified values.


            You can pass multiple `q` parameters to build complex filters. They
            are combined using the `search_operator` parameter.
          in: query
          name: q
          required: false
          schema:
            default: []
            items:
              type: string
            title: Q
            type: array
        - description: >-
            The logical operator used to combine multiple `q` filters.


            Use `or` to return logs matching any filter. Use `and` to return
            only logs matching all filters.
          in: query
          name: search_operator
          required: false
          schema:
            default: or
            title: Search Operator
            type: string
        - description: >-
            Sort the results by one or more columns. Use the format
            `column_name` for ascending order or `-column_name` for descending
            order.


            For example, `-occurred_at` sorts by most recent first.
          in: query
          name: sort
          required: false
          schema:
            default: ''
            title: Sort
            type: string
        - description: The maximum number of audit log entries to return per page.
          in: query
          name: limit
          required: false
          schema:
            default: 100
            maximum: 1000
            minimum: 1
            title: Limit
            type: integer
        - description: >-
            The number of entries to skip before returning results. Use with
            `limit` to paginate through large result sets.
          in: query
          name: offset
          required: false
          schema:
            default: 0
            minimum: 0
            title: Offset
            type: integer
        - description: >-
            Only return audit logs that occurred on or after this timestamp. Use
            ISO 8601 format with timezone.
          in: query
          name: from_date
          required: false
          schema:
            anyOf:
              - format: date-time
                type: string
                example: <timestamp>
              - type: 'null'
            title: From Date
        - description: >-
            Only return audit logs that occurred on or before this timestamp.
            Use ISO 8601 format with timezone.
          in: query
          name: to_date
          required: false
          schema:
            anyOf:
              - format: date-time
                type: string
                example: <timestamp>
              - type: 'null'
            title: To Date
        - description: >-
            Your organization ID, found in your organization's URL:
            `anaconda.com/app/organizations/<ORG_ID>/`.
          in: header
          name: X-Org-Name
          required: true
          schema:
            type: string
            title: X-Org-Name
        - description: The API version to use. Set to `v1`.
          in: header
          name: X-API-Version
          required: true
          schema:
            default: v1
            title: X-Api-Version
            type: string
      responses:
        '200':
          description: |
            Request succeeded and a paginated list of audit logs is returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResponse_AuditLogResponse_'
        '422':
          description: |
            The request parameters failed validation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - JWT or Access Token: []
components:
  schemas:
    PaginatedResponse_AuditLogResponse_:
      description: >
        **Paginated response** that wraps a list of audit log entries and the
        total

        number of matching records.
      properties:
        items:
          description: |
            Page of audit log entries returned for the current request.
          items:
            $ref: '#/components/schemas/AuditLogResponse'
          title: Items
          type: array
        total_count:
          description: >
            Total number of audit log entries matching the query, across all
            pages.
          title: Total Count
          type: integer
      required:
        - items
        - total_count
      title: PaginatedResponse[AuditLogResponse]
      type: object
    HTTPValidationError:
      description: |
        **Error response** returned when the request fails validation.
      properties:
        detail:
          description: >
            List of validation errors describing which fields are invalid and
            why.
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    AuditLogResponse:
      description: >
        **Response** representation of an audit log entry, including core fields
        and

        a formatted, human-readable message.
      properties:
        action_key:
          description: >
            Key that identifies the type of action recorded (for example,
            `policy_updated`).
          title: Action Key
          type: string
        action_verb:
          anyOf:
            - maxLength: 100
              type: string
            - type: 'null'
          description: |
            Short verb or phrase that summarizes the action taken (for example,
            `created`, `updated`, `deleted`).
          title: Action Verb
        actor_email:
          anyOf:
            - maxLength: 320
              type: string
            - type: 'null'
          description: |
            Email address of the actor who performed the action.
          title: Actor Email
        actor_id:
          anyOf:
            - format: uuid
              type: string
              example: <uuid>
            - type: 'null'
          description: |
            UUID of the user or system principal responsible for the action.
          title: Actor Id
        actor_type:
          anyOf:
            - maxLength: 100
              type: string
            - type: 'null'
          description: >
            Type of actor that initiated the event (for example, `user` or
            `system`).
          title: Actor Type
        created_at:
          format: date-time
          title: Created At
          type: string
          example: <timestamp>
        id:
          format: uuid
          title: Id
          type: string
          example: <uuid>
        message:
          description: |
            Human-readable message describing the audit event, derived from the
            structured fields in the log.
          readOnly: true
          title: Message
          type: string
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: >
            Arbitrary metadata associated with the event, represented as a JSON
            object.
          title: Meta
        occurred_at:
          anyOf:
            - format: date-time
              type: string
              example: <timestamp>
            - type: 'null'
          description: >
            Time at which the event occurred, as reported by the emitting
            service.
          title: Occurred At
        org_id:
          format: uuid
          title: Org Id
          type: string
          example: <uuid>
        org_name:
          anyOf:
            - type: string
            - type: 'null'
          description: |
            Name of the organization to which this audit log entry belongs.
          title: Org Name
        service_name:
          anyOf:
            - maxLength: 100
              type: string
            - type: 'null'
          description: |
            Name of the service that wrote the audit log entry.
          title: Service Name
        target_email:
          anyOf:
            - maxLength: 320
              type: string
            - type: 'null'
          description: >
            Optional email address associated with the resource or subject
            affected

            by the action.
          title: Target Email
        target_id:
          anyOf:
            - format: uuid
              type: string
              example: <uuid>
            - type: 'null'
          description: |
            Identifier of the resource affected by the action.
          title: Target Id
        target_type:
          anyOf:
            - maxLength: 100
              type: string
            - type: 'null'
          description: >
            Type of resource affected by the action (for example, `user`,
            `group`, `policy`).
          title: Target Type
      required:
        - action_key
        - id
        - org_id
        - created_at
        - message
      title: AuditLogResponse
      type: object
    ValidationError:
      description: >
        **Validation error** describing an issue with a specific part of the
        request.
      properties:
        loc:
          description: |
            Location of the validation error as a path of components, such as
            `["body", "field_name"]` or `["query", "param_name"]`.
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          description: |
            Human-readable description of the validation error.
          title: Message
          type: string
        type:
          description: |
            Machine-readable error type code.
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    JWT or Access Token:
      bearerFormat: JWT or Access Token
      description: >-
        Bearer token obtained by authenticating with your organization's
        [service account](/anaconda-platform/admin/service-accounts) credentials
        (`client_id` and `client_secret`).


        See the [Getting
        started](/anaconda-platform/admin/audit-logs/audit-log-api) page for the
        full authentication flow.
      scheme: bearer
      type: http

````