> ## 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.

# Post Mailbox Ablegen

> File handled inbox mails into the archive folder - for replies the
reconciliation deliberately left in the inbox (unclear or
unattributable confirmations) once a human has acted on them.



## OpenAPI

````yaml /setup/internal-openapi.json post /v1/process/erstkontakt/mailbox/ablegen
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) and the operator console
    endpoints. Requires the process API key; not for customer use.
servers:
  - url: >-
      https://nleadbridge-app.lemonisland-7d6503d3.germanywestcentral.azurecontainerapps.io
    description: Deployed service
  - url: http://localhost:8000
    description: Local development
security: []
paths:
  /v1/process/erstkontakt/mailbox/ablegen:
    post:
      summary: Post Mailbox Ablegen
      description: |-
        File handled inbox mails into the archive folder - for replies the
        reconciliation deliberately left in the inbox (unclear or
        unattributable confirmations) once a human has acted on them.
      operationId: post_mailbox_ablegen_v1_process_erstkontakt_mailbox_ablegen_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MailboxAblegenRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MailboxAblegenResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    MailboxAblegenRequest:
      properties:
        senders:
          items:
            type: string
          type: array
          title: Senders
          description: >-
            Sender addresses whose inbox mails to file (case-insensitive, exact
            match)
        uids:
          items:
            type: string
          type: array
          title: Uids
          description: IMAP UIDs of individual inbox mails to file
        dry_run:
          type: boolean
          title: Dry Run
          default: false
      type: object
      title: MailboxAblegenRequest
      description: |-
        File handled inbox mails into the archive folder.

        Unclear or unattributable confirmations are deliberately left in the
        inbox until a human decided; once decided, this moves them out. Name
        the mails by sender address and/or IMAP UID - an empty selection is
        refused. ``dry_run`` lists the matches without moving anything.
    MailboxAblegenResponse:
      properties:
        dry_run:
          type: boolean
          title: Dry Run
        folder:
          type: string
          title: Folder
          description: Source folder (the configured inbox)
        target:
          type: string
          title: Target
          description: Destination (the configured archive)
        moved:
          items:
            $ref: '#/components/schemas/AbgelegteMail'
          type: array
          title: Moved
          description: 'Mails filed now (with dry_run: the mails that would be)'
        failed:
          items:
            $ref: '#/components/schemas/AbgelegtFehler'
          type: array
          title: Failed
          description: Matches whose IMAP move failed - logged, left in place
      type: object
      required:
        - dry_run
        - folder
        - target
        - moved
        - failed
      title: MailboxAblegenResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AbgelegteMail:
      properties:
        uid:
          type: string
          title: Uid
          description: IMAP UID in the inbox folder
        from:
          type: string
          title: From
          description: Sender address
        date:
          type: string
          title: Date
          description: Message date header
        subject:
          type: string
          title: Subject
          description: Subject, truncated to 160 characters
      type: object
      required:
        - uid
        - from
        - date
        - subject
      title: AbgelegteMail
    AbgelegtFehler:
      properties:
        uid:
          type: string
          title: Uid
          description: IMAP UID in the inbox folder
        from:
          type: string
          title: From
          description: Sender address
        date:
          type: string
          title: Date
          description: Message date header
        subject:
          type: string
          title: Subject
          description: Subject, truncated to 160 characters
        error:
          type: string
          title: Error
          description: Why the move failed; the mail stays put
      type: object
      required:
        - uid
        - from
        - date
        - subject
        - error
      title: AbgelegtFehler
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    HTTPBearer:
      type: http
      description: OIDC access token (Auth0 M2M)
      scheme: bearer

````