Skip to main content

Project files

A project has files: what the planner's Dateien tab lists, and what the customer sees of it in Mein Bereich. They are a place of their own, apart from the documents of an offer: a file can be internal, and the customer can upload files too.

You list and download all of them, and you add, change and remove your team's. An offer request has files as well, the photos the customer sent for instance; those can be read.

Reading needs the read:documents scope and read:projects, for an offer request read:offers instead. Writing needs read:documents and write:projects.

Listing​

curl https://eeeihepkfdzlpfnnshin.supabase.co/functions/v1/api/v1/projects/41/files -H "Authorization: Bearer mds_live_your_key"
{
"data": [
{
"id": "5f0c2a1e-7b1d-4c6e-9a55-2f6d1f3b8c10",
"name": "Netzzusage.pdf",
"category": "DOCUMENT",
"note": null,
"visibleToCustomer": false,
"uploadedBy": { "kind": "TEAM", "name": "Katrin Wolf" },
"phase": "PROJECT",
"fileName": "Netzzusage.pdf",
"contentType": "application/pdf",
"sizeBytes": 482113,
"createdAt": "2026-11-30T09:14:03.512+00:00",
"downloadUrl": "https://…/storage/v1/object/sign/documents/…?token=…&download=Netzzusage.pdf",
"downloadUrlExpiresAt": "2026-11-30T11:00:00.000Z"
}
],
"categories": [
{ "code": "METER_CABINET", "description": "Zählerschrank mit offener Tür", "accepts": "image" },
{ "code": "DOCUMENT", "description": null, "accepts": "image_or_pdf" },
{ "code": "OTHER", "description": null, "accepts": "image_or_pdf" }
]
}

The newest file comes first.

  • Download a file with a plain GET on its downloadUrl — no API key needed, and the file comes with fileName as its name. The link works for one hour. Don't store it, since anyone with the link gets the file; list the files again for fresh links. It is null when the file is missing.
  • uploadedBy.kind says whose file it is: TEAM your team's, CUSTOMER the customer's own. A file an API key stored has API · <name of the key> as its uploader. The customer is told that it is your team's.
  • visibleToCustomer says whether the customer sees the file in Mein Bereich. Their own files always are.
  • phase is REQUEST for a file that came with the offer request the project was made from.
  • categories are the ones a file of your company can have: the photo types you ask your customers for (Einstellungen → Anfragen), DOCUMENT and OTHER.

Listing the files marks nothing as seen: a file your team has not looked at stays new in the planner.

One file alone, for instance for a fresh link, is GET /v1/projects/{id}/files/{fileId}. The files of an offer request are GET /v1/offer-requests/{id}/files, in the same form.

Adding a file​

Send a form (multipart/form-data) with the file in file:

curl https://eeeihepkfdzlpfnnshin.supabase.co/functions/v1/api/v1/projects/41/files -H "Authorization: Bearer mds_live_your_key" -F "file=@netzzusage.pdf" -F "name=Netzzusage.pdf" -F "visibleToCustomer=true"

The answer is the new file, as in the list above.

  • The file is a PDF, JPEG, PNG, WebP or HEIC of at most 20 MiB. Its type is told from its content, not from its name.
  • name (at most 200 characters) is optional; without it the file keeps its own.
  • category is DOCUMENT when you leave it out. The photo types take pictures only.
  • note (at most 1000 characters) is a short description. The customer sees it with the file.
  • visibleToCustomer is true or false, the default. An internal file is seen by your team only.

Every call stores a file, the same file twice as well. When a call ends without an answer (a timeout, a 5xx), look into the list before you send the file again. Send files one after another; many at the same moment are told to wait (429).

Changing and removing​

CallWhat it does
PATCH /v1/projects/{id}/files/{fileId}Shows the file to the customer or hides it, changes its category or its note.
DELETE /v1/projects/{id}/files/{fileId}Removes the file, also from Mein Bereich. This cannot be undone.

Both work on your team's files of the project, whoever stored them. The customer's own files can be read, but not changed or removed (409 customer_file): changing one would mark it as seen, and only a person should decide to remove a customer's file. The files your team added to the offer request are changed in the planner.

What the customer notices​

A file that becomes visible appears in Mein Bereich at once, marked as new and listed under the news there, and the project's history in the planner names your API key. No mail is sent. Hiding the file takes it out again.

Errors​

StatusErrorWhat to do
400validation_errorThe body is no form, the file is missing or empty, or a field is not valid, for instance a category your company does not have; the message names it.
404not_foundThe project, the offer request or the file does not exist in your company, or the file is your team's of the offer request.
409customer_fileThe file is the customer's own.
413file_too_largeThe file has more than 20 MiB.
415file_type_not_allowedSend a PDF, JPEG, PNG, WebP or HEIC, and no PDF for a photo type.
429rate_limitedThe key has stored 1000 files within the hour, or 20 files are being stored in the project at the same moment. Wait the seconds in Retry-After.