{
 "openapi": "3.1.0",
 "info": {
  "title": "Vision Inspections (Manufacturing)",
  "version": "20261030b",
  "description": "Surface and dimensional defects found by camera, with the sampled human verdict beside them. The disagreement rate — not the accuracy figure — is what decides whether a camera may act on its own."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "vision-inspections": {
    "type": "object",
    "required": [],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "org_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org unit id",
      "readOnly": true
     },
     "device_id": {
      "type": "string",
      "format": "uuid",
      "description": "Device id",
      "readOnly": true
     },
     "equipment_id": {
      "type": "string",
      "format": "uuid",
      "description": "Equipment id",
      "readOnly": true
     },
     "work_center_id": {
      "type": "string",
      "format": "uuid",
      "description": "Work center id",
      "readOnly": true
     },
     "production_order_id": {
      "type": "string",
      "format": "uuid",
      "description": "Production order id",
      "readOnly": true
     },
     "batch_record_id": {
      "type": "string",
      "format": "uuid",
      "description": "Batch record id",
      "readOnly": true
     },
     "item_id": {
      "type": "string",
      "format": "uuid",
      "description": "Item id",
      "readOnly": true
     },
     "lot_no": {
      "type": "string",
      "description": "Lot no",
      "readOnly": true
     },
     "serial_no": {
      "type": "string",
      "description": "Serial no",
      "readOnly": true
     },
     "inspected_at": {
      "type": "string",
      "format": "date-time",
      "description": "Inspected at",
      "readOnly": true
     },
     "model_ref": {
      "type": "string",
      "description": "Model ref",
      "readOnly": true
     },
     "model_version": {
      "type": "string",
      "description": "Model version",
      "readOnly": true
     },
     "image_content_id": {
      "type": "string",
      "format": "uuid",
      "description": "Image content id",
      "readOnly": true
     },
     "image_ref": {
      "type": "string",
      "description": "Image ref",
      "readOnly": true
     },
     "findings": {
      "type": "object",
      "description": "Findings",
      "readOnly": true
     },
     "defect_count": {
      "type": "integer",
      "description": "Defect count",
      "readOnly": true
     },
     "verdict": {
      "type": "string",
      "description": "Verdict",
      "readOnly": true
     },
     "confidence": {
      "type": "string",
      "format": "decimal",
      "description": "Confidence",
      "readOnly": true
     },
     "human_verdict": {
      "type": "string",
      "description": "Human verdict",
      "readOnly": true
     },
     "human_checked_by": {
      "type": "string",
      "format": "uuid",
      "description": "Human checked by",
      "readOnly": true
     },
     "human_checked_at": {
      "type": "string",
      "format": "date-time",
      "description": "Human checked at",
      "readOnly": true
     },
     "agreement": {
      "type": "string",
      "description": "Agreement",
      "readOnly": true
     },
     "inspection_id": {
      "type": "string",
      "format": "uuid",
      "description": "Inspection id",
      "readOnly": true
     },
     "nonconformance_id": {
      "type": "string",
      "format": "uuid",
      "description": "Nonconformance id",
      "readOnly": true
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "readOnly": true
     },
     "xf_text_1": {
      "type": "string",
      "description": "Xf text 1",
      "readOnly": true
     },
     "xf_text_2": {
      "type": "string",
      "description": "Xf text 2",
      "readOnly": true
     },
     "xf_text_3": {
      "type": "string",
      "description": "Xf text 3",
      "readOnly": true
     },
     "xf_text_4": {
      "type": "string",
      "description": "Xf text 4",
      "readOnly": true
     },
     "xf_text_5": {
      "type": "string",
      "description": "Xf text 5",
      "readOnly": true
     },
     "xf_num_1": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 1",
      "readOnly": true
     },
     "xf_num_2": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 2",
      "readOnly": true
     },
     "xf_num_3": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 3",
      "readOnly": true
     },
     "xf_date_1": {
      "type": "string",
      "format": "date",
      "description": "Xf date 1",
      "readOnly": true
     },
     "xf_date_2": {
      "type": "string",
      "format": "date",
      "description": "Xf date 2",
      "readOnly": true
     },
     "created_by": {
      "type": "string",
      "format": "uuid",
      "description": "Created by",
      "readOnly": true
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Updated at",
      "readOnly": true
     },
     "updated_by": {
      "type": "string",
      "format": "uuid",
      "description": "Updated by",
      "readOnly": true
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/mfg/vision-inspections": {
   "get": {
    "summary": "list vision-inspections",
    "operationId": "list_vision_inspections_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Post vision inspections",
    "operationId": "action_vision_inspections_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/vision-inspections/{id}": {
   "get": {
    "summary": "get vision-inspections",
    "operationId": "get_vision_inspections_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "Put vision inspections",
    "operationId": "action_vision_inspections_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Delete vision inspections",
    "operationId": "action_vision_inspections_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/vision-inspections/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_vision_inspections_0_6",
    "description": "Body keys: overrides, preview, withLines",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/vision-inspections/record": {
   "post": {
    "summary": "Record",
    "operationId": "action_vision_inspections_0_5",
    "description": "Body keys: verdict, confidence, deviceId, equipmentId, workCenterId, productionOrderId, batchRecordId, itemId, lotNo, serialNo, modelRef, modelVersion, imageContentId, imageRef; verdict one of pass|fail|review|no_read; findings: [{ defect }]",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/vision-inspections/{id}/check": {
   "post": {
    "summary": "Check",
    "operationId": "action_vision_inspections_0_6",
    "description": "Body keys: verdict; verdict one of pass|fail|review|no_read",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}