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

# The event feed, page by page

> Warnings, errors and the day's routine steps, in words built from
typed fields only. Without a cursor the newest page; ``before_id`` pages
back, ``after_id`` forward - nothing between two pages is ever skipped.
When ``epoch`` changes, the log was replaced: start over.



## OpenAPI

````yaml /setup/internal-openapi.json get /v1/mobile/events
openapi: 3.1.0
info:
  title: n:lead Scheduling Bridge — Internal API
  version: 0.4.0
  description: >-
    Internal API of the n:lead scheduling bridge: the process endpoints that
    drive the day-ahead pipeline (aggregate, publish the open position, submit
    schedules, generate forecasts, orchestrate), the operator console endpoints,
    and the read-only operator-app endpoints under /v1/mobile. The process and
    console endpoints require the process API key, /v1/mobile a device key of
    the mobile scope; not for customer use.
servers:
  - url: https://{host}
    description: Deployed service
    variables:
      host:
        default: api.energy.nlead.ch
        description: >-
          The service hostname - n:lead provides it (see the Base URL on the API
          introduction page)
  - url: http://localhost:8000
    description: Local development
security: []
paths:
  /v1/mobile/events:
    get:
      tags:
        - mobile
      summary: The event feed, page by page
      description: |-
        Warnings, errors and the day's routine steps, in words built from
        typed fields only. Without a cursor the newest page; ``before_id`` pages
        back, ``after_id`` forward - nothing between two pages is ever skipped.
        When ``epoch`` changes, the log was replaced: start over.
      operationId: get_events_v1_mobile_events_get
      parameters:
        - name: after_id
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                minimum: 0
              - type: 'null'
            description: page forward from this id
            title: After Id
          description: page forward from this id
        - name: before_id
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                minimum: 1
              - type: 'null'
            description: page back from this id
            title: Before Id
          description: page back from this id
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 200
            minimum: 1
            default: 50
            title: Limit
        - name: level
          in: query
          required: false
          schema:
            enum:
              - info
              - warning
              - error
            type: string
            description: the lowest level to include
            default: info
            title: Level
          description: the lowest level to include
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventPage'
        '401':
          description: Missing or unknown device key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MobileError'
        '403':
          description: A valid key of another scope - only device keys open /v1/mobile.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MobileError'
        '422':
          description: A parameter out of range, or both cursors at once.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MobileError'
        '429':
          description: Rate limit exceeded; wait the seconds in `Retry-After`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MobileError'
        '500':
          description: Unexpected server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MobileError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    EventPage:
      properties:
        items:
          items:
            $ref: '#/components/schemas/EventItem'
          type: array
          title: Items
          description: oldest first
        has_more:
          type: boolean
          title: Has More
          description: >-
            more events in the page's direction: older for the newest page and
            before_id, newer for after_id
        next_after_id:
          type: integer
          title: Next After Id
          description: continue forward from here; past every event read
        next_before_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Next Before Id
          description: continue backward from here; null when nothing was read
        epoch:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Epoch
        last_event_id:
          type: integer
          title: Last Event Id
      additionalProperties: false
      type: object
      required:
        - items
        - has_more
        - next_after_id
        - next_before_id
        - epoch
        - last_event_id
      title: EventPage
    MobileError:
      properties:
        error:
          type: string
          enum:
            - unauthorized
            - forbidden
            - invalid_request
            - rate_limited
            - upstream_unavailable
            - internal
          title: Error
      additionalProperties: false
      type: object
      required:
        - error
      title: MobileError
      description: |-
        Every error under /v1/mobile: a code, nothing else - no detail text,
        no echo of the request.
    EventItem:
      properties:
        id:
          type: integer
          title: Id
        ts:
          type: string
          format: date-time
          title: Ts
          description: UTC
        type:
          type: string
          enum:
            - aperak_failed
            - aperak_needs_review
            - api_key_names_duplicate
            - auskunft_fehlgeschlagen
            - auth_disabled
            - backup_publish_failed
            - classifier_degraded
            - config_overlay_dropped
            - erstkontakt_fanout_retry
            - external_call_rejected
            - forecast_backup_created
            - forecast_backup_skipped
            - forecast_backup_unreferenced
            - forecast_generation_skipped
            - forecast_received
            - gate_closure_warning
            - korrektur_mail_failed
            - mailbox_move_failed
            - mailbox_sortieren_fehlgeschlagen
            - mailbox_sync_failed
            - notification_failed
            - open_position_published
            - orchestration_error
            - partin_answer_failed
            - partin_failed
            - quittung_nachfass_fehlgeschlagen
            - reference_check_degraded
            - schedules_submitted
            - service_draining
            - service_started
            - service_stopped
            - stammdaten_anfrage_fehlgeschlagen
            - zoe_auto_failed
            - zuordnung_failed
          title: Type
        level:
          type: string
          enum:
            - info
            - warning
            - error
          title: Level
        delivery_day:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Delivery Day
        text_de:
          type: string
          title: Text De
        text_en:
          type: string
          title: Text En
      additionalProperties: false
      type: object
      required:
        - id
        - ts
        - type
        - level
        - delivery_day
        - text_de
        - text_en
      title: EventItem
      description: |-
        One event in the app's words: built from typed fields only - never
        the event's message or data, which can carry personal data.
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````

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