> ## 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 Mail Senden

> Send one hand-written mail from the Erstkontakt mailbox (SMTP) -
the reply to a partner's question, for instance. Recorded in the
``manuelle_mails`` ledger and the event log.



## OpenAPI

````yaml /setup/internal-openapi.json post /v1/process/mail/senden
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://{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/process/mail/senden:
    post:
      summary: Post Mail Senden
      description: |-
        Send one hand-written mail from the Erstkontakt mailbox (SMTP) -
        the reply to a partner's question, for instance. Recorded in the
        ``manuelle_mails`` ledger and the event log.
      operationId: post_mail_senden_v1_process_mail_senden_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MailSendenRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MailSendenResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    MailSendenRequest:
      properties:
        to:
          type: string
          pattern: ^[^@\s]+@[^@\s]+\.[^@\s]+$
          title: To
        subject:
          type: string
          maxLength: 300
          minLength: 3
          title: Subject
        body:
          type: string
          minLength: 10
          title: Body
        mp_id:
          type: string
          pattern: ^(\d{13})?$
          title: Mp Id
          default: ''
      type: object
      required:
        - to
        - subject
        - body
      title: MailSendenRequest
      description: |-
        One hand-written mail from the Erstkontakt mailbox - e.g. the reply
        to a partner's question. Put ``[Ref. <MP-ID>]`` in the subject so the
        mailbox reconciliation attributes the answer.
    MailSendenResponse:
      properties:
        to:
          type: string
          title: To
        subject:
          type: string
          title: Subject
        sent_at:
          type: string
          title: Sent At
      type: object
      required:
        - to
        - subject
        - sent_at
      title: MailSendenResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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

````