openapi: 3.0.0
info:
  version: 1.0.0-alpha
  title: Zustelldienst - API Spezifikation
  description: Übergreifende API Schnittstelle des Zustelldienstes.
  contact:
    name: FITKO
    url: 'https://www.fitko.de/'
  license:
    url: 'https://creativecommons.org/licenses/by-sa/4.0/'
    name: Creative Commons Attribution Share Alike 4.0 (CC BY-SA 4.0)
  termsOfService: 'https://www.fitko.de/'
servers:
  - url: 'https://sender-test.fiep-poc.de/beta8'
    description: Testsystem
tags:
  - name: Destination Management
  - name: Application Transfer
  - name: Application Retrieval
  - name: Technical
paths:
  /destinations:
    get:
      operationId: get-all-destinations
      summary: Zustellpunkte auflisten
      description: Auflistung aller verfügbaren Zustellpunkte und ihrer unterstützen Antragsschemata.
      tags:
        - Destination Management
      security:
        - OAuth20:
            - 'destination:subscribe'
            - 'destination:manage'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAllDestinationsResponse'
              examples:
                example-1:
                  $ref: '#/components/examples/DestinationList'
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    post:
      operationId: create-destination
      summary: Zustellpunkt anlegen
      description: Erstellung eines neuen Zustellpunktes mit unterstüzten Antragsschemata.
      tags:
        - Destination Management
      security:
        - OAuth20:
            - 'destination:manage'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDestinationRequest'
            examples:
              example-1:
                $ref: '#/components/examples/DestinationRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDestinationResponse'
              examples:
                example-1:
                  $ref: '#/components/examples/DestinationResponse'
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      callbacks:
        ApplicationSubmitted:
          '{$request.body#/callback}':
            post:
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: '#/components/schemas/ListOfApplicationIds'
              responses:
                '202':
                  description: Accepted
  '/destinations/{destinationId}':
    parameters:
      - $ref: '#/components/parameters/destinationId'
    get:
      operationId: get-destination-info
      summary: Zustellpunkt abfragen
      description: Ruft die öffentlich zugänglichen Informationen über einen Zustellpunkt ab.
      tags:
        - Destination Management
      security:
        - OAuth20:
            - 'destination:manage'
            - 'destination:subscribe'
            - 'destination:send'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDestinationResponse'
              examples:
                example-1:
                  $ref: '#/components/examples/DestinationResponse'
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    put:
      operationId: update-destination
      summary: Zustellpunkt aktualisieren
      description: Aktualisiert einen Zustellpunkt.
      tags:
        - Destination Management
      security:
        - OAuth20:
            - 'destination:manage'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDestinationRequest'
            examples:
              example-1:
                $ref: '#/components/examples/DestinationRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDestinationResponse'
              examples:
                example-1:
                  $ref: '#/components/examples/DestinationResponse'
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    delete:
      operationId: delete-destination
      summary: Zustellpunkt löschen
      description: Löscht einen Zustellpunkt.
      tags:
        - Destination Management
      security:
        - OAuth20:
            - 'destination:manage'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmptyBody'
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /applications:
    post:
      operationId: create-application
      summary: Antrag anlegen
      description: Einen Antrag für die Zustellung vorbereiten
      tags:
        - Application Transfer
      security:
        - OAuth20:
            - 'destination:send'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateApplicationRequest'
            examples:
              example-1:
                $ref: '#/components/examples/CreateApplicationRequest'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplicationCreatedResponse'
              examples:
                example-1:
                  $ref: '#/components/examples/ApplicationCreatedResponse'
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '413':
          description: Request Entity Too Large
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  '/applications/{applicationId}':
    parameters:
      - $ref: '#/components/parameters/applicationId'
    get:
      operationId: get-application
      summary: Antragsdaten abholen
      description: Ruft die Fachdaten und Metadaten eines wartenden Antrags ab.
      tags:
        - Application Retrieval
      security:
        - OAuth20:
            - 'destination:manage'
            - 'destination:subscribe'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetApplicationResponse'
              examples:
                example-1:
                  $ref: '#/components/examples/ApplicationResponse'
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    post:
      operationId: submit-application
      summary: Antrag einreichen
      description: Ruft eine wartende Application ab.
      tags:
        - Application Transfer
      security:
        - OAuth20:
            - 'destination:send'
      requestBody:
        required: true
        content:
          application/jose:
            schema:
              $ref: '#/components/schemas/SubmitApplicationRequest'
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetApplicationResponse'
              examples:
                example-1:
                  $ref: '#/components/examples/ApplicationResponse'
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '413':
          description: Request Entity Too Large
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '415':
          description: Unsupported Media Type (wrong content type sent)
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validierung des Antrags schlug fehl
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    put:
      operationId: acknowledge-application
      summary: Abholung des Antrags bestätigen
      description: Antrag als abgeholt markieren
      tags:
        - Application Retrieval
      security:
        - OAuth20:
            - 'destination:subscribe'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmptyBody'
            examples:
              example-1:
                $ref: '#/components/examples/EmptyBody'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmptyBody'
              examples:
                example-1:
                  $ref: '#/components/examples/EmptyBody'
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  '/applications/{applicationId}/documents/{documentId}':
    parameters:
      - $ref: '#/components/parameters/applicationId'
      - $ref: '#/components/parameters/documentId'
    get:
      operationId: get-application-document
      summary: Dokument abrufen
      description: Ruft ein Dokument (z.B. Antragsformular / Anlage) des Antrags ab.
      tags:
        - Application Retrieval
      security:
        - OAuth20:
            - 'destination:manage'
            - 'destination:subscribe'
      responses:
        '200':
          description: OK
          content:
            application/jose:
              schema:
                $ref: '#/components/schemas/GetDocumentResponse'
              examples:
                example-1:
                  $ref: '#/components/examples/EncryptedMessage'
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    put:
      operationId: add-application-document
      summary: Dokument hochladen
      description: 'Fügt ein verschlüsseltes, base64 kodiertes Antragsformular / Anhang einem Antrag hinzu.'
      tags:
        - Application Transfer
      security:
        - OAuth20:
            - 'destination:send'
      requestBody:
        required: true
        content:
          application/jose:
            schema:
              $ref: '#/components/schemas/CreateDocumentRequest'
            examples:
              example-1:
                $ref: '#/components/examples/EncryptedMessage'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmptyBody'
        '400':
          description: Bad Request
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '413':
          description: Request Entity Too Large
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '415':
          description: Unsupported Media Type (wrong content type sent)
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /info:
    get:
      operationId: get-info
      summary: Rufe technische Serviceinformationen ab
      description: Für Debugging oder Informationszwecke angebotener Endpunkt
      tags:
        - Technical
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Info'
              examples:
                example-1:
                  $ref: '#/components/examples/Info'
  /status:
    get:
      operationId: get-status
      summary: Rufe Servicestatus ab
      description: Nützlich für Monitoring und Debugging
      tags:
        - Technical
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Status'
              example:
                status: UP
components:
  securitySchemes:
    OAuth20:
      description: 'Authentifizierungsmethode, um den Zugriff nach RFC8725 zu autorisieren'
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: 'https://sender-test-token.fiep-poc.de/auth/realms/test/protocol/openid-connect/token'
          scopes:
            'destination:send': 'Erlaubt es, Anträge an Zustellpunkte zu senden (Sender API)'
            'destination:manage': 'Erlaubt es, die Verwaltung der eigenen Zustellpunkte'
            'destination:susbcribe': 'Erlaubt es, (per Callback erhaltene) Anträge und Dokumente abzurufen'
  parameters:
    applicationId:
      name: applicationId
      in: path
      required: true
      schema:
        type: string
        format: uuid
        minLength: 32
        maxLength: 36
      description: Die UUID des Antrags
    destinationId:
      name: destinationId
      in: path
      required: true
      schema:
        type: string
        format: uuid
        minLength: 32
        maxLength: 36
      description: Die UUID des Zustellpunktes
    documentId:
      name: documentId
      in: path
      required: true
      schema:
        type: string
        format: uuid
        minLength: 32
        maxLength: 36
      description: 'Die UUID des Dokuments. Wird vom Client erstellt, um auf diese z.B. in den Antragsfachdaten zu referenzieren.'
  schemas:
    ApplicationCreatedResponse:
      title: Antragsmetadaten
      description: Metadaten zu einem Antrag.
      type: object
      required:
        - applicationId
        - destinationId
      properties:
        destinationId:
          type: string
          format: uuid
          minLength: 32
          maxLength: 36
        applicationId:
          description: ID des Antrags
          type: string
          format: uuid
          minLength: 32
          maxLength: 36
    ApplicationSchema:
      title: Antragsschema
      description: 'Repräsentation eines Schemas, in dem die Fachdaten eines Antrags übermittelt werden.'
      type: object
      required:
        - schemaSource
        - mimeType
      additionalProperties: false
      properties:
        schemaId:
          type: string
          description: 'Identifikator des Schemas, abhängig von der ausgewählten Quelle.'
        schemaSource:
          type: string
          enum:
            - fim
            - none
          description: 'Quelle, von der das Schema bezogen werden kann.'
        mimeType:
          type: string
          enum:
            - application/json
            - application/xml
          description: Gibt das zulässige Format (JSON oder XML) der Fachdaten an.
      x-examples:
        example-1:
          mimeType: application/json
          schemaSource: none
        example-2:
          mimeType: application/xml
          schemaSource: none
        example-3:
          mimeType: application/xml
          schemaSource: fim
          schemaId: S99000001V1.0
    ApplicationState:
      title: Antragsstatus
      description: |
        Beschreibt den Zustand eines Antrags: - `incomplete`: Der Antrag wurde angelegt und die Fachdaten/Dokumente können hinterlegt werden. - `queued`: Die Übertragung wurde vollständig eingeliefert, akzeptiert und sobald möglich weitergeleitet. - `forwarded`: Die Übertragung an die direkt angebundene Destination wurde abgeschlossen. - `delivered`: Der Erhalt des Antrags und aller Unterlagen wurde vom vorgesehenen Endpunkt bestätigt.
      type: string
      enum:
        - incomplete
        - queued
        - forwarded
        - delivered
    CreateApplicationRequest:
      title: Objekt zum Erzeugen eines Antrags
      description: 'Metadaten eines Antrags noch ohne ID, zum Anlegen eines neuen Antrags.'
      type: object
      additionalProperties: false
      required:
        - destinationId
        - announcedAttachments
      properties:
        destinationId:
          type: string
          format: uuid
          minLength: 32
          maxLength: 36
        announcedAttachments:
          type: object
          required:
            - data
            - documents
          properties:
            data:
              type: boolean
            documents:
              type: array
              minItems: 0
              items:
                type: string
                format: uuid
                minLength: 32
                maxLength: 36
    CreateDestinationRequest:
      title: Objekt zum Erzeugen eines Zustellpunkts
      description: 'Notwendige Struktur, um einen Zustellpunkt zu hinterlegen.'
      type: object
      additionalProperties: false
      properties:
        technicalContact:
          $ref: '#/components/schemas/TechnicalContact'
        schemas:
          uniqueItems: true
          minItems: 1
          type: array
          description: Auflistung aller unterstützten Antragsschemata des Zustellpunktes.
          items:
            $ref: '#/components/schemas/ApplicationSchema'
        callback:
          type: string
          minLength: 1
          format: uri
          description: 'Öffentliche URL des Zustellpunktes, an den Anträge geliefert werden sollen.'
        encryptionKey:
          $ref: '#/components/schemas/JWK'
        signatureKey:
          $ref: '#/components/schemas/JWK'
      required:
        - technicalContact
        - schemas
        - callback
        - encryptionKey
        - signatureKey
    CreateDocumentRequest:
      title: Objekt zum Erzeugen eines Dokuments
      description: 'Repräsentation eines Dokumentes, das mit einem Antrag verknüpft wird. JSON Web Encryption Compact Serialization, RFC 7516'
      type: string
      minLength: 1
      pattern: '^[a-zA-Z0-9-_=.]+$'
    EmptyBody:
      title: Leeres JSON-Objekt
      type: object
      additionalProperties: false
    ErrorResponse:
      title: Fehler
      type: object
      description: Der Inhalt von HTTP Responses bei Fehlern nach RFC7807.
      required:
        - type
        - title
        - status
      properties:
        type:
          type: string
        title:
          type: string
        status:
          type: integer
          minimum: 100
          maximum: 599
        detail:
          type: string
        instance:
          type: string
          format: uri
    GetAllDestinationsResponse:
      title: Liste von Zustellpunkten
      type: object
      required:
        - destinations
      properties:
        destinations:
          type: array
          minItems: 0
          items:
            $ref: '#/components/schemas/GetDestinationResponse'
          description: Eine Auflistung von Zustellpunkten mit ihren öffentlichen Informationen.
    GetApplicationResponse:
      title: Antragsmetadaten
      description: Metadaten zu einem Antrag.
      type: object
      required:
        - applicationId
        - documents
        - destinationId
        - currentStatus
      properties:
        destinationId:
          type: string
          format: uuid
          minLength: 32
          maxLength: 36
        applicationId:
          description: ID des Antrags
          type: string
          format: uuid
          minLength: 32
          maxLength: 36
        documents:
          type: array
          items:
            type: string
        encryptedMetadata:
          title: JWE Encrypted Message
          description: 'Content that is encrypted with JSON Web Encryption Compact Serialization, RFC 7516'
          type: string
          pattern: '^[a-zA-Z0-9-_=.]+$'
        encryptedData:
          title: JWE Encrypted Message
          description: 'Content that is encrypted with JSON Web Encryption Compact Serialization, RFC 7516'
          type: string
          pattern: '^[a-zA-Z0-9-_=.]+$'
        currentStatus:
          $ref: '#/components/schemas/ApplicationState'
        statusHistory:
          type: array
          items:
            $ref: '#/components/schemas/StateTransition'
      x-examples:
        example-1:
          contentStructure:
            mimeType: application/json
            schemaSource: none
          documents:
            - 879ee109-a690-4db8-ab32-424284184d7d
            - 2046f9f1-dc89-4440-9c24-c76a8f40d668
            - 7219ee1a-b6e1-4f7a-a315-11bc5f1ab408
            - 84adb326-55ac-4155-b2b4-cb7faf760d34
            - a84058af-1468-4995-a756-8659803dc38c
          encryptedMetadata: ndJi4KyxYGI1axPbXf0AVM7mMAFef1pw6Y4IEFv+IDmTmrxPVpC4Vg==
          applicationId: ce75a6b8-d72f-4b94-b09e-af6be35bc2ae
    GetDestinationResponse:
      title: Zustellpunkt
      description: Repräsentation eines Zustellpunktes mit den öffentlich einsehbaren Attributen
      type: object
      properties:
        destinationId:
          type: string
          minLength: 32
          format: uuid
          maxLength: 36
          description: Identifikator des Zustellpunktes
        schemas:
          uniqueItems: true
          minItems: 1
          type: array
          description: Auflistung aller unterstützten Antragsschemata des Zustellpunktes.
          items:
            $ref: '#/components/schemas/ApplicationSchema'
        callback:
          type: string
          minLength: 1
          format: uri
          description: 'Öffentliche URL des Zustellpunktes, an den Anträge geliefert werden sollen.'
      required:
        - destinationId
        - schemas
        - callback
    GetDocumentResponse:
      title: Dokument
      description: 'Repräsentation eines Dokumentes, das mit einem Antrag verknüpft ist.'
      type: string
      pattern: '^[a-zA-Z0-9-_=.]+$'
    Info:
      title: Technisches Serviceinformationen
      type: object
      required:
        - version
      properties:
        version:
          $ref: '#/components/schemas/Version'
    JWK:
      title: JSON Web Key (JWK)
      type: object
      description: JSON Web Key - RFC 7517
      additionalProperties: false
      required:
        - kty
        - kid
      properties:
        kty:
          type: string
          description: Key Type
          enum:
            - EC
            - RSA
            - oct
            - OKP
        use:
          type: string
          description: Public Key Use
          enum:
            - sig
            - enc
        key_ops:
          type: array
          description: Key Operations
          items:
            type: string
            enum:
              - sign
              - verify
              - encrypt
              - decrypt
              - wrapKey
              - unwrapKey
              - deriveKey
              - deriveBits
        alg:
          type: string
          description: Algorithm
        kid:
          description: Key ID
          type: string
        x5u:
          type: string
          description: X.509 URL
          format: uri
        x5c:
          description: X.509 Certificate Chain
          type: array
          items:
            type: string
        x5t:
          type: string
        x5t#S256:
          type: string
    ListOfApplicationIds:
      title: Zustellpunkt Callback Body
      description: 'Liste von Anträgen, die für den Endpunkt zur Abholung bereitstehen'
      type: array
      minItems: 1
      items:
        type: string
        format: uuid
        minLength: 32
        maxLength: 36
    StateTransition:
      title: Statusübergang
      description: Stellt einen Statusübergang eines Antrags dar.
      type: object
      required:
        - sourceState
        - targetState
        - timestamp
      additionalProperties: false
      properties:
        sourceState:
          $ref: '#/components/schemas/ApplicationState'
        targetState:
          $ref: '#/components/schemas/ApplicationState'
        details:
          type: string
        timestamp:
          type: string
          format: date-time
    Status:
      title: Servicestatus
      type: object
      required:
        - status
      properties:
        status:
          type: string
    SubmitApplicationRequest:
      title: Antrag absenden
      description: Die mit Hilfe von JWE verschlüsselten Metadaten des Antrags.
      type: object
      required:
        - encryptedMetadata
        - encryptedData
      properties:
        encryptedMetadata:
          type: string
          pattern: '^[a-zA-Z0-9-_=.]+$'
        encryptedData:
          type: string
          pattern: '^[a-zA-Z0-9-_=.]+$'
    TechnicalContact:
      title: Technischer Kontakt
      description: Angaben zum technischen Ansprechpartner des Zustellpunktes im Falle eines Problems.
      type: object
      additionalProperties: false
      required:
        - firstName
        - lastName
        - email
        - organizationName
      properties:
        firstName:
          type: string
          description: Vorname des technischen Ansprechpartners
        lastName:
          type: string
          description: Nachname des technischen Ansprechpartners
        email:
          type: string
          description: E-Mail des technischen Ansprechpartners
        organizationName:
          type: string
          description: Name des Unternehmens des technischen Ansprechpartners
    UpdateDestinationRequest:
      title: Aktualisierung eines Zustellpunktes
      description: 'Struktur mit Attributen, die aktualisiert werden sollen.'
      type: object
      additionalProperties: false
      x-examples: {}
      properties:
        technicalContact:
          $ref: '#/components/schemas/TechnicalContact'
        schemas:
          uniqueItems: true
          minItems: 1
          type: array
          description: Auflistung aller unterstützten Antragsschemata des Zustellpunktes.
          items:
            $ref: '#/components/schemas/ApplicationSchema'
        callback:
          type: string
          minLength: 1
          format: uri
          description: 'Öffentliche URL des Zustellpunktes, an den Anträge geliefert werden sollen.'
        encryptionKey:
          $ref: '#/components/schemas/JWK'
        signatureKey:
          $ref: '#/components/schemas/JWK'
    Version:
      title: Serviceversion
      type: object
      required:
        - major
        - minor
        - patch
      properties:
        major:
          type: integer
        minor:
          type: integer
        patch:
          type: integer
  examples:
    ApplicationCreatedResponse:
      value:
        destinationId: 879ee109-a690-4db8-ab32-424284184d7d
        applicationId: ce75a6b8-d72f-4b94-b09e-af6be35bc2ae
    ApplicationResponse:
      value:
        destinationId: 879ee109-a690-4db8-ab32-424284184d7d
        applicationId: ce75a6b8-d72f-4b94-b09e-af6be35bc2ae
        documents:
          - 879ee109-a690-4db8-ab32-424284184d7d
          - 2046f9f1-dc89-4440-9c24-c76a8f40d668
        encryptedMetadata: eyJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiUlNBLU9BRVAtMjU2In0.nlXGAufYH36IABDy0En0LXEhGfC20IZSSchs27ADalHpRoTZKfXhc7hcMk8Y9V8yTP0jYbmrq6NtEg-QS2O5TQFD9Hluhpb631PBgKjPXHYX1Y6iUcR1sXxSUPjePi8F8PcZUZuUJLnhz6myyc9scdAq9BXG2cDJVgkfLI8eZdrqnrY24Hh32_7d5OKLFSpSDrBlqfyQuY8Wbs2h8Wy4Z4hwT1aWDO7b-SqJA181hUbNcF_rR4Mze3Fdtu-3uOIQYgLBBRmN1ZHDLk0EKNCI4B8MyDKLGPoM0ZomV5lVwVWjAMRI4CgQkIQ9rnm-Adof-GbegQL3yJSoNIWRWgzCnZBYZ638QgPllCMVW3WvEVvsgj0Hj16PbofqXTQ5S73LINfP6FZawfC0yMrYjSV_N2L0Lkp2KI3BkJcy-PcFhBnhwu2IsJGAlyDRCnXdVqig8m5yLHuSMQTpLW69LzPEskfsjhnNDR-CEBZpicjMfc-4CL6U7E7YoGc_99DzE5U5._JfqyKH23GiKsnDW.ZtMMjZ3GgcgHss8qbFRhrjl4L0kAfbco-oXICkk.VBHJ00FyDTYjOA_OYfiz5g
        encryptedData: eyJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiUlNBLU9BRVAtMjU2In0.nlXGAufYH36IABDy0En0LXEhGfC20IZSSchs27ADalHpRoTZKfXhc7hcMk8Y9V8yTP0jYbmrq6NtEg-QS2O5TQFD9Hluhpb631PBgKjPXHYX1Y6iUcR1sXxSUPjePi8F8PcZUZuUJLnhz6myyc9scdAq9BXG2cDJVgkfLI8eZdrqnrY24Hh32_7d5OKLFSpSDrBlqfyQuY8Wbs2h8Wy4Z4hwT1aWDO7b-SqJA181hUbNcF_rR4Mze3Fdtu-3uOIQYgLBBRmN1ZHDLk0EKNCI4B8MyDKLGPoM0ZomV5lVwVWjAMRI4CgQkIQ9rnm-Adof-GbegQL3yJSoNIWRWgzCnZBYZ638QgPllCMVW3WvEVvsgj0Hj16PbofqXTQ5S73LINfP6FZawfC0yMrYjSV_N2L0Lkp2KI3BkJcy-PcFhBnhwu2IsJGAlyDRCnXdVqig8m5yLHuSMQTpLW69LzPEskfsjhnNDR-CEBZpicjMfc-4CL6U7E7YoGc_99DzE5U5._JfqyKH23GiKsnDW.ZtMMjZ3GgcgHss8qbFRhrjl4L0kAfbco-oXICkk.VBHJ00FyDTYjOA_OYfiz5g
        currentStatus: queued
        statusHistory:
          - sourceState: incomplete
            targetState: queued
            timestamp: '2021-01-30T08:30:00Z'
    CreateApplicationRequest:
      value:
        destinationId: 879ee109-a690-4db8-ab32-424284184d7d
        announcedAttachments:
          data: true
          documents:
            - 123ee109-a690-4db8-ab32-424284184d7d
            - 456ee109-a690-4db8-ab32-424284184d7d
    DestinationList:
      value:
        destinations:
          - destinationId: de735e92-8ced-4298-a021-5f4aa124cc47
            schemas:
              - mimeType: application/json
                schemaSource: none
            callback: 'https://example.com/api-callback2'
          - destinationId: 2f59b8c6-3206-4734-aa21-a7b2a4d92f7a
            schemas:
              - mimeType: application/xml
                schemaSource: none
              - mimeType: application/json
                schemaSource: none
              - mimeType: application/xml
                schemaSource: fim
                schemaId: S99000001V1.0
            callback: 'https://example.com/api-callback3'
    DestinationRequest:
      value:
        encryptionKey:
          kty: RSA
          kid: '12'
        signatureKey:
          kty: RSA
          kid: '12'
        technicalContact:
          firstName: Max
          lastName: Mustermann
          email: max@mustermann.not
          organizationName: Musterorganisation
        schemas:
          - mimeType: application/json
            schemaSource: none
        callback: 'http://127.0.0.1:4010/voluptas'
    DestinationResponse:
      value:
        destinationId: 7881dba9-4055-4854-8b6d-11ea5b7f3047
        schemas:
          - mimeType: application/json
            schemaSource: none
        callback: 'http://127.0.0.1:4010/voluptas'
    EmptyBody:
      value: {}
    EncryptedMessage:
      value: eyJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiUlNBLU9BRVAtMjU2In0.nlXGAufYH36IABDy0En0LXEhGfC20IZSSchs27ADalHpRoTZKfXhc7hcMk8Y9V8yTP0jYbmrq6NtEg-QS2O5TQFD9Hluhpb631PBgKjPXHYX1Y6iUcR1sXxSUPjePi8F8PcZUZuUJLnhz6myyc9scdAq9BXG2cDJVgkfLI8eZdrqnrY24Hh32_7d5OKLFSpSDrBlqfyQuY8Wbs2h8Wy4Z4hwT1aWDO7b-SqJA181hUbNcF_rR4Mze3Fdtu-3uOIQYgLBBRmN1ZHDLk0EKNCI4B8MyDKLGPoM0ZomV5lVwVWjAMRI4CgQkIQ9rnm-Adof-GbegQL3yJSoNIWRWgzCnZBYZ638QgPllCMVW3WvEVvsgj0Hj16PbofqXTQ5S73LINfP6FZawfC0yMrYjSV_N2L0Lkp2KI3BkJcy-PcFhBnhwu2IsJGAlyDRCnXdVqig8m5yLHuSMQTpLW69LzPEskfsjhnNDR-CEBZpicjMfc-4CL6U7E7YoGc_99DzE5U5._JfqyKH23GiKsnDW.ZtMMjZ3GgcgHss8qbFRhrjl4L0kAfbco-oXICkk.VBHJ00FyDTYjOA_OYfiz5g
    Info:
      value:
        version:
          major: 1
          minor: 0
          patch: 1
