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

# Listar logs

> Consulta o histórico de chamadas à API do workspace. Filtros: status, período (startDate/endDate), method, apiKeyId. Cada log retorna: endpoint, método, status HTTP, corpo da requisição/resposta (quando registrado), duração e data. Escopo: **logs:read**.



## OpenAPI

````yaml /es/guides/logs/api-reference/openapi-logs.json get /v1/logs
openapi: 3.0.3
info:
  title: Notifique API — Logs
  description: >-
    API para **consultar logs** das chamadas à API do workspace. Use para
    auditar uso, debugar erros ou analisar quais endpoints e métodos foram
    chamados, com qual status e em que período.


    **Autenticação:** todas as rotas exigem API Key no header `Authorization:
    Bearer sk_live_xxxxx` ou `x-api-key: sk_live_xxxxx`. Escopo: **logs:read**.
  version: 1.0.0
servers:
  - url: https://api.notifique.dev
    description: Produção
security:
  - BearerAuth: []
  - ApiKeyHeader: []
tags:
  - name: Logs
    description: Listagem de logs de API do workspace
paths:
  /v1/logs:
    get:
      tags:
        - Logs
      summary: Listar logs
      description: >-
        Consulta o histórico de chamadas à API do workspace. Filtros: status,
        período (startDate/endDate), method, apiKeyId. Cada log retorna:
        endpoint, método, status HTTP, corpo da requisição/resposta (quando
        registrado), duração e data. Escopo: **logs:read**.
      operationId: getV1Logs
      parameters:
        - name: page
          in: query
          required: false
          schema:
            type: integer
            default: 1
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 20
            maximum: 100
        - name: status
          in: query
          required: false
          description: 'Código(s) HTTP separados por vírgula (ex.: 200,201,404).'
          schema:
            type: string
        - name: startDate
          in: query
          required: false
          description: Data/hora início (ISO 8601).
          schema:
            type: string
            format: date-time
        - name: endDate
          in: query
          required: false
          description: Data/hora fim (ISO 8601).
          schema:
            type: string
            format: date-time
        - name: method
          in: query
          required: false
          description: 'Método(s) HTTP separados por vírgula (ex.: GET,POST).'
          schema:
            type: string
        - name: apiKeyId
          in: query
          required: false
          description: ID da API Key; filtra logs apenas dessa key (deve ser do workspace).
          schema:
            type: string
      responses:
        '200':
          description: Lista de logs com paginação.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LogsListResponse'
              example:
                success: true
                data:
                  - id: cllog123...
                    endpoint: /v1/whatsapp/messages
                    method: POST
                    status: 403
                    duration: 42
                    apiKeyId: clkey456...
                    createdAt: '2026-08-14T14:30:00.000Z'
                pagination:
                  total: 128
                  page: 1
                  limit: 20
                  totalPages: 7
        '400':
          description: apiKeyId não pertence ao workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error: Bad Request
                code: VALIDATION_ERROR
                message: Campo inválido ou ausente.
        '401':
          description: API Key ausente ou inválida.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error: Bad Request
                code: VALIDATION_ERROR
                message: Campo inválido ou ausente.
        '402':
          description: Plano expirado ou suspenso.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error: Bad Request
                code: VALIDATION_ERROR
                message: Campo inválido ou ausente.
        '403':
          description: Escopo logs:read ausente.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error: Bad Request
                code: VALIDATION_ERROR
                message: Campo inválido ou ausente.
components:
  schemas:
    LogsListResponse:
      type: object
      required:
        - success
        - data
        - pagination
      properties:
        success:
          type: boolean
          example: true
        data:
          type: array
          items:
            $ref: '#/components/schemas/ApiLog'
        pagination:
          $ref: '#/components/schemas/Pagination'
      example:
        success: true
        data:
          - id: clxx...
            apiKeyId: clxx...
            instanceId: clxx...
            endpoint: string
            method: string
            status: 1
            userAgent: string
            ip: string
            requestQuery: {}
            requestBody: {}
            responseBody: {}
            duration: 1
            createdAt: '2025-02-10T14:00:00.000Z'
        pagination:
          total: 1
          page: 1
          limit: 1
          totalPages: 1
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
        message:
          type: string
        code:
          type: string
      example:
        success: false
        error: string
        message: string
        code: string
    ApiLog:
      type: object
      properties:
        id:
          type: string
        apiKeyId:
          type: string
          nullable: true
        instanceId:
          type: string
          nullable: true
        endpoint:
          type: string
        method:
          type: string
        status:
          type: integer
        userAgent:
          type: string
          nullable: true
        ip:
          type: string
          nullable: true
        requestQuery:
          type: object
          nullable: true
        requestBody:
          type: object
          nullable: true
        responseBody:
          type: object
          nullable: true
        duration:
          type: integer
          nullable: true
        createdAt:
          type: string
          format: date-time
      example:
        id: clxx...
        apiKeyId: clxx...
        instanceId: clxx...
        endpoint: string
        method: string
        status: 1
        userAgent: string
        ip: string
        requestQuery: {}
        requestBody: {}
        responseBody: {}
        duration: 1
        createdAt: '2025-02-10T14:00:00.000Z'
    Pagination:
      type: object
      properties:
        total:
          type: integer
        page:
          type: integer
        limit:
          type: integer
        totalPages:
          type: integer
      example:
        total: 1
        page: 1
        limit: 1
        totalPages: 1
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Authorization: Bearer sk_live_xxxxx'
    ApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: 'x-api-key: sk_live_xxxxx'

````