> ## 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 with support for search, sorting, pagination, and optional
date filtering.

**Search**

- Use `q=column_name:search_string1,search_string2` to filter by field values.  
- Multiple `q` parameters are allowed and are combined using `search_operator`.

**Sorting**

- Use `sort=column_name,-column_name`.  
- Prefix a column with `-` to sort in descending order.

**Date filtering**

- `from_date` filters logs with `occurred_at >= from_date`.  
- `to_date` filters logs with `occurred_at <= to_date`.  
- These parameters are optional and can be used independently.

The response returns a paginated list of audit logs and the total count
of matching records.




## OpenAPI

````yaml /anaconda-platform/cloud/admin/audit-logs/audit_log_api.json 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 with support for search, sorting, pagination, and
        optional

        date filtering.


        **Search**


        - Use `q=column_name:search_string1,search_string2` to filter by field
        values.  

        - Multiple `q` parameters are allowed and are combined using
        `search_operator`.


        **Sorting**


        - Use `sort=column_name,-column_name`.  

        - Prefix a column with `-` to sort in descending order.


        **Date filtering**


        - `from_date` filters logs with `occurred_at >= from_date`.  

        - `to_date` filters logs with `occurred_at <= to_date`.  

        - These parameters are optional and can be used independently.


        The response returns a paginated list of audit logs and the total count

        of matching records.
      operationId: get_audit_logs__get
      parameters:
        - description: >
            Search filters in the format
            `column_name:search_string1,search_string2`.


            Multiple `q` parameters can be supplied to express more complex
            filters

            and are combined using `search_operator`.
          in: query
          name: q
          required: false
          schema:
            default: []
            description: >
              Search filters in the format
              `column_name:search_string1,search_string2`.
            items:
              type: string
            title: Q
            type: array
        - description: |
            Logical operator used to combine multiple `q` query parameters.

            - `or` — return logs that match **any** filter  
            - `and` — return logs that match **all** filters
          in: query
          name: search_operator
          required: false
          schema:
            default: or
            description: |
              Operator used to combine multiple `q` filters (`or` or `and`).
            title: Search Operator
            type: string
        - description: |
            Sort order for the results in the format `column_name,-column_name`.

            Prefix a column with `-` to sort in descending order.
          in: query
          name: sort
          required: false
          schema:
            default: ''
            description: >
              Sort columns in the format `column_name,-column_name` where `-`
              denotes

              descending order.
            title: Sort
            type: string
        - description: |
            Maximum number of records to return in a single page of results.
          in: query
          name: limit
          required: false
          schema:
            default: 100
            description: |
              Maximum number of results to return for this request.
            maximum: 1000
            minimum: 1
            title: Limit
            type: integer
        - description: |
            Number of records to skip before starting to return results.
          in: query
          name: offset
          required: false
          schema:
            default: 0
            description: |
              Number of results to skip from the start of the result set.
            minimum: 0
            title: Offset
            type: integer
        - description: |
            Filters results to logs with `occurred_at >= from_date` (ISO 8601).
          in: query
          name: from_date
          required: false
          schema:
            anyOf:
              - format: date-time
                type: string
                example: <timestamp>
              - type: 'null'
            description: |
              Lower bound (inclusive) for `occurred_at` when filtering results.
            title: From Date
        - description: |
            Filters results to logs with `occurred_at <= to_date` (ISO 8601).
          in: query
          name: to_date
          required: false
          schema:
            anyOf:
              - format: date-time
                type: string
                example: <timestamp>
              - type: 'null'
            description: |
              Upper bound (inclusive) for `occurred_at` when filtering results.
            title: To Date
        - description: >
            Name of the organization to scope the request to. This header is
            required

            in multi-tenant deployments.
          in: header
          name: X-Org-Name
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: |
              Organization name used to resolve the tenant context.
            title: X-Org-Name
        - description: |
            API version identifier (for example, `v1` or `v2`). Defaults to `v1`
            when not provided.
          in: header
          name: X-API-Version
          required: false
          schema:
            default: v1
            description: |
              API version to target for this request.
            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: >
        Authenticate requests using a bearer token.


        Supported token types:


        - **Access Token** — short-lived token obtained from the authentication
        service  

        - **JWT Token** — JSON Web Token containing encoded credentials  


        **Header format**


        - `Authorization: Bearer <your_token>`
      scheme: bearer
      type: http

````