# Create an inspection record (/docs/api-reference/quality/QualityController_createRecord)

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

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": {
    "planId": {
      "type": "string",
      "description": "Inspection plan this record belongs to.",
      "example": "a1b2c3d4-1111-2222-3333-444455556666"
    },
    "productionOrderId": {
      "type": "string",
      "description": "Production order being inspected.",
      "example": "a1b2c3d4-1111-2222-3333-444455556666"
    },
    "machineId": {
      "type": "string",
      "description": "Machine where the sample came from.",
      "example": "CNC-001"
    },
    "inspector": {
      "type": "string",
      "description": "User id of the inspector.",
      "example": "a1b2c3d4-1111-2222-3333-444455556666"
    },
    "inspectionType": {
      "type": "string",
      "description": "Type of inspection.",
      "example": "first_article"
    },
    "measurements": {
      "description": "Array of measurement readings.",
      "example": [
        {
          "characteristic": "OD",
          "value": 10.02,
          "pass": true
        },
        {
          "characteristic": "Length",
          "value": 24.95,
          "pass": true
        }
      ],
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "notes": {
      "type": "string",
      "description": "Free-text notes.",
      "example": "Sampled from cavity 2."
    }
  },
  "required": [
    "planId",
    "inspectionType",
    "measurements"
  ]
}
```

## Responses

### 201: Record created