---
title: "Medium hochladen"
url: "https://maklerportal.apim.eu/apis/objektverwaltung/versions/725feb93-ed74-4ebf-862d-00afd038d14d/operations/mediumHochladen"
---

> Full API specification: https://maklerportal.apim.eu/apis/objektverwaltung/versions/725feb93-ed74-4ebf-862d-00afd038d14d.md

# Medium hochladen

`POST` `/objekte/{objektId}/medien`

Operation ID: `mediumHochladen`

Bilder, Grundrisse und Dokumente werden dem Objekt zugeordnet, nicht dem Exposé.

## Path parameters

- `objektId` (string, required)

## Request body (required)

Content types: `multipart/form-data`

## Responses

- `201` - Hochgeladen
- `413` - Datei zu groß (Grenze 25 MB)

## OpenAPI definition

```yaml
openapi: 3.0.3
info:
  title: Objektverwaltung
  version: 1.0.0
servers:
  - url: https://api.maklerportal.example/v1
    description: Produktion
  - url: https://sandbox.api.maklerportal.example/v1
    description: Sandbox
paths:
  /objekte/{objektId}/medien:
    parameters:
      - name: objektId
        in: path
        required: true
        schema:
          type: string
          example: obj_8f2c1a
    post:
      tags:
        - Medien
      summary: Medium hochladen
      description: Bilder, Grundrisse und Dokumente werden dem Objekt zugeordnet,
        nicht dem Exposé.
      operationId: mediumHochladen
      security:
        - apiKey: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - datei
                - kategorie
              properties:
                datei:
                  type: string
                  format: binary
                kategorie:
                  $ref: "#/components/schemas/Medienkategorie"
                reihenfolge:
                  type: integer
                  minimum: 1
                  example: 1
                bildunterschrift:
                  type: string
                  maxLength: 160
      responses:
        "201":
          description: Hochgeladen
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Medium"
        "413":
          description: Datei zu groß (Grenze 25 MB)
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Fehler"
security:
  - apiKey: []
components:
  schemas:
    Medienkategorie:
      type: string
      enum:
        - titelbild
        - innenansicht
        - aussenansicht
        - grundriss
        - energieausweis
        - dokument
    Medium:
      type: object
      properties:
        id:
          type: string
          example: med_31c9
        kategorie:
          $ref: "#/components/schemas/Medienkategorie"
        url:
          type: string
          format: uri
          example: https://cdn.maklerportal.example/objekte/obj_8f2c1a/med_31c9.jpg
        reihenfolge:
          type: integer
          example: 1
        bildunterschrift:
          type: string
          example: Wohnzimmer mit Blick auf den Innenhof
        groesse_byte:
          type: integer
          example: 2418112
    Fehler:
      type: object
      description: Einheitliches Fehlerformat aller Maklerportal-APIs.
      required:
        - code
        - nachricht
      properties:
        code:
          type: string
          example: validierung_fehlgeschlagen
        nachricht:
          type: string
          example: Für die Veröffentlichung fehlen Pflichtangaben aus dem Energieausweis.
        details:
          type: array
          items:
            $ref: "#/components/schemas/Fehlerdetail"
    Fehlerdetail:
      type: object
      properties:
        feld:
          type: string
          example: energieausweis.endenergiebedarf_kwh
        grund:
          type: string
          example: fehlt
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: apikey
      description: >
        Jeder Aufruf trägt einen API-Schlüssel im Header `apikey`. Den Schlüssel

        erzeugen Sie im Maklerportal unter "Meine Anwendungen"; er wird genau
        einmal

        angezeigt.


        An jedem Schlüssel hängen die Scopes, die er nutzen darf. Fehlt einer,

        antwortet die API mit `403` und `code: "scope_fehlt"`; der fehlende
        Scope

        steht in `details[].feld`.
```
