---
title: "API-Funktion Projekterstellung V1"
description: "Diese Funktion stellt die Projekterstellung (addProject) via Schnittstelle (API) bereit. Hierbei handelt es sich um die v1."
url: https://support.grundsteine.com/de/articles/108-api-funktion-projekterstellung-v1
collection: "Vor dem Projekt"
updated: 2026-09-01
language: de
---

# API-Funktion Projekterstellung V1

Diese Funktion stellt die Projekterstellung (addProject) via Schnittstelle (API) bereit. Hierbei handelt es sich um die v1.

## Übersicht

Die `addProject` Funktion ist eine API-Funktion, die es externen Systemen ermöglicht, neue Projekte über eine HTTP-Schnittstelle zu importieren. Diese Funktion wird hauptsächlich verwendet, um Projektdaten von externen Quellen (z. B. Websites, Partner-Systemen) automatisiert zu übernehmen.

## Zweck

Die Funktion ermöglicht:

-   Das Erstellen neuer Projekte mit Gebäude- und Kontaktdaten über eine REST-API
    
-   Die sichere Authentifizierung mittels JWT-Token
    
-   Die automatische Validierung von Pflichtfeldern
    
-   Die Verwendung von Projektvorlagen (Templates)
    
-   Die automatische E-Mail-Benachrichtigung bei Fehlern
    

## Authentifizierung

### JWT-Token

Die Funktion verwendet JWT (JSON Web Token) zur Authentifizierung. Das Token wird als Query-Parameter `token` übergeben.

### Token-Freischaltung

**Wichtig:** Die Freischaltung eines Tokens kann über den Support ermöglicht werden.

Das Token kann nach Freischaltung hier generiert werden: https://app.grundsteine.com/settings?tab=privacy

## API-Endpunkt

Der Endpunkt ist https://eba-api.azurewebsites.net/addProject?token=MEIN\_TOKEN.

### HTTP-Methode

POST

### URL-Parameter

-   `token` (erforderlich): JWT-Token zur Authentifizierung
    

## Request Body

Der Request Body muss ein JSON-Objekt mit dem Feld `data` enthalten.

### Parameter-Übersicht

#### `data` (oberste Ebene)

Parameter

Typ

Pflicht

Standard

Beschreibung

<table data-id="c6240398-61df-4348-bc17-16b968eca9a5" style="min-width: 125px;"><colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"><col style="min-width: 25px;"><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="83da28f1-e4cb-40a4-8166-37e595a42a5f"><code>client</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="790a2cea-6338-4f37-8ae0-c1a5269d6450">Objekt</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="9b58dd5f-0b23-4a2f-8eba-e17a96a95fc8">nein</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="6378d051-c56e-4914-b934-26f145edcf91">–</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="a4401d07-231b-4fea-851d-e7bf44ea101f">Kontaktdaten des Kunden (siehe <code>client</code>-Parameter)</p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="dcfe41e1-f341-4d5a-98f2-417907ca1ee0"><code>building</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="d674f307-ed57-4862-ad8f-c181f49f0d04">Objekt</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="568f1a05-8561-41e9-852f-e45cf04d496c"><strong>ja</strong></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="e97ffbec-73cd-495d-b8b6-33248705ca9c">–</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="9110f2cb-d25e-4ae5-8d6d-0872cca800f6">Gebäudedaten (siehe <code>building</code>-Parameter)</p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="f66d80ad-1d5a-435a-9fb3-0703ea711658"><code>reference</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="f08cc7e7-4e8c-4687-9683-7afd34e83379">string</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="7b814c16-3344-4c70-8d1c-0fba4f78d875">nein</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="58f60304-1d99-48e1-80eb-187368d21d8b"><code>"WEBSITE"</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="0ea155a2-bb40-43f2-b7fa-fba8a690614f">Freie Referenz, z. B. zur Identifikation der Import-Quelle</p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="220e2338-23ae-4c8a-a786-26f69b780b27"><code>note</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="2998a158-b340-4d61-9376-778effa494a3">string</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="ec88ec66-79f0-42a0-b3e5-2f1e3ecc47b7">nein</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="875c4812-370f-4c13-ba16-ab2c05f7d0d0"><code>"Importiert via Website"</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="2aaffc68-44ec-4836-8c13-926e12875662">Interne Notiz zum Projekt</p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="433b0bb8-3501-405d-a10a-cee3c0c39eec"><code>state</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="5bcee5cb-cde1-4675-a7e3-329eddcb07b1">enum</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="b9f02781-a711-4d3f-bf24-e2162e379f83">nein</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="fc0a6ea8-4aa8-49c0-9c90-cd686a18615d"><code>"ACTIVE"</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="83988b83-e22e-49ac-b742-4754b866ea59">Status des Projekts (siehe Enum <code>ProjectState</code>)</p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="ff772ecf-1917-44ac-97fa-4591bbec8730"><code>type</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="82709d1f-d19f-4b0a-82c6-6d7aa7d5d364">string</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="9a316258-8fa7-4713-8d4d-5cd56e83ded0">nein</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="8856c130-6a06-4cbb-8052-0ad1cecc395c"><code>"Anfrage/Angebot"</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="81bc2144-cf1c-4665-9e9d-71fb87163dc0">Projekttyp; überschreibt den Template-Typ, wenn <code>templateId</code> angegeben ist. Ohne Angabe von <code>type</code> und <code>templateId</code> wird <code>"Anfrage/Angebot"</code> verwendet</p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="fe71f41e-3777-45b5-b0e0-a549f24a612f"><code>templateId</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="e21e34e3-9e1b-457c-8fdb-43e392ad2e76">string</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="c49b960d-4a7f-4fda-81d0-97a8278681e6">nein</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="87bf1d2f-ab09-4af7-902f-a8ea42fc5af0">–</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="0e45d6cf-8f7d-4964-a4f1-6120ebd3db93">UUID einer Projektvorlage, deren Struktur und Einstellungen übernommen werden</p></td></tr></tbody></table>

#### `client` (Kontaktdaten)

Parameter

Typ

Pflicht

Beschreibung

<table data-id="d7a949e4-826b-44a0-b248-e53aff27fbea" style="min-width: 100px;"><colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="0c527605-511f-4666-9caf-0188d84d3b6a"><code>firstName</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="1e77502d-f8be-4188-83a3-73be2f18024c">string</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="7527d24b-9e2b-4d49-a860-dd0e73a65716">nein</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="e459b071-8886-4490-a2b2-23724e134aaa">Vorname des Kunden</p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="9b9f5e89-3fa7-42cd-9abb-338d44d242b8"><code>lastName</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="25358719-1d67-413b-ba62-7a26927816a0">string</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="d8735f3c-8ceb-474f-86ac-408eb8d8dcc6"><strong>ja</strong></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="6be064f6-4298-49a8-83ad-e6699f25a8fc">Nachname des Kunden</p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="d093e925-79fd-4bda-97c0-0b42e83f3c58"><code>email</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="e92c5e87-841a-4bc5-8d56-aedef0e9dd44">string</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="5ed7f4ae-be2d-464f-8e76-a69fb6995b9c">nein</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="b1709aa2-b1f3-4e38-82ce-888aeea0082f">E-Mail-Adresse</p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="fd046ad5-1c6b-46cf-a5a7-23edeb621265"><code>phone</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="8addea6d-e839-4ad0-a7c4-46a9a2dd8fe7">string</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="9e820822-e318-41d9-8b00-8ee3db1cc11e">nein</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="9c146b8f-cb9f-4b0e-9259-e646f881872d">Telefonnummer</p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="4a3eac66-3fba-45b1-980e-f944aa97872b"><code>type</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="6bed06ff-178e-4129-bb4f-e2e55ca70d0f">enum</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="5b1d8239-46bf-4c48-a390-21a97430ee18">nein</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="81fd3613-454d-4644-a7c3-abc7c00dd107">Kontakttyp (siehe Enum <code>ContactType</code>)</p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="422375db-65a3-43db-bdfe-79e7f87b94a7"><code>companyName</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="c09a6d4f-9218-4794-bc1e-f8c8112a41c1">string</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="0b26fca8-83c4-41a3-b43a-7f0ca20db9d5">nein</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="b746e580-cd1e-4ff1-bae5-d61dae31fcee">Firmenname (relevant bei <code>type: "COMPANY"</code>)</p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="145b15ef-30e2-4d52-84d5-9fc57b94e77c"><code>representedBy</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="4828a34c-4a7d-400d-bdc3-94913442dd2b">string</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="64b36bab-b8c3-4f27-aca4-2a09b4652229">nein</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="adbc5bbd-99bb-4c2b-aab9-cc3dbee98755">Vertreten durch</p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="2da5afbf-b3c1-467e-91cb-62b7470a0047"><code>title</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="c9ae2cad-1bb0-4c8a-9e12-ce315ff8bf9d">string</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="ca31513d-d973-44c7-91b6-8d4a1231230e">nein</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="becbcaa3-05a6-4d37-9ec2-7505e7524eef">Akademischer Titel, z. B. <code>"Dr."</code>, <code>"Prof."</code>, <code>"Prof. Dr."</code></p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="50a8a978-add3-470d-bbb6-cfa9430ecd30"><code>salutation</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="3036267f-2a20-47f4-9666-6bbc2fd1d5d1">string</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="4ea851a8-4ab8-45a8-83c5-0bce503f456b">nein</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="fdc28f28-d803-4fe2-a51e-35a81319ff9d">Anrede, z. B. <code>"Hallo"</code>, <code>"Sehr geehrte"</code>, <code>"Sehr geehrter"</code>, <code>"Guten Tag"</code></p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="358f2810-fc1e-4884-9939-d7d84f2b4b91"><code>address.street</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="f9d56d9f-338a-4579-901e-06cfc500a46a">string</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="9b02bbe2-dbe4-4bbd-9572-55297d9eefc2">nein</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="9e5e8a9b-f70d-4fb8-a355-3444753842a3">Straße</p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="d7d6dd0a-e856-4fb8-b3cf-302d56313f79"><code>address.houseNumber</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="b6076111-a284-497a-b0a8-6f179ed9c348">string</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="b9c1b99f-27a0-44dd-82e3-5ba6003c8894">nein</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="ca70ec8a-17de-4d04-a533-0e114b052bf9">Hausnummer</p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="4e63af3e-f47f-4b5f-ba77-c42c1f4273c1"><code>address.zip</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="7abbe0c5-7957-41ea-9a1b-f6cac64c016a">string</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="e5a22def-8dc3-4ae1-a03c-373a5af60503">nein</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="da4f4571-7f79-48ef-b3d2-c27829d52bd9">Postleitzahl</p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="14189ac0-cd8a-48b8-9004-2f3470616961"><code>address.city</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="832d305e-8757-4177-8e94-613521f480d3">string</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="cfa00fde-9b4e-4f9f-bf94-192f9685a1c1">nein</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="e031a95a-b12f-4815-949a-27b50590a476">Stadt</p></td></tr></tbody></table>

#### `building` (Gebäudedaten)

Parameter

Typ

Pflicht

Beschreibung

<table data-id="0c83a0e1-f882-4b9e-9f6f-4c909a58993b" style="min-width: 100px;"><colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="22631a9f-2dba-4b0e-98c0-9a9b4697b6fc"><code>address.street</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="41a7e9d5-c859-4b25-a923-26a9e971f241">string</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="56fc9666-35be-44e6-83f9-a0d53c17fb38"><strong>ja</strong></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="558913a6-7db8-4a92-9586-a2b4c58a315b">Straße des Gebäudes</p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="9d4b4c50-2399-4b92-90a5-c67657fabdcc"><code>address.houseNumber</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="2fe7ba36-dc87-4584-b1e2-e1e7d406e095">string</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="89e16254-825b-459d-adc7-569fec1e05b0"><strong>ja</strong></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="667e6e2f-102c-4896-a7b5-6f97d62613ef">Hausnummer des Gebäudes</p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="ac767138-340c-4a81-afc7-7a128cb47fd0"><code>address.zip</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="e887e723-2cb0-4551-9023-afda7c86b489">string</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="fc1ab3d8-0c9b-47a5-95f5-05ecd42f2be3"><strong>ja</strong></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="53343cef-8459-4bd2-8fb7-16619763188e">Postleitzahl des Gebäudes</p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="abd35d66-56a0-4076-af40-498b5b931639"><code>address.city</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="0278cef4-df1b-4dcf-b884-287606fe961a">string</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="d068aa0b-90ba-4df6-af0d-ddd9a3b80649"><strong>ja</strong></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="f64762b3-e724-4ef9-94cf-3c4276dd0876">Stadt des Gebäudes</p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="7a2af898-30a8-4d22-a305-f114424f2eb6"><code>yearOfCompletion</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="98803972-7143-43ec-a300-2daef9babb6f">number</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="2086ad19-dd4c-4f04-a84f-562fb646a317">nein</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="90fd2753-9737-4d99-8ce7-3059f267b86e">Baujahr des Gebäudes (z. B. <code>1990</code>)</p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="574aeebb-6a4a-4405-a565-a027576f6d73"><code>numberOfPartiesInBuilding</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="5d70d66b-cb5d-4e8f-ae57-11b3d7ca0ad9">number</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="b31b2701-2562-4c1a-a1a8-28cf3d9e3d0c">nein</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="4dab67b2-8112-43ce-9168-bc1104b1c894">Anzahl der Wohneinheiten im Gebäude</p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="0695d975-6188-425f-a299-846471ad91ca"><code>numberOfFloors</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="74f31dde-4b45-4b62-99e4-70befb8450bc">number</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="71ef5112-950a-4881-9969-bb1993864896">nein</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="cd399032-a5f0-4dae-b2e7-6c2f06a7412f">Anzahl der Stockwerke</p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="baaa3b09-8587-4af0-9699-89504037e72d"><code>usageType</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="87df4646-3d1e-4371-9ec3-8fc8124f4959">enum</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="b858bb9c-c969-4223-9955-540d133603ba">nein</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="4fd38f09-f6e6-478e-90d2-8e657f1a2f1b">Primärer Gebäudetyp (siehe Enum <code>BuildingType</code>)</p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="7c6c7640-0349-47fd-a17b-289c93c0c646"><code>usageKind</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="fb1bedf6-c78e-4511-a4a0-6d7798bd120e">enum</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="02816f1f-5f03-4976-9e02-30d1954a99ae">nein</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="4038eaa6-5274-411d-a67d-2e4c705e648a">Nutzungsart des Gebäudes (siehe Enum <code>UsageKindType</code>)</p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="8ccf83e5-3b8f-42df-912e-288fb35d03be"><code>latitude</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="f67d13b0-db67-485e-bf58-96fc35c430c6">string</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="1fe3e89c-ab30-4d6f-98ad-65e4eeb5f13c">nein</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="ec799707-9e7e-444f-8ea0-9cf3770178c6">Breitengrad (z. B. <code>"52.520008"</code>)</p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="f34f4970-dbce-438c-a442-16e68ec235bd"><code>longitude</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="a2ead899-e22e-42c7-8e1f-2cd7f5433c63">string</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="4f451795-45a8-4d21-9932-1962bba637df">nein</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="85a0136b-e6bd-4d1e-adde-78d3adb85175">Längengrad (z. B. <code>"13.404954"</code>)</p></td></tr></tbody></table>

### Enum-Werte

#### Enum `ProjectState` (Feld: `state`)

Wert

Bedeutung

Frontend-Label (sichtbar)

<table data-id="37f5cbd0-5e1c-48dc-a5b1-9fcc46dd5c12" style="min-width: 75px;"><colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="5c122a3f-eea8-429e-8b08-3b5345ce49a7"><code>ACTIVE</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="b8a08c0f-1e7e-485c-9c02-af31d261336f">Aktives Projekt (Standard)</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="07f20622-392a-429d-a56a-a10d1d5e8201"><code>Aktiv (wartend und in Arbeit)</code></p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="0be91654-67c9-4649-889f-6660b833818b"><code>ARCHIVED</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="fd31d70d-e3ab-487a-9230-92df9b78e471">Archiviert</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="87a907d8-4685-4abf-9f3b-f993bc36b7bb"><code>Abgeschlossen</code> (teilweise auch <code>Archiviert</code> je nach Ansicht)</p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="d7b17ba0-c15d-4dd2-af79-57fe1fdfaa1d"><code>CANCELED</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="ddf50933-fc49-47f1-8b07-0ba24b7d7f8a">Storniert</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="3b585c2b-76a0-4b5b-8201-efee53c34278"><code>Abgebrochen</code></p></td></tr></tbody></table>

#### Enum `ContactType` (Feld: `client.type`)

Wert

Bedeutung

Frontend-Label (sichtbar)

<table data-id="4f13be12-9719-4922-90d4-522dd6bc37c4" style="min-width: 75px;"><colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="22c154d8-9a4a-4cdc-a36b-e082837d229c"><code>PERSON</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="8b3277a3-48bb-4d6f-a5b1-344b5bb68fa2">Natürliche Person</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="e796b728-691c-46bc-94b6-c97b8f4d261c"><code>Privatperson</code></p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="42607d2e-8c69-4829-8064-219d1c7b5138"><code>COMPANY</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="937b71ac-0178-45fc-a448-fd8b611b82ef">Unternehmen / juristische Person</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="f081a3b0-afd5-4f07-ae0a-77560092aabb"><code>Unternehmen</code></p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="9f6b327c-eda6-4e18-86a0-1c60cca701bd"><code>OBJECT</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="708d5efe-a15e-44ff-9232-664344310de0">Objekt</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="574a574a-b983-463b-bb39-6c900fbe5300"><code>Eigentümer</code> (nur sichtbar, wenn der Kontakt diesen Typ bereits aus der Hottgenroth-Synchronisation gesetzt hat; im Frontend nicht manuell auswählbar)</p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="6d591e1f-1c89-4c6b-8359-05613a5014a4"><code>WEG</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="0617f8e4-e898-4c5b-bced-e5dce79e7819">Wohnungseigentümergemeinschaft</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="8d02fe58-43bd-42b9-8e3f-3022deac7578"><code>WEG</code></p></td></tr></tbody></table>

#### Enum `BuildingType` (Feld: `building.usageType`)

Wert

Bedeutung

Frontend-Label (sichtbar)

<table data-id="89be67ef-563b-4af2-b0de-5c2e630a4ae1" style="min-width: 75px;"><colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="88d047e4-4dd0-41b0-9058-5d7db0de7b76"><code>RESIDENTIAL</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="804377ca-33f4-4b6c-93d2-85931f2d52cd">Wohngebäude</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="1d048d6f-2feb-4ec4-92a5-8130f3a323c1"><code>Wohngebäude</code></p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="33a7302c-3f1a-4164-aa51-f26d0fdbae6f"><code>NONRESIDENTIAL</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="23566890-b35f-4a54-9e22-1608c6383fc0">Nichtwohngebäude</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="af8a1efb-6cb8-4668-ad1c-152869034a95"><code>Nicht-Wohngebäude</code></p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="19d3b684-13d9-40ec-bb83-26878fc41471"><code>MIXED</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="be050b2e-fb42-4645-919e-5f998698a7c9">Mischgebäude (Wohn- und Nichtwohnnutzung)</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="ececdd85-640d-4029-8394-bfc8b9df4367"><code>Mischgebäude</code></p></td></tr></tbody></table>

#### Enum `UsageKindType` (Feld: `building.usageKind`)

Wert

Bedeutung

Frontend-Label (sichtbar)

<table data-id="4dd36978-54b2-4158-a56e-d72127ab0057" style="min-width: 75px;"><colgroup><col style="min-width: 25px;"><col style="min-width: 25px;"><col style="min-width: 25px;"></colgroup><tbody><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="31cbe637-722f-4961-9e95-4a8508b8ad17"><code>LEASED_BUILDING</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="3bc944c8-3030-4137-9653-5afdfd20b4ab">Vermietung</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="be6629df-be52-4019-a11d-0ffb26f2d21c"><code>Vermietung (ausschließlich)</code></p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="cb3e595e-04d2-42d8-b419-9f9f3cdad744"><code>OWNER_OCCUPIED_BUILDING</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="7e9ce86f-0a0a-48e5-b4b0-55c38bb98c32">Eigennutzung</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="c202f517-289d-42a8-a084-5841a42bed28"><code>Eigennutzung (ausschließlich)</code></p></td></tr><tr><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="28cf4252-6988-4a64-ab04-66206b7240d8"><code>MIXED_SELFUSE_LEASED</code></p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="0e3560ef-f21b-44ba-85db-c5484a730400">Gemischte Nutzung (Eigennutzung und Vermietung)</p></td><td colspan="1" rowspan="1" style="box-sizing: border-box; border-width: 0px; border-style: solid;"><p data-id="464dec18-7243-420b-90af-eaff7fddc66e"><code>Eigennutzung und Vermietung</code></p></td></tr></tbody></table>

### Pflichtfelder

Die folgenden Felder sind zwingend erforderlich:

-   `client.lastName`
    
-   `building.address.street`
    
-   `building.address.houseNumber`
    
-   `building.address.zip`
    
-   `building.address.city`
    

Wenn `templateId` angegeben wird, muss es im UUID-Format vorliegen (z. B. `123e4567-e89b-12d3-a456-426614174000`).

### Beispiel-Request-Body

```json
{
  "data": {
    "client": {
      "firstName": "Max",
      "lastName": "Mustermann",
      "email": "max@beispiel.de",
      "phone": "+49 123 456789",
      "type": "PERSON",
      "salutation": "Sehr geehrter"
    },
    "building": {
      "address": {
        "street": "Musterstraße",
        "houseNumber": "42",
        "zip": "12345",
        "city": "Berlin"
      },
      "yearOfCompletion": 1990,
      "numberOfFloors": 3,
      "usageType": "RESIDENTIAL",
      "usageKind": "OWNER_OCCUPIED_BUILDING",
      "latitude": "52.520008",
      "longitude": "13.404954"
    },
    "reference": "WEBSITE",
    "note": "Importiert via Website",
    "state": "ACTIVE",
    "templateId": "123e4567-e89b-12d3-a456-426614174000"
  }
}
```

## Response

### Erfolgreiche Antwort (HTTP 200)

```json
{
  "message": "Project added successfully"
}
```

### Fehlerhafte Authentifizierung (HTTP 401)

```json
{
  "error": "Unauthorized"
}
```

### Fehlende oder ungültige Daten (HTTP 400)

```json
{
  "error": {
    "message": "Missing or invalid mandatory fields: client.lastName, building.address.street, ..."
  }
}
```

### Fehler beim Import (HTTP 500)

```json
{
  "error": "Reference: WEBSITE, Error: [Fehlermeldung]"
}
```

## Technische Details

### Funktionsablauf

1.  **Token-Validierung**
    
    -   Das JWT-Token wird aus den Query-Parametern extrahiert
        
    -   Die Funktion `decodeJwt()` verifiziert das Token mit dem `APP_SECRET`
        
    -   Bei ungültigem Token wird ein 401-Fehler zurückgegeben
        
2.  **Projekttyp-Bestimmung**
    
    -   Die Funktion `determineProjectType()` bestimmt den Projekttyp nach folgender Priorität:
        
        1.  Explizit angegebener `data.type`
            
        2.  Typ aus der Vorlage (Template), falls `templateId` angegeben
            
        3.  Standardwert: `Anfrage/Angebot`
            
3.  **Validierung der Pflichtfelder**
    
    -   Alle Pflichtfelder werden überprüft
        
    -   Die `templateId` wird auf gültiges UUID-Format geprüft
        
    -   Bei fehlenden Feldern wird eine detaillierte Fehlermeldung mit allen fehlenden Feldern zurückgegeben
        
4.  **Projekt-Import**
    
    -   Die Daten werden in das interne Format transformiert
        
    -   Die Funktion `importProjects()` erstellt das Projekt, den Kontakt und das Gebäude in der Datenbank
        
    -   Wenn eine `templateId` angegeben ist, werden die Projektstruktur und Einstellungen von der Vorlage kopiert
        
5.  **Fehlerbehandlung und E-Mail-Benachrichtigung**
    
    -   Bei Fehlern während des Imports wird eine E-Mail an den zugehörigen Benutzer gesendet
        
    -   Die E-Mail enthält:
        
        -   Detaillierte Fehlermeldung
            
        -   Die übermittelten Projektdaten (zur Fehlerbehebung)
            
        -   Hinweis auf den Support-Chat
            
    -   Die Fehlerbenachrichtigung wird in die Warteschlange für transaktionale E-Mails eingereiht
        

## Beispiel-Aufruf

```bash
curl -X POST "https://eba-api.azurewebsites.net/addProject?token=eyJhbGc..." \
  -H "Content-Type: application/json" \
  -d '{
    "data": {
      "client": {
        "firstName": "Max",
        "lastName": "Mustermann",
        "email": "max@beispiel.de",
        "phone": "+49 123 456789",
        "type": "PERSON",
        "salutation": "Sehr geehrter"
      },
      "building": {
        "address": {
          "street": "Musterstraße",
          "houseNumber": "42",
          "zip": "12345",
          "city": "Berlin"
        },
        "yearOfCompletion": 1990,
        "numberOfFloors": 3,
        "usageType": "RESIDENTIAL",
        "usageKind": "OWNER_OCCUPIED_BUILDING",
        "latitude": "52.520008",
        "longitude": "13.404954"
      },
      "note": "Import von Website-Formular",
      "reference": "WEB-2024-001",
      "state": "ACTIVE"
    }
  }'
```

## Fehlerbehandlung

### Häufige Fehlerszenarien

1.  **Ungültiges Token**: Überprüfen Sie, ob das Token korrekt generiert wurde und nicht abgelaufen ist
    
2.  **Fehlende Pflichtfelder**: Stellen Sie sicher, dass alle erforderlichen Felder vorhanden sind
    
3.  **Ungültiges UUID-Format**: Die `templateId` muss im korrekten UUID-Format vorliegen
    
4.  **Template nicht gefunden**: Die angegebene `templateId` existiert nicht in der Organisation
    
5.  **Datenbankfehler**: Prüfen Sie die Logs für Details zu Datenbankproblemen
    

### E-Mail-Benachrichtigung bei Fehlern

Bei Importfehlern wird automatisch eine E-Mail an den Benutzer gesendet, der mit dem Token verknüpft ist. Diese E-Mail enthält:

-   Eine benutzerfreundliche Fehlerbeschreibung
    
-   Die vollständigen übermittelten Daten zur Fehleranalyse
    
-   Kontaktinformationen für den Support
    

## Integration

Diese Funktion ist ideal für:

-   Website-Formulare zur Projekterfassung
    
-   Partner-Systeme, die Projekte automatisch anlegen möchten
    
-   Externe Datenimporte von CRM- oder ERP-Systemen
    
-   Mobile Apps für die Projekterfassung
    

## Wartung und Support

Bei Fragen zur Integration oder Problemen mit der API-Funktion wenden Sie sich bitte an:

-   **Technischer Support**: Über den Chat
    
-   **Token-Freischaltung**: Kann über den Support aktiviert werden
