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

> Ask the partners who rejected our messages for not knowing our
MP-ID to set us up as a market partner. Only the two rejection classes
that say exactly that are addressed - CONTRL syntax error 23 and
APERAK Z29 - and the mail cites the rejected interchanges with their
error codes, both of our MP-IDs with their roles, and the deadline
Kapitel 2 of the AS4 Übertragungsweg rules puts on the setup. One
request per partner; ``dry_run`` lists what would go out.



## OpenAPI

````yaml /setup/internal-openapi.json post /v1/process/mail/stammdaten
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/stammdaten:
    post:
      summary: Post Mail Stammdaten
      description: |-
        Ask the partners who rejected our messages for not knowing our
        MP-ID to set us up as a market partner. Only the two rejection classes
        that say exactly that are addressed - CONTRL syntax error 23 and
        APERAK Z29 - and the mail cites the rejected interchanges with their
        error codes, both of our MP-IDs with their roles, and the deadline
        Kapitel 2 of the AS4 Übertragungsweg rules puts on the setup. One
        request per partner; ``dry_run`` lists what would go out.
      operationId: post_mail_stammdaten_v1_process_mail_stammdaten_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StammdatenRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StammdatenResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    StammdatenRequest:
      properties:
        dry_run:
          type: boolean
          title: Dry Run
          default: false
        limit:
          type: integer
          maximum: 500
          minimum: 0
          title: Limit
          description: 0 = uncapped
          default: 0
        mp_ids:
          anyOf:
            - items:
                type: string
              type: array
              maxItems: 500
            - type: 'null'
          title: Mp Ids
          description: Restrict the run to these partners; omitted = every candidate
        lookback_days:
          type: integer
          maximum: 180
          minimum: 1
          title: Lookback Days
          default: 90
      type: object
      title: StammdatenRequest
      description: |-
        Ask the partners who rejected us for not knowing us to set us up.

        Only the two rejection classes that mean "your MP-ID is unknown" are
        addressed: CONTRL syntax error 23 and APERAK Z29.
    StammdatenResponse:
      properties:
        dry_run:
          type: boolean
          title: Dry Run
        limit:
          type: integer
          title: Limit
        targets:
          items:
            $ref: '#/components/schemas/StammdatenTarget'
          type: array
          title: Targets
        sent:
          items:
            $ref: '#/components/schemas/StammdatenTarget'
          type: array
          title: Sent
        skipped:
          items:
            $ref: '#/components/schemas/StammdatenTarget'
          type: array
          title: Skipped
      type: object
      required:
        - dry_run
        - limit
        - targets
        - sent
        - skipped
      title: StammdatenResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    StammdatenTarget:
      properties:
        mp_id:
          type: string
          title: Mp Id
        name:
          type: string
          title: Name
          default: ''
        email:
          type: string
          title: Email
          default: ''
        kontakt_quelle:
          type: string
          enum:
            - manuell
            - bdew
          title: Kontakt Quelle
          default: bdew
        klassen:
          items:
            type: string
          type: array
          title: Klassen
          description: The rejection classes seen for this partner, e.g. ['CONTRL 23']
        referenzen:
          items:
            type: string
          type: array
          title: Referenzen
          description: Datenaustauschreferenzen of the rejected interchanges
        skip:
          type: string
          title: Skip
          default: ''
      type: object
      required:
        - mp_id
      title: StammdatenTarget
    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

````