# Create an NCR report (/docs/api-reference/quality/QualityController_createNcr)

`POST /api/factories/{factoryId}/quality/ncrs`

Base URL: https://api.xentr.ai

Authentication: bearer token (`Authorization: Bearer <token>`).

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `factoryId` | path | yes | string | Factory ID |

## Request body

Required.

Content type: `application/json`

```json
{
  "type": "object",
  "properties": {
    "inspectionRecordId": {
      "type": "string",
      "description": "Linked inspection record, if the NCR came from an inspection.",
      "example": "a1b2c3d4-1111-2222-3333-444455556666"
    },
    "productionOrderId": {
      "type": "string",
      "description": "Production order affected.",
      "example": "a1b2c3d4-1111-2222-3333-444455556666"
    },
    "productId": {
      "type": "string",
      "description": "Product affected.",
      "example": "a1b2c3d4-1111-2222-3333-444455556666"
    },
    "machineId": {
      "type": "string",
      "description": "Machine involved.",
      "example": "CNC-001"
    },
    "severity": {
      "type": "string",
      "description": "Severity classification.",
      "enum": [
        "minor",
        "major",
        "critical"
      ],
      "example": "major"
    },
    "description": {
      "type": "string",
      "description": "Description of the non-conformance.",
      "example": "12 parts out of tolerance on OD by +0.08mm."
    },
    "rootCause": {
      "type": "string",
      "description": "Identified root cause.",
      "example": "Tool wear beyond wear-limit."
    },
    "correctiveAction": {
      "type": "string",
      "description": "Corrective action taken.",
      "example": "Replaced insert and re-ran first-article check."
    },
    "preventiveAction": {
      "type": "string",
      "description": "Preventive action scheduled.",
      "example": "Reduce insert change interval from 2000 to 1500 parts."
    },
    "reportedBy": {
      "type": "string",
      "description": "User id of the reporter.",
      "example": "a1b2c3d4-1111-2222-3333-444455556666"
    }
  },
  "required": [
    "severity",
    "description"
  ]
}
```

## Responses

### 201: NCR created