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

# Get Audit Log

> Retrieves the audit log.



## OpenAPI

````yaml post /v2/Account/AuditLog
openapi: 3.0.1
info:
  title: NLPearl Client API
  description: A sample API that demonstrates features in the OpenAPI specification
  version: v2
servers:
  - url: https://api.nlpearl.ai
    description: Production Environement
security:
  - bearer_auth: []
paths:
  /v2/Account/AuditLog:
    post:
      tags:
        - Account
      summary: Get Audit Log
      description: Retrieves the audit log.
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/AuditLogAPIRequest'
          text/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/AuditLogAPIRequest'
          application/*+json:
            schema:
              allOf:
                - $ref: '#/components/schemas/AuditLogAPIRequest'
      responses:
        '200':
          description: The list of audit log.
          content:
            text/plain:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AuditLogView'
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AuditLogView'
            text/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AuditLogView'
        '400':
          description: Error
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
            text/json:
              schema:
                $ref: '#/components/schemas/ValidationProblemDetails'
components:
  schemas:
    AuditLogAPIRequest:
      type: object
      properties:
        from:
          type: string
          description: The start date and time of the audit log query range (UTC).
          format: date-time
        to:
          type: string
          description: The end date and time of the audit log query range (UTC).
          format: date-time
        eventType:
          allOf:
            - $ref: '#/components/schemas/eAuditLogEvent'
          description: |+
            The type of event recorded in the audit log.

            `1 - LoginAttempt`

            `2 - LoginSuccessful`

            `10 - PublishPearl`

            `11 - PearlStatus`

            `18 - TransferPearl`

            `19 - DeletePearl`

            `30 - CreateAPIKey`

            `31 - DeleteAPIKey`

            `40 - PurchaseAgents`

            `41 - DeleteAgent`

            `50 - SetBillingDetails`

            `51 - SetPaymentMethod`

            `52 - SetSubscription`

            `59 - CancelSubscription`

            `60 - PurchaseCredits`

            `61 - SetAutoRecharge`

            `70 - InviteUser`

            `71 - UserJoin`

            `72 - InvitationCanceled`

            `73 - UpdateUserRole`

            `74 - UpdateAccountInformations`

            `75 - RemoveUserFromTheAccount`

            `76 - UserLeftAccount`

            `80 - UpdateSessionTTL`

            `81 - Set2FA`

          nullable: true
        userId:
          type: string
          description: >-
            Optional filter by user ID. If not provided, logs for all users are
            returned.
          nullable: true
      additionalProperties: false
    AuditLogView:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
        eventType:
          allOf:
            - $ref: '#/components/schemas/eAuditLogEvent'
          description: |+
            The type of event recorded in the audit log.

            `1 - LoginAttempt`

            `2 - LoginSuccessful`

            `10 - PublishPearl`

            `11 - PearlStatus`

            `18 - TransferPearl`

            `19 - DeletePearl`

            `30 - CreateAPIKey`

            `31 - DeleteAPIKey`

            `40 - PurchaseAgents`

            `41 - DeleteAgent`

            `50 - SetBillingDetails`

            `51 - SetPaymentMethod`

            `52 - SetSubscription`

            `59 - CancelSubscription`

            `60 - PurchaseCredits`

            `61 - SetAutoRecharge`

            `70 - InviteUser`

            `71 - UserJoin`

            `72 - InvitationCanceled`

            `73 - UpdateUserRole`

            `74 - UpdateAccountInformations`

            `75 - RemoveUserFromTheAccount`

            `76 - UserLeftAccount`

            `80 - UpdateSessionTTL`

            `81 - Set2FA`

        user:
          allOf:
            - $ref: '#/components/schemas/AuditLogUserInfo'
          nullable: true
        additionalData:
          type: object
          additionalProperties:
            type: string
          nullable: true
      additionalProperties: false
    ValidationProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          nullable: true
      additionalProperties: {}
    eAuditLogEvent:
      type: integer
      description: |+
        The type of event recorded in the audit log.

        `1 - LoginAttempt`

        `2 - LoginSuccessful`

        `10 - PublishPearl`

        `11 - PearlStatus`

        `18 - TransferPearl`

        `19 - DeletePearl`

        `30 - CreateAPIKey`

        `31 - DeleteAPIKey`

        `40 - PurchaseAgents`

        `41 - DeleteAgent`

        `50 - SetBillingDetails`

        `51 - SetPaymentMethod`

        `52 - SetSubscription`

        `59 - CancelSubscription`

        `60 - PurchaseCredits`

        `61 - SetAutoRecharge`

        `70 - InviteUser`

        `71 - UserJoin`

        `72 - InvitationCanceled`

        `73 - UpdateUserRole`

        `74 - UpdateAccountInformations`

        `75 - RemoveUserFromTheAccount`

        `76 - UserLeftAccount`

        `80 - UpdateSessionTTL`

        `81 - Set2FA`

      format: int32
    AuditLogUserInfo:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the user.
          nullable: true
        name:
          type: string
          description: The display name of the user.
          nullable: true
        type:
          allOf:
            - $ref: '#/components/schemas/eUserType'
          description: |+
            The type/role of the user who triggered the audit log event.

            `1 - Platform`

            `3 - APIKey`

            `90 - Support`

            `99 - System`

      additionalProperties: false
    eUserType:
      type: integer
      description: |+
        The type/role of the user who triggered the audit log event.

        `1 - Platform`

        `3 - APIKey`

        `90 - Support`

        `99 - System`

      format: int32
  securitySchemes:
    bearer_auth:
      type: http
      description: >-
        Specify the authorization token.


        For more information, check out the [Authorization
        Guide](/api-reference/authorization).
      scheme: bearer

````