> ## Documentation Index > Fetch the complete documentation index at: https://support.keypro.fi/llms.txt > Use this file to discover all available pages before exploring further. # Apply accepted CCTV inspection comparison fields in a batch > Applies caller-selected comparison fields to up to 1,000 linked sewer ducts. Each inspection is processed independently. Entries without selected fields, a confirmed sewer-duct link, or effective field changes are skipped. Per-record validation and permission errors are reported without aborting the remaining entries. Observations are recorded as `updated` per written duct field, in the same transaction as the write: an observation is recorded when the duct keeps at least one value it wrote. When two inspections of one duct write the same field, only the later one's value survives, so only that observation is recorded. When one writes the profile and another the duct type, the duct keeps both, so both are recorded. ## OpenAPI ````json POST /tv-inspection/apply-duct-diff-batch/ { "openapi": "3.0.4", "info": { "title": "Keyduct REST API", "termsOfService": "https://www.keypro.fi/en/terms-of-service", "contact": { "name": "Keypro Oy", "url": "https://keypro.fi/", "email": "keypro@keypro.fi" }, "license": { "name": "Copyright (C) Keypro Oy. All rights reserved.", "url": "https://www.keypro.fi/" }, "version": "2.0.0" }, "servers": [ { "url": "/api/v2" } ], "tags": [ { "name": "Task", "description": "Task related operations." }, { "name": "Subregion", "description": "Subregion related operations." }, { "name": "SAttribute", "description": "SAttribute related operations." }, { "name": "Fault", "description": "Fault related operations." }, { "name": "Maintenance history", "description": "Maintenance history related operations." }, { "name": "Deflection", "description": "Deflection related operations." }, { "name": "Fault Component", "description": "Fault Component related operations." }, { "name": "Task Comment", "description": "Task comment related operations." }, { "name": "FaultComponentFault", "description": "FaultComponentFault related operations." }, { "name": "Collections", "description": "Collection related operations." }, { "name": "Contact Person", "description": "ContactPerson related operations" }, { "name": "Contact Person Connection", "description": "ContactPersonConnection related operations" }, { "name": "Plan", "description": "Plan related operations." }, { "name": "FreeArea", "description": "FreeArea related operations." }, { "name": "Address", "description": "Building address related operations." }, { "name": "Apartment", "description": "Building apartments related operations." }, { "name": "Customer", "description": "Customer data related operations." }, { "name": "Customer Contract", "description": "Customer contract related operations." }, { "name": "Extra Attribute", "description": "Extra attributes related operations." }, { "name": "Extra Value", "description": "Extra attribute values related operations." }, { "name": "Consumer Point", "description": "Consumer point related operations." }, { "name": "Consumer Point Linked Address", "description": "Consumer point address link related operations." }, { "name": "Flow Meter", "description": "Flow Meter related operations." }, { "name": "Text Constant", "description": "Text Constant related operations." }, { "name": "Sn Constant", "description": "Sn Constant related operations." }, { "name": "Gas Meter", "description": "Gas Meter related operations." }, { "name": "Junction", "description": "Junction related operations." }, { "name": "Junction Connection", "description": "Junction Connection related operations." }, { "name": "External Document", "description": "External documents related operations." }, { "name": "Water Duct Renovation", "description": "Water duct renovation related operations." }, { "name": "Sewer Duct Renovation", "description": "Sewer duct renovation related operations." }, { "name": "Water Duct", "description": "Water duct related operations." }, { "name": "Water Other Node", "description": "Water other node related operations." }, { "name": "Water Hydrant", "description": "Water hydrant related operations." }, { "name": "Water Branch", "description": "Water branch related operations." }, { "name": "Water Measuring Point", "description": "Water measuring point related operations." }, { "name": "Fire Water Station", "description": "Fire water station related operations." }, { "name": "Water Fireplug", "description": "Water fireplug related operations." }, { "name": "Sewer Duct", "description": "Sewer duct related operations." }, { "name": "Flow Meter Reading", "description": "Flow Meter Reading related operations." }, { "name": "Gas Meter Reading", "description": "Gas meter reading related operations." }, { "name": "Gas Cable", "description": "Gas cable related operations." }, { "name": "Gas Other Node", "description": "Gas other node related operations." }, { "name": "Gas Valve", "description": "Gas valve related operations." }, { "name": "Water Node", "description": "Water node related operations." }, { "name": "Consumer Point Property", "description": "Consumer point property related operations." }, { "name": "Dh Manhole", "description": "Dh manhole related operations." }, { "name": "Dh Manhole Link Connection", "description": "Dh Manhole Link Connection related operations." }, { "name": "Dh Cable", "description": "Dh cable related operations." }, { "name": "Error Report", "description": "Error report related operations." }, { "name": "Failure Report", "description": "Failure report related operations." }, { "name": "DCCTV Comparison", "description": "DCCTV comparison (nearest object lookup + manual pick) related operations." }, { "name": "TV Inspection", "description": "CCTV TV inspection related operations." }, { "name": "Manhole Inspection", "description": "Manhole inspection related operations." }, { "name": "Dh Duct", "description": "Dh duct related operations." }, { "name": "Dh Conduit", "description": "Dh conduit related operations." }, { "name": "Dh Division", "description": "Dh division related operations." }, { "name": "Dh Valve", "description": "Dh valve related operations." }, { "name": "Consumer Point User", "description": "Consumer Point User related operations." }, { "name": "Consumer Point Real Estate", "description": "Consumer point real estate related operations." }, { "name": "Consumer Point User Email", "description": "Consumer point user email related operations." }, { "name": "Water Pumping Station", "description": "Water pumping station related operations." }, { "name": "Dh Meter Reading", "description": "Dh Meter Reading related operations." }, { "name": "Consumer Point Connection", "description": "Consumer point connection related operations." }, { "name": "Modeling Data", "description": "Modeling data related operations.\n\n*NOTE:* Contrary to what is described in chapter 1.5, the base path for all of these operations is `/keyaqua_modeling`\n" }, { "name": "Gas Manhole", "description": "Gas manhole related operations." }, { "name": "KeyDh Observation", "description": "KeyDh Observation related operations." }, { "name": "KeyDh Supply Interruption", "description": "KeyDh Supply Interruption related operations." }, { "name": "KeyDh Supply Interruption Connection", "description": "KeyDh Supply Interruption Connection related operations." }, { "name": "Keydh Node", "description": "Keydh Node related operations." }, { "name": "Keygas Duct", "description": "Keygas Duct related operations." }, { "name": "Real Estate", "description": "Real Estate related operations." }, { "name": "Keydh Connection", "description": "Keydh Connection related operations." }, { "name": "Water Tank", "description": "Water Tank related operations." }, { "name": "Water Valve", "description": "Water Valve related operations." }, { "name": "Point", "description": "Point related operations." }, { "name": "Sn Modeling", "description": "Sn Modeling related operations." }, { "name": "Sewer Manholes v2", "description": "Sewer Manholes v2 related operations." }, { "name": "Sewer Ducts", "description": "Sewer Ducts related operations." }, { "name": "Sewer Valves", "description": "Sewer Valves related operations." }, { "name": "Sewer Pumping Stations", "description": "Sewer Pumping Stations related operations." }, { "name": "Sewer Branches", "description": "Sewer Branches related operations." }, { "name": "Sewer Measuring Poins", "description": "Sewer Measuring Poins related operations." }, { "name": "Sewer Other Nodes", "description": "Sewer Other Nodes related operations." }, { "name": "Keydh Conduit Link", "description": "Keydh Conduit Link related operations." }, { "name": "Duct Condition Detail", "description": "Duct condition detail related operations." }, { "name": "KeyDh Conduit Error", "description": "KeyDh Conduit Error related operations." }, { "name": "AquaObjectType", "description": "AquaObjectType related operations." }, { "name": "AquaMeasuringPointTypes", "description": "AquaMeasuringPointTypes related operations." }, { "name": "AquaPumpType", "description": "AquaPumpType related operations." }, { "name": "AquaBranchType", "description": "AquaBranchType related operations." }, { "name": "AquaValveType", "description": "AquaValveType related operations." }, { "name": "AquaManholeType", "description": "AquaManholeType related operations." }, { "name": "AquaDuctType", "description": "AquaDuctType related operations." }, { "name": "SnDuctType", "description": "SnDuctType related operations." }, { "name": "SnManholeType", "description": "SnManholeType related operations." }, { "name": "SnLidType", "description": "SnLidType related operations." }, { "name": "Sewer Nodes", "description": "Sewer Node related operations." }, { "name": "Sn Control", "description": "Sn Control related operations." }, { "name": "KeyDh Shell Type", "description": "KeyDh Shell Type related operations." }, { "name": "Sewer Branch Type", "description": "Sewer Branch Type related operations." }, { "name": "Sewer Valve Type", "description": "Sewer Valve Type related operations." } ], "paths": { "/tv-inspection/apply-duct-diff-batch/": { "post": { "tags": [ "TV Inspection" ], "summary": "Apply accepted CCTV inspection comparison fields in a batch", "description": "Applies caller-selected comparison fields to up to 1,000 linked sewer ducts.\nEach inspection is processed independently. Entries without selected fields,\na confirmed sewer-duct link, or effective field changes are skipped.\nPer-record validation and permission errors are reported without aborting the\nremaining entries.\n\nObservations are recorded as `updated` per written duct field, in the same\ntransaction as the write: an observation is recorded when the duct keeps at\nleast one value it wrote. When two inspections of one duct write the same\nfield, only the later one's value survives, so only that observation is\nrecorded. When one writes the profile and another the duct type, the duct\nkeeps both, so both are recorded.\n", "operationId": "applyTvInspectionDuctDiffBatch", "requestBody": { "content": { "application/json": { "schema": { "required": [ "inspections" ], "type": "object", "properties": { "inspections": { "maxItems": 1000, "minItems": 1, "type": "array", "items": { "required": [ "tv_inspection_id", "accepted_fields" ], "type": "object", "properties": { "accepted_fields": { "type": "array", "items": { "enum": [ "structural_cond", "leak_cond", "duct_length", "dk_duct_form", "dk_material", "dk_duct_dimension" ], "type": "string" } }, "tv_inspection_id": { "type": "integer" }, "tv_observation_id": { "type": "integer", "description": "Observation to read pipe shape, material and dimension from, as in the single apply." } } } } } } } }, "required": true, "x-bodyName": "body" }, "responses": { "200": { "description": "Batch processing completed. Per-record failures are listed in errors.", "content": { "application/json": { "schema": { "required": [ "updated_count", "skipped_count", "errors" ], "type": "object", "properties": { "errors": { "type": "array", "items": { "required": [ "tv_inspection_id", "error" ], "type": "object", "properties": { "error": { "type": "string" }, "tv_inspection_id": { "type": "integer" } } } }, "skipped_count": { "type": "integer" }, "updated_count": { "type": "integer" } } } } } }, "400": { "description": "The batch request is malformed or exceeds 1,000 entries.", "content": { "application/json": {} } }, "401": { "$ref": "#/components/responses/Http401" } }, "security": [ { "Token": [] } ] } } }, "components": { "responses": { "Http401": { "description": "Authentication credentials are missing or invalid", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorDetailsResponse" }, "example": { "details": "Authentication credentials were not provided" } } } } }, "securitySchemes": { "Token": { "type": "apiKey", "description": "Token issued for API consumer.", "name": "Authorization", "in": "header" } }, "schemas": { "ErrorDetailsResponse": { "required": [ "details" ], "type": "object", "properties": { "details": { "type": "string", "description": "Detailed description of error" } }, "description": "Standard error response payload" } } } } ````