Skip to main content
PUT
/
deliveries
/
{id}
/
components
curl --request PUT \
  --url https://api.comstruct.com/v1/deliveries/{id}/components \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "groups": [
    {
      "component_ids": [
        42,
        17
      ],
      "distribution": {
        "Beton C30/37": 5.5,
        "Betonpumpe": 1
      }
    },
    {
      "component_ids": [
        99
      ],
      "distribution": {
        "Beton C25/30": 3
      }
    }
  ]
}
'
{
  "groups": [
    {
      "group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "distribution": {
        "Beton C30/37": 5.5
      },
      "components": [
        {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "component_id": 123,
          "component_title": "<string>",
          "component_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "component_type_title": "<string>"
        }
      ]
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://developer.comstruct.com/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Replaces all component assignments for the delivery with the provided groups — equivalent to saving the component overview in the web app. Each group typically combines several project components (often one per component type) that share the same quantity split across delivery line items.

Permissions

ScopeTenant type
deliveries:patchCustomer only (CUSTOMER_ONLY)
The API key must be linked to a customer. Supplier API keys cannot use this endpoint.

Request body

FieldTypeDescription
groupsarrayList of groups; [] clears all assignments

Per group (groups[])

FieldTypeDescription
component_idsnumber[]Project component IDs; at least one per group, unique within the group
distributionobjectMap from delivery line item title (title on the line item) to a finite non-negative quantity

Validation and behavior

  • Every component_id must belong to the delivery’s project.
  • Distribution values must be finite, non-negative numbers.
  • Groups whose distribution is empty or contains only zeros are skipped (same as the web app).
  • The response matches GET /deliveries/{id}/components (including server-assigned group_id and enriched component metadata).

Response codes

CodeDescription
200Components saved; body same shape as GET
400Invalid body or components not on the delivery’s project
403Forbidden — delivery belongs to another customer
404Delivery not found

Authorizations

X-API-Key
string
header
required

API-Schlüssel zur Authentifizierung. Kontaktieren Sie Ihren Customer Success Manager, um einen API-Schlüssel zu erhalten.

Jeder Endpunkt erfordert spezifische Berechtigungen (Scopes); die erforderlichen Scopes werden pro Endpunkt angezeigt.

Path Parameters

id
string<uuid>
required

Lieferungs-ID (UUID)

Body

application/json
groups
object[]
required

Liste der Komponentengruppen; leeres Array entfernt alle Zuordnungen

Response

Komponentengruppen nach der Aktualisierung (gleiche Struktur wie GET)

groups
object[]
required