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

# List Audit Log

> Retrieves a list of audit logs for an account.

The response contains at most 1,000 events. If `incomplete` is `true`, more events may match your request. To retrieve them, narrow the time range, or send the request again with `endTime` set to the `timestamp` of the oldest event returned. If `incomplete` is `true` and no events are returned, narrow the time range instead.

Filters on user email, identity name, and source match exact letter case when the audit log is read from the central log store. In that case, events with an unrecognized event type are omitted from the response. A request from an OEM Admin or OEM Viewer that does not specify an account returns the events of the OEM account's sub-accounts, not the OEM account's own events, unless it has no sub-accounts.




## OpenAPI

````yaml en/API/REST-API-Embedded.yaml POST /log/audit/list
openapi: 3.1.0
info:
  title: CData Connect AI REST API Embedded
  version: v1
servers:
  - url: https://cloud.cdata.com/api
    description: Production base URL
security:
  - BearerAuth: []
paths:
  /log/audit/list:
    post:
      tags:
        - Log
      summary: List Audit Log
      description: >
        Retrieves a list of audit logs for an account.


        The response contains at most 1,000 events. If `incomplete` is `true`,
        more events may match your request. To retrieve them, narrow the time
        range, or send the request again with `endTime` set to the `timestamp`
        of the oldest event returned. If `incomplete` is `true` and no events
        are returned, narrow the time range instead.


        Filters on user email, identity name, and source match exact letter case
        when the audit log is read from the central log store. In that case,
        events with an unrecognized event type are omitted from the response. A
        request from an OEM Admin or OEM Viewer that does not specify an account
        returns the events of the OEM account's sub-accounts, not the OEM
        account's own events, unless it has no sub-accounts.
      operationId: listAuditLog
      parameters:
        - name: startTime
          in: query
          description: 'Timestamp in UTC (ISO 8601 format). Example: "2025-08-18T00:00:00Z"'
          schema:
            type: string
            format: date-time
        - name: endTime
          in: query
          description: 'Timestamp in UTC (ISO 8601 format). Example: "2025-08-18T23:59:59Z"'
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditSearchResult'
              example:
                events:
                  - eventType: 1003
                    timestamp: '2025-08-18T17:07:07.3673862Z'
                    targetId: aaa96669-74c8-480f-a8c1-7956979cbee9
                    targetName: PostgreSQL1
                    targetType: 1
                    userId: 6b8d5c25-cdc1-4b0c-b9f1-5b26647a8240
                    userName: User1
                    userType: 0
                  - eventType: 1107
                    timestamp: '2025-08-13T21:20:08.4380865Z'
                    relatedId: 4780a367-2ba0-4b73-b086-b0d964323032
                    relatedName: Mcp
                    relatedType: 4
                    targetId: a41dd9b5-1ed6-54d9-b5e5-2754e4a29deb
                    targetName: test@cdata.com
                    targetType: 2
                    userId: a41dd9b5-1ed6-54d9-b5e5-2754e4a29deb
                    userName: User2
                    userType: 0
components:
  schemas:
    AuditSearchResult:
      type: object
      properties:
        events:
          type: array
          items:
            $ref: '#/components/schemas/AuditEvent'
          nullable: true
        incomplete:
          type: boolean
          description: >-
            If true, more events may match the request than the response
            contains.
      additionalProperties: false
    AuditEvent:
      type: object
      properties:
        eventType:
          $ref: '#/components/schemas/AuditEventType'
          description: >-
            The audit event type, such as user login, user PAT created, or
            permission created.
        timestamp:
          type: string
          format: date-time
          description: The timestamp of the audit event.
        relatedId:
          type: string
          nullable: true
          description: The Id of the related entity, if applicable.
        relatedName:
          type: string
          nullable: true
          description: The name of the related entity, if applicable.
        relatedType:
          type: integer
          format: int32
          nullable: true
          description: The type of the related entity, if applicable.
        targetId:
          type: string
          nullable: true
          description: The Id of the event target, such as the Query Id.
        targetName:
          type: string
          nullable: true
          description: >-
            The target resource name, such as a user's email or a connection
            name.
        targetType:
          type: integer
          format: int32
          nullable: true
          description: The type of the event target, such as a query or connection change.
        userId:
          type: string
          nullable: true
          description: The Id of user who performed the event.
        userName:
          type: string
          nullable: true
          description: The name of user who performed the event.
        userType:
          type: integer
          format: int32
          nullable: true
          description: The type of user who performed the event.
      additionalProperties: false
    AuditEventType:
      enum:
        - 0
        - 500
        - 501
        - 502
        - 1000
        - 1001
        - 1002
        - 1003
        - 1004
        - 1005
        - 1050
        - 1051
        - 1052
        - 1060
        - 1061
        - 1062
        - 1063
        - 1070
        - 1071
        - 1072
        - 1073
        - 1080
        - 1081
        - 1082
        - 1083
        - 1084
        - 1085
        - 1090
        - 1091
        - 1092
        - 1093
        - 1094
        - 1100
        - 1101
        - 1102
        - 1103
        - 1105
        - 1106
        - 1107
        - 1108
        - 1109
        - 1110
        - 1111
        - 1112
        - 1113
        - 1114
        - 1115
        - 1116
        - 1200
        - 1201
        - 1202
        - 1220
        - 1221
        - 1222
        - 1223
        - 1224
        - 1230
        - 1231
      type: integer
      format: int32
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT token authentication. Include the token in the Authorization header
        as `Bearer {token}`. See
        [Authentication](/en/API/Authentication-Embedded) for more information
        on creating a token.

````

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