--- title: "Trigger an optimization" slug: "datenaustausch-connect-api-uc-zuschnitt-anstossen" updated: 2026-12-02T10:11:04Z published: 2026-12-02T10:11:04Z canonical: "docs.homag.cloud/datenaustausch-connect-api-uc-zuschnitt-anstossen" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.homag.cloud/llms.txt > Use this file to discover all available pages before exploring further. # Trigger an optimization **For:** Integrators · Partners This page describes steps 1 to 3 of the [cutting optimization workflow](/docs/de/datenaustausch-connect-api-uc-zuschnitt): determine configuration, create an optimization, and monitor progress. The examples show the SDK call and the corresponding REST call with its response. For the C# examples, assume you have initialized a client: ```csharp using HomagConnect.IntelliDivide.Client; using HomagConnect.IntelliDivide.Contracts; using HomagConnect.IntelliDivide.Contracts.Common; using HomagConnect.IntelliDivide.Contracts.Request; var intelliDivide = new IntelliDivideClient(subscriptionId, authorizationKey); ``` ## 1. Determine the configuration Before creating an optimization, query which machines and parameter sets are available in the subscription. This lets your integration build selection lists and default values dynamically instead of hard-coding values that might change for the customer. These fields are described by the [OptimizationMachine](/docs/en/datenaustausch-connect-api-ct-intellidivide-common-optimizationmachine) and [OptimizationParameter](/docs/en/datenaustausch-connect-api-ct-intellidivide-common-optimizationparameter) contracts. **C#** ```csharp // Check whether the configured machine exists const string machineName = "productionAssist Cutting"; var machine = await intelliDivide.GetMachine(machineName); if (machine == null) {    throw new InvalidOperationException($"Die Maschine '{machineName}' wurde nicht gefunden."); } // Check whether the configured parameter set exists const string parameterSetName = "Boards only"; var parameters = await intelliDivide.GetParameters(OptimizationType.Cutting); var parameterSet = parameters?.FirstOrDefault(p => p.Name == parameterSetName); if (parameterSet == null) {    throw new InvalidOperationException($"Der Parametersatz '{parameterSetName}' wurde nicht gefunden."); } ``` **REST** ```http # Find the machine by name GET /api/intelliDivide/machines?machineName=productionAssist%20Cutting 200 OK Content-Type: application/json [  {    "name": "productionAssist Cutting",    "optimizationType": "Cutting"  } ] # Get parameter sets for cutting GET /api/intelliDivide/Cutting/parameters 200 OK Content-Type: application/json [  {    "name": "Boards only",    "optimizationType": "Cutting"  } ] ``` **Tip:** The material codes known to intelliDivide are returned by `GetBoardTypes(take, skip)` or `GET /api/intelliDivide/materials/boards?take=…&skip=…`. Use this to validate your codes before submitting parts. ## 2. Create an optimization Submit the part list along with the machine and parameter set. This creates an optimization in the `New` state (see [OptimizationStatus](/docs/en/datenaustausch-connect-api-ct-intellidivide-optimizationstatus)). The body follows the [OptimizationRequest](/docs/en/datenaustausch-connect-api-ct-intellidivide-request-optimizationrequest) contract; each part follows the [OptimizationRequestPart](/docs/en/datenaustausch-connect-api-ct-intellidivide-request-optimizationrequestpart) contract. ### Create an optimization **C#** ```csharp var request = new OptimizationRequest {    Name = "Auftrag 4711 – Korpusteile",    Machine = machineName,    Parameters = parameterSetName }; request.Parts.Add(new OptimizationRequestPart {    Description = "Seitenwand",    MaterialCode = "P2_White_19.0",    Length = 720,    Width = 560,    Quantity = 10 }); request.Parts.Add(new OptimizationRequestPart {    Description = "Fachboden",    MaterialCode = "P2_White_19.0",    Length = 564,    Width = 540,    Quantity = 20 }); var response = await intelliDivide.RequestOptimization(request); ``` **REST** ```http POST /api/intelliDivide/optimizations Content-Type: multipart/form-data optimizationRequest: {  "name": "Auftrag 4711 – Korpusteile",  "machine": "productionAssist Cutting",  "parameters": "Boards only",  "parts": [    { "description": "Seitenwand", "materialCode": "P2_White_19.0", "length": 720, "width": 560, "quantity": 10 },    { "description": "Fachboden",  "materialCode": "P2_White_19.0", "length": 564, "width": 540, "quantity": 20 }  ] } 200 OK Content-Type: application/json {  "optimizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",  "optimizationStatus": "New",  "link": "https://intelliDivide.homag.cloud/optimizations/a1b2c3d4-e5f6-7890-abcd-ef1234567890",  "validationResults": [] } ``` ### Typical values and limits | Field | Required | Limits | Note | | --- | --- | --- | --- | | `name` | yes | 3–100 characters | Displayed in intelliDivide, for example an order or quote number | | `machine` | yes | 3–100 characters | Name from step 1 | | `parameters` | yes | 3–100 characters | Name of the parameter set from step 1 | | `action` | yes | `ImportOnly` (default), `Optimize`, `Send` | See below | | `parts[].description` | yes | 1–100 characters | Part description | | `parts[].materialCode` | yes | 1–50 characters | Must exist in materialManager | | `parts[].length`, `width` | – | 0.1–9999.9 mm | Finished dimensions | | `parts[].quantity` | yes | 0–10000 | Default 1 | | `parts[].quantityPlus` | – | 0–10000 | Additional quantity if there is space on the board | | `parts[].grain` | yes | `None` (default), among others | Grain direction | | `parts[].edgeFront` … `edgeRight` | – | 1–50 characters | Edgeband codes | All fields and enums: [OptimizationRequest](/docs/en/datenaustausch-connect-api-ct-intellidivide-request-optimizationrequest) and [Data model](/docs/en/datenaustausch-connect-api-contracts). **Shortcut using `action`:** With `Optimize`, intelliDivide starts optimization immediately after creation. With `Send`, the solution is also sent to the machine. To choose a solution yourself in step 4, keep the default `ImportOnly` and start the optimization yourself. ### Check validation Check the entries in `validationResults` ([OptimizationValidationResult](/docs/en/datenaustausch-connect-api-ct-intellidivide-request-optimizationvalidationresult)) before proceeding. A non-empty array means the request needs to be corrected. **C#** ```csharp if (response.ValidationResults != null && response.ValidationResults.Any()) {    throw new ValidationException(response.ValidationResults[0].ErrorMessage); } ``` **REST** ```http # Validation results are part of the "Create an optimization" response. {  "optimizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",  "optimizationStatus": "New",  "validationResults": [    {      "memberNames": ["Parts[0].MaterialCode"],      "errorMessage": "The material code 'UNKNOWN' is not available."    }  ] } # An empty "validationResults" array means the request is valid. ``` ## 3. Monitor progress The optimization runs asynchronously. Start it and query the status until it reaches `Optimized` after `Started`, or until it reaches a cancellation or error state. Account for all state transitions and set a time limit for unusually long runs. **C#** ```csharp // Start the optimization await intelliDivide.StartOptimization(response.OptimizationId); // Wait for the optimization to complete (polls the status periodically) var optimization = await intelliDivide.WaitForCompletion(    response.OptimizationId, TimeSpan.FromMinutes(5)); ``` **REST** ```http # Start the optimization POST /api/intelliDivide/optimizations/a1b2c3d4-e5f6-7890-abcd-ef1234567890/optimize 200 OK # Query the status until it reaches "Optimized" (or "Faulted" / "Canceled") GET /api/intelliDivide/optimizations/a1b2c3d4-e5f6-7890-abcd-ef1234567890/state 200 OK Content-Type: application/json "Optimized" ``` | Status | Meaning | Integration response | | --- | --- | --- | | `New` | Created, not started yet | Start it | | `Queued`, `Started` | Queued or being optimized | Continue polling, for example every 5–10 seconds | | `Optimized` | Solutions are available | Continue with [step 4](/docs/en/datenaustausch-connect-api-uc-zuschnitt-ergebnisse) | | `Faulted` | Optimization failed | Check in intelliDivide and correct the request | | `Canceled` | Canceled | Stop polling | | `Transferring`, `Transferred` | Solution is being or has been transferred to the machine | Completed | | `Archived` | Archived | Read only | ## Rules and pitfalls - **Do not hard-code names.** Always determine machines and parameter sets in step 1 and keep them configurable. - **Validate material codes in advance.** Unknown codes are only reported in `validationResults`. Maintain material types in materialManager ([Board management](/docs/de/datenaustausch-connect-api-uc-platten)). - **Limit polling frequency.** Polling too often can result in `429` ([Error handling, limits, paging](/docs/de/datenaustausch-connect-api-konzept-fehler)). - **Reserve material.** To make the requirement known to the ERP system, see [Material requirements and reservation](/docs/de/datenaustausch-connect-api-uc-bedarf). ## Endpoints | Step | Method | Endpoint | SDK | | --- | --- | --- | --- | | 1 | GET | `/api/intelliDivide/machines` | `GetMachines()`, `GetMachine(name)` | | 1 | GET | `/api/intelliDivide/{optimizationType}/parameters` | `GetParameters(type)` | | 1 | GET | `/api/intelliDivide/materials/boards` · `/edgebands` | `GetBoardTypes()`, `GetEdgebandTypes()` | | 2 | POST | `/api/intelliDivide/optimizations` | `RequestOptimization(request)` | | 2 | POST | `/api/intelliDivide/optimizations/RequestUsingTemplate` | `RequestOptimization(templateRequest, files)` | | 3 | POST | `/api/intelliDivide/optimizations/{optimizationId}/optimize` | `StartOptimization(id)` | | 3 | GET | `/api/intelliDivide/optimizations/{optimizationId}/state` | `GetOptimizationStatus(id)`, `WaitForCompletion(id, max)` | Complete signatures: [Endpoints](/docs/de/datenaustausch-connect-api-endpunkte).