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

# Lista os eventos da trilha de auditoria, do mais novo ao mais antigo

> Exige uma chave secreta criada COM o escopo audit_logs:read (chaves sem restrição não o têm).



## OpenAPI

````yaml /api-reference/openapi.json get /audit-logs/events
openapi: 3.1.0
info:
  title: UNIFOKAL API
  version: v1
  summary: >-
    Verificação de identidade: sessão criada no servidor, jornada no widget,
    resultado no webhook.
  description: >-
    A versão vive no caminho (/v1); não existe header de versão. Adição
    compatível (campo, módulo ou chave nova) NÃO sobe a versão: ignore o que não
    conhecer. Todo erro tem a forma { error, message }: o código é estável, a
    mensagem não. Ids são prefixo + ULID. Webhooks são assinados (HMAC SHA-256
    no header X-IDSAAS-Signature, janela de 300s; o segredo é SEU, mínimo 32
    caracteres) e o header x-idsaas-event carrega o tipo do evento.
  termsOfService: https://unifokal.com/termos
  contact:
    name: UNIFOKAL
    url: https://docs.unifokal.com/
servers:
  - url: https://api.unifokal.com/v1
security: []
externalDocs:
  description: >-
    Documentação completa em https://docs.unifokal.com/. Briefing para agentes
    de IA em https://unifokal.com/llms.txt.
  url: https://docs.unifokal.com/
paths:
  /audit-logs/events:
    get:
      summary: Lista os eventos da trilha de auditoria, do mais novo ao mais antigo
      description: >-
        Exige uma chave secreta criada COM o escopo audit_logs:read (chaves sem
        restrição não o têm).
      operationId: listAuditLogEvents
      parameters:
        - name: organization_id
          in: query
          required: false
          schema:
            type: string
            pattern: ^aorg_[0-9A-HJKMNP-TV-Z]{26}$
        - name: actions
          in: query
          required: false
          schema:
            type: string
          description: Separadas por vírgula.
        - name: actor_ids
          in: query
          required: false
          schema:
            type: string
          description: Separados por vírgula.
        - name: target_ids
          in: query
          required: false
          schema:
            type: string
          description: Separados por vírgula.
        - name: from
          in: query
          required: false
          schema:
            type: string
            format: date-time
        - name: to
          in: query
          required: false
          schema:
            type: string
            format: date-time
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
        - name: after
          in: query
          required: false
          schema:
            type: string
          description: O next_cursor da página anterior.
      responses:
        '200':
          description: Do mais novo ao mais antigo.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditLogEventList'
        '400':
          description: >-
            Códigos estáveis: validation_error, invalid_cursor. Ramifique pelo
            campo error, nunca pela mensagem.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorEnvelope'
                  - properties:
                      error:
                        enum:
                          - validation_error
                          - invalid_cursor
        '401':
          description: >-
            Códigos estáveis: invalid_api_key. Ramifique pelo campo error, nunca
            pela mensagem.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorEnvelope'
                  - properties:
                      error:
                        enum:
                          - invalid_api_key
        '403':
          description: >-
            Códigos estáveis: credential_type_not_allowed,
            organization_suspended, test_key_used_in_production,
            insufficient_scope, ip_not_allowed. Ramifique pelo campo error,
            nunca pela mensagem.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorEnvelope'
                  - properties:
                      error:
                        enum:
                          - credential_type_not_allowed
                          - organization_suspended
                          - test_key_used_in_production
                          - insufficient_scope
                          - ip_not_allowed
        '429':
          description: >-
            Códigos estáveis: rate_limited. Ramifique pelo campo error, nunca
            pela mensagem.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorEnvelope'
                  - properties:
                      error:
                        enum:
                          - rate_limited
      security:
        - secretKey: []
components:
  schemas:
    AuditLogEventList:
      type: object
      required:
        - data
        - next_cursor
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/AuditLogEvent'
        next_cursor:
          type:
            - string
            - 'null'
    ErrorEnvelope:
      type: object
      description: >-
        Todo erro da API tem exatamente esta forma. O campo error é um código
        estável (contrato); message é texto livre e pode mudar sem aviso.
      required:
        - error
        - message
      properties:
        error:
          type: string
          description: Código estável do erro. Ramifique por ele.
        message:
          type: string
          description: Texto explicativo. NÃO é contrato.
      additionalProperties: false
    AuditLogEvent:
      type: object
      required:
        - id
        - organization_id
        - action
        - occurred_at
        - actor
        - targets
        - context
        - metadata
        - version
        - created_at
      properties:
        id:
          type: string
          pattern: ^alog_[0-9A-HJKMNP-TV-Z]{26}$
        organization_id:
          type:
            - string
            - 'null'
        action:
          type: string
        occurred_at:
          type: string
          format: date-time
        actor:
          type: object
          required:
            - type
            - id
            - name
            - metadata
          properties:
            type:
              type: string
            id:
              type: string
            name:
              type:
                - string
                - 'null'
            metadata:
              type:
                - object
                - 'null'
              additionalProperties: true
        targets:
          type: array
          items:
            type: object
            required:
              - type
              - id
              - name
              - metadata
            properties:
              type:
                type: string
              id:
                type: string
              name:
                type:
                  - string
                  - 'null'
              metadata:
                type:
                  - object
                  - 'null'
                additionalProperties: true
        context:
          type: object
          required:
            - location
            - user_agent
          properties:
            location:
              type:
                - string
                - 'null'
            user_agent:
              type:
                - string
                - 'null'
        metadata:
          type:
            - object
            - 'null'
          additionalProperties: true
        version:
          type: integer
        created_at:
          type: string
          format: date-time
  securitySchemes:
    secretKey:
      type: http
      scheme: bearer
      description: >-
        Chave secreta (unifokal_live_ em produção, unifokal_test_ no sandbox: 64
        hex mais CRC-32) no Authorization: Bearer. Só no seu servidor: nunca no
        browser ou app (o widget monta apenas com o id vs_ da sessão). Não
        existe chave publishable.

````

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