# Create a production method (/docs/api-reference/production-methods/ProductionMethodsController_create)

`POST /api/factories/{factoryId}/production-methods`

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

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

Create a new method (recipe) for a product. Requires production_engineer or organization_admin. Audit-logged.

## Parameters

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

## Request body

Required.

Content type: `application/json`

```json
{
  "type": "object",
  "properties": {
    "productId": {
      "type": "string",
      "description": "Product (finished good) the method produces.",
      "example": "a1b2c3d4-1111-2222-3333-444455556666"
    },
    "name": {
      "type": "string",
      "description": "Display name (e.g. \"Method 1\", \"Standard Mold\").",
      "example": "Standard Mold"
    },
    "cavityCount": {
      "type": "number",
      "description": "Parts per cycle for count products, or output per cycle for measure products (e.g. 0.5 kg/cycle). Must be > 0.",
      "example": 4
    },
    "cycleTimeS": {
      "type": "number",
      "description": "Cycle time in seconds (per cycle of cavityCount parts). Must be > 0 — a zero cycle time silently breaks OEE Performance.",
      "example": 28.5
    },
    "setupTimeS": {
      "type": "number",
      "description": "One-off setup time in seconds applied before the first cycle.",
      "example": 900
    },
    "warmupTimeS": {
      "type": "number",
      "description": "Warmup time in seconds. Machine reports RUNNING (green) during heat-up/calibration without producing parts. Subtracted from productive run time when estimating part count.",
      "example": 300
    },
    "machineIds": {
      "description": "IDs of machines compatible with this method.",
      "example": [
        "a1b2c3d4-...",
        "e5f6g7h8-..."
      ],
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "positionX": {
      "type": "number",
      "description": "Canvas X position for the recipe DAG editor.",
      "example": 320
    },
    "positionY": {
      "type": "number",
      "description": "Canvas Y position for the recipe DAG editor.",
      "example": 180
    },
    "isActive": {
      "type": "boolean",
      "description": "Whether the method is active. Defaults to true.",
      "example": true
    },
    "recommended": {
      "type": "boolean",
      "description": "Mark this method as the recommended one for the product. When true, all other methods of the same product are automatically unmarked. Only one method per product can be recommended at a time.",
      "example": true
    }
  },
  "required": [
    "productId",
    "name"
  ]
}
```

## Responses

### 201: Method created.

### 400: Validation failure.