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

# Ingest Logs

> Ingest application log records.
API key provides project_id, payload provides app_id (UUID or slug) for each log.



## OpenAPI

````yaml https://api.apilens.ai/api/v1/openapi.json post /api/v1/ingest/logs
openapi: 3.1.0
info:
  title: APILens API
  version: 1.0.0
  description: API Observability Platform
servers: []
security: []
paths:
  /api/v1/ingest/logs:
    post:
      tags:
        - Ingest
      summary: Ingest Logs
      description: >-
        Ingest application log records.

        API key provides project_id, payload provides app_id (UUID or slug) for
        each log.
      operationId: api_ingest_router_ingest_logs
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IngestLogsRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IngestLogsResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    IngestLogsRequest:
      properties:
        logs:
          items:
            $ref: '#/components/schemas/LogRecord'
          title: Logs
          type: array
      required:
        - logs
      title: IngestLogsRequest
      type: object
    IngestLogsResponse:
      properties:
        accepted:
          title: Accepted
          type: integer
      required:
        - accepted
      title: IngestLogsResponse
      type: object
    LogRecord:
      properties:
        project_slug:
          title: Project Slug
          type: string
        app_id:
          title: App Id
          type: string
        timestamp:
          format: date-time
          title: Timestamp
          type: string
        environment:
          title: Environment
          type: string
        level:
          title: Level
          type: string
        message:
          title: Message
          type: string
        logger_name:
          default: ''
          title: Logger Name
          type: string
        endpoint_method:
          default: ''
          title: Endpoint Method
          type: string
        endpoint_path:
          default: ''
          title: Endpoint Path
          type: string
        status_code:
          default: 0
          title: Status Code
          type: integer
        consumer_id:
          default: ''
          title: Consumer Id
          type: string
        consumer_name:
          default: ''
          title: Consumer Name
          type: string
        consumer_group:
          default: ''
          title: Consumer Group
          type: string
        trace_id:
          default: ''
          title: Trace Id
          type: string
        span_id:
          default: ''
          title: Span Id
          type: string
        payload:
          default: ''
          title: Payload
          type: string
        attributes:
          additionalProperties: true
          default: {}
          title: Attributes
          type: object
      required:
        - project_slug
        - app_id
        - timestamp
        - environment
        - level
        - message
      title: LogRecord
      type: object
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````