curl --request POST \
--url https://api.comstruct.com/v1/project-regions \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
[
{
"title": "North Region",
"number": "REG-NORTH"
}
]
'[
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "North Region",
"number": "REG-NORTH",
"description": "Nordregion mit Lagern A und B",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"legal_entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]Create or update project region
Erforderliche Berechtigungen: project_regions:write
Erstellt oder aktualisiert eine oder mehrere Projektregionen für den aktuellen Mandanten.
Verwendet das number-Feld zum Abgleich bestehender Projektregionen für Aktualisierungen.
titlewird bei bestehenden Projektregionen immer überschrieben.descriptionist optional: Weglassen behält die gespeicherte Beschreibung, eine Zeichenkette ersetzt sie undnulllöscht sie.legal_entity_idundparent_idsind optional und werden bei bestehenden Projektregionen nur aktualisiert, wenn jeder Eintrag der Anfrage das jeweilige Feld enthält. Ein Wert ersetzt die Zuordnung,nullentfernt sie.legal_entity_idmuss ein Buchungskreis des Mandanten sein und erfordert die Funktion „Buchungskreise mit Regionen verknüpfen“. Ist sie nicht aktiviert, wird die Anfrage mit403 Forbiddenabgelehnt.parent_idmuss eine bestehende Projektregion des Mandanten sein. Unbekannte IDs und Zuordnungen, die einen Zyklus in der Hierarchie erzeugen würden, werden mit400 Bad Requestabgelehnt.- Enthält die Anfrage dieselbe
numbermehrfach, wird nur der erste Eintrag übernommen. - Felder, die nicht im Schema definiert sind, werden mit
400 Bad Requestabgelehnt.
curl --request POST \
--url https://api.comstruct.com/v1/project-regions \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
[
{
"title": "North Region",
"number": "REG-NORTH"
}
]
'[
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "North Region",
"number": "REG-NORTH",
"description": "Nordregion mit Lagern A und B",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"legal_entity_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
]Overview
This endpoint creates new project regions or updates existing ones. Project regions help organize projects by geographical or organizational boundaries. Existing project regions are matched bynumber.
Region Description Field
Thedescription field is an optional free-text field that provides additional context about the project region. It’s useful for:
- Documenting the geographical coverage (e.g., ‘Northern operations covering warehouses A and B’)
- Adding organizational notes (e.g., ‘Regional office Hamburg, managed by Team North’)
- Recording special handling instructions for the region
number again with the new description. Omitting description keeps the stored value; null clears it.Example: Creating a Region with Description
[
{
"title": "North",
"number": "REG-001",
"description": "Northern operations covering warehouses A and B"
}
]
Example: Creating a Region without Description
[
{
"title": "South",
"number": "REG-002"
}
]
Example: Clearing a Description
[
{
"title": "North",
"number": "REG-001",
"description": null
}
]
Parent Region and Company Code
Useparent_id to place a project region under an existing parent project region of the tenant and build a hierarchy. Use legal_entity_id to link the project region to a company code of the tenant (see GET /legal-entities).
- Both fields are optional;
nullclears the link. For existing project regions a field is only updated when every entry in the request contains it. If at least one entry omits it, the stored values of all entries stay unchanged. - The IDs must belong to the tenant. Unknown IDs are rejected with
400 Bad Request. - A parent that would create a cycle in the hierarchy is rejected with
400 Bad Request.
legal_entity_id requires the “link company codes to regions” feature. If it is not enabled for your tenant, the request is rejected with 403 Forbidden.Example: Region with Parent Region and Company Code
[
{
"title": "Munich",
"number": "REG-MUC",
"parent_id": "22222222-2222-4222-8222-222222222222",
"legal_entity_id": "11111111-1111-4111-8111-111111111111"
}
]
Authorizations
Body
Die ID eines Buchungskreises des Mandanten (siehe GET /legal-entities), der der Projektregion zugeordnet wird. Erfordert die Funktion „Buchungskreise mit Regionen verknüpfen“; andernfalls wird die Anfrage mit 403 Forbidden abgelehnt. null entfernt die Zuordnung. Wird bei bestehenden Projektregionen nur aktualisiert, wenn alle Einträge der Anfrage das Feld enthalten.
"11111111-1111-4111-8111-111111111111"
Die ID einer bestehenden übergeordneten Projektregion des Mandanten. null entfernt die Zuordnung. Wird bei bestehenden Projektregionen nur aktualisiert, wenn alle Einträge der Anfrage das Feld enthalten. Zyklen in der Hierarchie werden mit 400 Bad Request abgelehnt.
"22222222-2222-4222-8222-222222222222"
Response
Projektregionen erfolgreich erstellt oder aktualisiert