Download OpenAPI specification:
Automatically generated swagger spec for the media stack.
Returns the document identified by the given ID.
| id | string |
{- "id": "string",
- "name": "string",
- "ownerId": "string",
- "showInPortal": true,
- "type": "OTHER",
- "version": 0,
- "versions": [
- {
- "mediaId": "string",
- "userId": "string",
- "version": 0
}
]
}Creates a new document for the given owner from a media ID, with name, type, and showInPortal flag. Returns the created document.
| mediaId required | string |
| name required | string |
| ownerId required | string <int64> |
| showInPortal required | boolean |
| type required | string (mediadocumentType) Default: "OTHER" Enum: "OTHER" "APPLICATION_FORM" "HANDOVER_PROTOCOL" "CONTRACT" "BUILDING_PLAN" "INVOICE" "HOUSE_REGULATION" "INSTRUCTION_MANUAL" "CREDIT_CHECK" "OWNERS_MEETING" "PAY_IN_SLIP" "ENERGY_CERTIFICATE" "WARRANTY_CERTIFICATE" "BANK_STATEMENT" "ADDITIONAL_COSTS_BILL" "SEPA_DIRECT_DEBIT_MANDATE" "AGREEMENT" "DEPOSIT_CONFIRMATION" "BUILDING_INSURANCE_POLICY" "KEY_LIST" "TERMINATION_DOC_TYPE" "RENT_ADJUSTMENT_DOC_TYPE" "REFERENCES_DOC_TYPE" "MAINTENANCE_CONTRACT_DOC_TYPE" "REGULATIONS" "REGULATIONS_FOR_USE_AND_MANAGEMENT" "ANNUAL_FINANCIAL_STATEMENT" "PURCHASE_CONTRACT_AND_LAND_REGISTER" "CONDOMINIUM_OWNERSHIP" "RENEWAL_FOND" "MORTGAGE" "ORDER" "OFFER" "IDENTITY" "EXTRACT_FROM_DEBT_COLLECTION_REGISTER" "BANK_ACCOUNT_DETAILS" "PURCHASE_CONTRACT" "LAND_REGISTER" "SITUATION_PLAN" "CONSTRUCTION_LAW_AGREEMENT" "EASEMENT_AGREEMENT" "CADASTRAL_ESTIMATE" "LETTER" "TRADE_REGISTER_EXCERPT" "PAYMENT_REMINDER" "PROTOCOL" "COURT_DOC_TYPE" "HONORARIUM" "BUDGET" "OFFICIAL_ESTIMATE" "BUILDING_DESCRIPTION" "PERMITS" "LEGAL_MATTERS" "TENANT_CHANGE_NOTIFICATION" "LOSS_RATIO" "SHARE_CERTIFICATE_DOCUMENT" |
{- "mediaId": "string",
- "name": "string",
- "ownerId": "string",
- "showInPortal": true,
- "type": "OTHER"
}{- "id": "string",
- "name": "string",
- "ownerId": "string",
- "showInPortal": true,
- "type": "OTHER",
- "version": 0,
- "versions": [
- {
- "mediaId": "string",
- "userId": "string",
- "version": 0
}
]
}Returns the documents matching the given document IDs.
| documentIds required | Array of strings |
{- "documentIds": [
- "string"
]
}{- "documents": [
- {
- "id": "string",
- "name": "string",
- "ownerId": "string",
- "showInPortal": true,
- "type": "OTHER",
- "version": 0,
- "versions": [
- {
- "mediaId": "string",
- "userId": "string",
- "version": 0
}
]
}
]
}Merges the given media items into a single file with the provided mergeMediumName. Returns the merged media as bytes.
required | Array of objects (documentmergingMedium) |
| mergeMediumName required | string |
{- "media": [
- {
- "id": "string",
- "mediumName": "string"
}
], - "mergeMediumName": "string"
}{- "media": "string"
}Updates an existing document by ID with name, type, and showInPortal flag.
| id required | string |
| name | string |
| showInPortal | boolean |
| type | string (mediadocumentType) Default: "OTHER" Enum: "OTHER" "APPLICATION_FORM" "HANDOVER_PROTOCOL" "CONTRACT" "BUILDING_PLAN" "INVOICE" "HOUSE_REGULATION" "INSTRUCTION_MANUAL" "CREDIT_CHECK" "OWNERS_MEETING" "PAY_IN_SLIP" "ENERGY_CERTIFICATE" "WARRANTY_CERTIFICATE" "BANK_STATEMENT" "ADDITIONAL_COSTS_BILL" "SEPA_DIRECT_DEBIT_MANDATE" "AGREEMENT" "DEPOSIT_CONFIRMATION" "BUILDING_INSURANCE_POLICY" "KEY_LIST" "TERMINATION_DOC_TYPE" "RENT_ADJUSTMENT_DOC_TYPE" "REFERENCES_DOC_TYPE" "MAINTENANCE_CONTRACT_DOC_TYPE" "REGULATIONS" "REGULATIONS_FOR_USE_AND_MANAGEMENT" "ANNUAL_FINANCIAL_STATEMENT" "PURCHASE_CONTRACT_AND_LAND_REGISTER" "CONDOMINIUM_OWNERSHIP" "RENEWAL_FOND" "MORTGAGE" "ORDER" "OFFER" "IDENTITY" "EXTRACT_FROM_DEBT_COLLECTION_REGISTER" "BANK_ACCOUNT_DETAILS" "PURCHASE_CONTRACT" "LAND_REGISTER" "SITUATION_PLAN" "CONSTRUCTION_LAW_AGREEMENT" "EASEMENT_AGREEMENT" "CADASTRAL_ESTIMATE" "LETTER" "TRADE_REGISTER_EXCERPT" "PAYMENT_REMINDER" "PROTOCOL" "COURT_DOC_TYPE" "HONORARIUM" "BUDGET" "OFFICIAL_ESTIMATE" "BUILDING_DESCRIPTION" "PERMITS" "LEGAL_MATTERS" "TENANT_CHANGE_NOTIFICATION" "LOSS_RATIO" "SHARE_CERTIFICATE_DOCUMENT" |
{- "name": "string",
- "showInPortal": true,
- "type": "OTHER"
}{ }Adds a new version to the document identified by ID, linking the given media ID. Returns the updated document.
| id required | string |
| mediaId | string |
{- "mediaId": "string"
}{- "id": "string",
- "name": "string",
- "ownerId": "string",
- "showInPortal": true,
- "type": "OTHER",
- "version": 0,
- "versions": [
- {
- "mediaId": "string",
- "userId": "string",
- "version": 0
}
]
}Removes the specified version from the document identified by ID. Returns the updated document.
| id required | string |
| version required | integer <int32> |
{- "id": "string",
- "name": "string",
- "ownerId": "string",
- "showInPortal": true,
- "type": "OTHER",
- "version": 0,
- "versions": [
- {
- "mediaId": "string",
- "userId": "string",
- "version": 0
}
]
}Legacy sync Express multipart/form-data upload (not a gRPC method). Scans then stores and returns READY media immediately. Prefer CreateUpload for larger files (signed GCS PUT); both paths are always allowed.
The request body must be multipart/form-data with a single file field named file (plus optional form fields below). On success, returns the created media object as JSON (same fields as Media, status READY).
| Form field | Required | Description |
|---|---|---|
file |
yes | Binary file (multer field name file) |
public |
no | Visibility; truthy when "true" or "1" (default: private) |
accountId |
no | Owner account ID; falls back to x-account-id, else -1 |
filename |
no | Stored filename override (max 255 chars); defaults to the upload original name |
maxDimension |
no | Max image width/height in pixels before resize (images only) |
MIME type is detected from file content when possible. Blocked types (e.g. executables) return 403. Infected files (ClamAV) return 409. Missing file or invalid multipart return 400.
Example:
curl --location 'https://staging.myprop.ch/web/media' \
--form 'public="false"' \
--form 'file=@"/path/to/Vertrag.pdf"' \
--form 'accountId=30001'
Docs-only request shape for Upload. The real HTTP body is multipart/form-data;
the binary file part cannot be represented in protobuf and is documented on the RPC.
| accountId required | string <int64> Form field. Owner account ID; falls back to x-account-id, else -1. |
| filename | string Optional form field. Stored filename override (max 255 chars); defaults to the original upload name. |
| maxDimension | integer <int32> Optional form field. Max image width/height in pixels before resize (images only). |
| public required | boolean Form field. Truthy when sent as "true" or "1". Defaults to private. |
{- "filename": "string",
- "id": "string",
- "mimeType": "string",
- "ownerId": "string",
- "size": 0,
- "status": "MEDIA_STATUS_UNDEFINED",
- "thumbnails": [
- {
- "type": "S",
- "url": "string"
}
], - "uploadedAt": "string",
- "url": "string",
- "validUntil": "string"
}Start scan and promotion of quarantined file.Idempotent if already scanning or ready. Useful for local/dev without GCS notifications; also valid in production. Returns the current Media (may still be non-READY).
| id required | string |
{- "id": "string"
}{- "media": {
- "filename": "string",
- "id": "string",
- "mimeType": "string",
- "ownerId": "string",
- "size": 0,
- "status": "MEDIA_STATUS_UNDEFINED",
- "thumbnails": [
- {
- "type": "S",
- "url": "string"
}
], - "uploadedAt": "string",
- "url": "string",
- "validUntil": "string"
}
}Creates a PENDING media row and returns a GCS V4 signed PUT URL (valid 15 minutes) to a quarantine bucket. After PUT, the object is scanned asynchronously (ClamAV); poll Get until status is READY, or call CompleteUpload to enqueue the scan (also used for local/dev without the GCS Pub/Sub bridge).
Prefer this path for larger files; the legacy Express Upload remains available for small/sync uploads. No server-enforced size split between the two paths.
url and thumbnails are empty until status is READY. Client mimeType is a hint only; the worker overwrites MIME from detected file content.
| accountId required | string <int64> |
| filename required | string Stored filename (max 255 chars). |
| maxDimension | integer <int32> Optional. Max image width/height in pixels before resize (images only). |
| mimeType required | string Client MIME hint only; overwritten from detected content after upload. |
| public required | boolean |
| size required | integer <int32> Declared size in bytes. |
{- "accountId": "string",
- "filename": "string",
- "maxDimension": 0,
- "mimeType": "string",
- "public": true,
- "size": 0
}{- "media": {
- "filename": "string",
- "id": "string",
- "mimeType": "string",
- "ownerId": "string",
- "size": 0,
- "status": "MEDIA_STATUS_UNDEFINED",
- "thumbnails": [
- {
- "type": "S",
- "url": "string"
}
], - "uploadedAt": "string",
- "url": "string",
- "validUntil": "string"
}, - "uploadUrl": "string",
- "uploadUrlValidUntil": "string"
}Returns the media items matching the given IDs. Items may be PENDING, SCANNING, REJECTED, or EXPIRED with empty url and thumbnails; usable URLs are only present when status is READY. Clients should poll or wait for media.uploaded after CreateUpload.
| ids required | Array of strings |
{- "ids": [
- "string"
]
}{- "media": [
- {
- "filename": "string",
- "id": "string",
- "mimeType": "string",
- "ownerId": "string",
- "size": 0,
- "status": "MEDIA_STATUS_UNDEFINED",
- "thumbnails": [
- {
- "type": "S",
- "url": "string"
}
], - "uploadedAt": "string",
- "url": "string",
- "validUntil": "string"
}
]
}Sets the public flag on the media items with the given IDs according to the public value. Fails unless status is READY.
| ids required | Array of strings |
| public required | boolean |
{- "ids": [
- "string"
], - "public": true
}{ }Returns the media item identified by the given ID, including filename, MIME type, size, URL, thumbnails, validity, and status. url and thumbnails are empty unless status is READY. After CreateUpload, poll until READY or wait for media.uploaded.
| id required | string |
{- "media": {
- "filename": "string",
- "id": "string",
- "mimeType": "string",
- "ownerId": "string",
- "size": 0,
- "status": "MEDIA_STATUS_UNDEFINED",
- "thumbnails": [
- {
- "type": "S",
- "url": "string"
}
], - "uploadedAt": "string",
- "url": "string",
- "validUntil": "string"
}
}