> This page is for Developer Documentation.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.benchling.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.benchling.com/_mcp/server.

# Create ProcedureRunPlanCondition

POST https://{tenant_name}.benchling.com/api/v3/procedure-run-plan-condition
Content-Type: application/json

Create a condition within a run plan.

## Required fields

| Field | Description |
| --- | --- |
| `name` | Display name (must not be empty) |
| `description` | Condition description |
| `procedureRunPlanId` | Parent run plan ID (`prp_XXXXXXXX`) |
| `templateMethodVersionId` | Method definition version ID (`pcmdv_XXXXXXXX`) — must be a method in the run plan's flowchart |
| `replicates` | Array of replicates with consecutive `replicateNumber` values starting from 1 |
| `methodParametersPlan` | Pre-filled parameter values, or null for defaults |

## Constraints

- `templateMethodVersionId` must reference a method present in the parent run plan's flowchart version.
- `name` must not be empty, and both `name` and `description` must not exceed 255 characters.
- The total replicates across all conditions in a run plan cannot exceed 500. Each condition's `replicateNumber` values must be consecutive starting from 1.
- Each template method in a run plan can contain at most 100 conditions.
- **Per-PMDV uniformity**: All conditions for the same procedure method definition version (PMDV) within a plan must have the same count, names, descriptions, and replicate counts across all unit operations.
- The condition's `position` (display order) is automatically assigned.

Reference: https://docs.benchling.com/docs/api/benchling-api/procedure-run-plan-condition/create

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Headers

- `EARLY-ACCESS` (string, optional) — Set to true to access beta operations via /api/v3.

### Body (application/json)

This endpoint expects a CreateProcedureRunPlanConditionInput.

- `description` (string, required) — Description of the condition. Must not exceed 255 characters.
- `methodParametersPlan` (MethodParametersPlanInput, required, nullable) — Pre-filled parameter values for this condition's unit operation. Pass null to use default values from the procedure template upon run creation.
- `name` (string, required) — Display name of the condition. Must not be empty and must not exceed 255 characters.
- `procedureRunPlanId` (string, required) — The ID of the parent run plan. Format: `prp_XXXXXXXX`.
- `replicates` (list of ProcedureRunPlanConditionReplicateInput, required) — The replicates for this condition. The plan's total number of replicates must not exceed 500, and `replicateNumber` values must be consecutive starting from 1.
- `templateMethodVersionId` (string, required) — The ID of the procedure method definition version (PMDV) this condition belongs to. Format: `pcmdv_XXXXXXXX`. Must reference a method in the parent run plan's flowchart.

## Response

### 201

Created

- `__typename` (string, optional)
- `createdAt` (string, optional)
- `description` (string, optional) — The user-defined description of the condition.
- `id` (string, optional)
- `methodParametersPlan` (MethodParametersPlan, optional, nullable) — Method plan containing parameter values for this condition's unit operation. If this value is null upon promotion to a procedure run, default values from the procedure will be used.
- `modifiedAt` (string, optional)
- `name` (string, optional) — The user-defined name of the condition.
- `position` (integer, optional) — The display order of the condition within the run.
- `procedureRunPlan` (ProcedureRunPlanRef, optional) — The ProcedureRunPlan that this condition is a part of.
- `replicates` (list of ProcedureRunPlanConditionReplicate, optional) — Replicate information for this condition.
- `templateMethodVersion` (ProcedureMethodDefinitionVersionRef, optional) — The procedure method definition version (PMDV) this condition belongs to.

## Errors

### 400 Procedure Run Plan Condition Create Request Bad Request Error

Bad Request

- `detail` (GeneralErrorDetail, required, nullable)
- `instance` (string, required)
- `status` (integer, required)
- `title` (string, required, nullable)
- `type` (string, required)
- `invalidId` (string, optional)

### 403 Procedure Run Plan Condition Create Request Forbidden Error

Forbidden

- `detail` (GeneralErrorDetail, required, nullable)
- `instance` (string, required)
- `status` (integer, required)
- `title` (string, required, nullable)
- `type` (string, required)
- `invalidId` (string, optional)

### 404 Procedure Run Plan Condition Create Request Not Found Error

Not Found

- `detail` (GeneralErrorDetail, required, nullable)
- `instance` (string, required)
- `status` (integer, required)
- `title` (string, required, nullable)
- `type` (string, required)
- `invalidId` (string, optional)

### 409 Procedure Run Plan Condition Create Request Conflict Error

Conflict

- `detail` (GeneralErrorDetail, required, nullable)
- `instance` (string, required)
- `status` (integer, required)
- `title` (string, required, nullable)
- `type` (string, required)
- `invalidId` (string, optional)

### 429 Procedure Run Plan Condition Create Request Too Many Requests Error

Too Many Requests

- `detail` (TooManyRequestsErrorBodyDetail, required, nullable)
- `instance` (string, required)
- `status` (integer, required)
- `title` (string, required, nullable)
- `type` (string, required)
- `invalidId` (string, optional)
- `violated-policies` (list of enum, optional) — The budget policies that rejected the request, in canonical order: `user`, `integration`, then `tenant`.
  - Allowed values: `user`, `integration`, `tenant`

### 500 Procedure Run Plan Condition Create Request Internal Server Error

Internal Server Error

- `detail` (InternalServerErrorBodyDetail, required, nullable)
- `instance` (string, required)
- `status` (integer, required)
- `title` (string, required, nullable)
- `type` (string, required)
- `errorId` (string, optional)

## Types

### MethodParametersPlanInput

- `dataParameterValues` (list of DataParameterValuePlanInput, required) — Planned values for data parameters in this method.
- `equipmentValues` (list of EquipmentValuePlanInput, required) — Planned values for equipment parameters in this method.
- `materialInputValues` (list of MaterialInputValuePlanInput, required) — Planned values for material inputs in this method.

### ProcedureRunPlanConditionReplicateInput

- `replicateNumber` (integer, required) — The 1-indexed replicate number. Must be >= 1. Replicate numbers must be consecutive starting from 1 (e.g., 1, 2, 3).
- `sourcePmeiIds` (list of string, optional) — IDs of source procedure method execution instances (PMEIs) for unit operation linking. Format: `pcmei_XXXXXXXX`. Used to connect this replicate's inputs to outputs from a previous run. IDs must be unique, and a replicate can reference at most 100 source PMEIs.

### MethodParametersPlan

Contains the planned parameter values for a single unit operation (method) within a `ProcedureRunPlanCondition`. Links to a `ProcedureMethodDefinitionVersion` via `templateMethodVersion` to identify which method these values apply to. Parameter values are organized by category: `dataParameterValues` for data fields like numbers or text, `materialInputValues` for sample or reagent inputs, and `equipmentValues` for equipment assignments. When the parent `ProcedureRunPlan` is promoted to a `ProcedureRun`, these planned values become the starting values in the resulting `ProcedureMethodExecutionInstance`.

- `__typename` (string, optional)
- `dataParameterValues` (list of DataParameterValuePlan, optional) — Planned values for data parameters keyed by parameter identifiers.
- `equipmentValues` (list of EquipmentValuePlan, optional) — Planned values for equipment keyed by equipment identifiers.
- `materialInputValues` (list of MaterialInputValuePlan, optional) — Planned values for material inputs keyed by input identifiers.

### ProcedureRunPlanRef

- `__typename` (string, optional)
- `id` (string, optional)

### ProcedureRunPlanConditionReplicate

Represents a planned replicate within a `ProcedureRunPlanCondition`. Scientists often run the same experimental condition multiple times to obtain statistically significant results—each repetition is a replicate. The `replicateNumber` provides a one-indexed identifier (e.g., replicate 1, 2, 3). The `sourcePmeiIds` field supports unit operation linking by storing source `ProcedureMethodExecutionInstance` IDs from other procedure runs. Upon promotion of the parent `ProcedureRunPlan`, each ProcedureRunPlanConditionReplicate becomes a `ProcedureRunConditionReplicate` in the resulting procedure run.

- `__typename` (string, optional)
- `procedureRunPlanCondition` (ProcedureRunPlanConditionRef, optional) — The ProcedureRunPlanCondition that this replicate belongs to.
- `replicateNumber` (integer, optional) — The replicate number.
- `sourcePmeiIds` (list of string, optional) — Source PMEI IDs for this replicate. Support unit operation linking to future-pmeis when executing the draft procedure run.

### ProcedureMethodDefinitionVersionRef

- `__typename` (string, optional)
- `id` (string, optional)

### GeneralErrorDetail

### TooManyRequestsErrorBodyDetail

### InternalServerErrorBodyDetail

### DataParameterValuePlanInput

- `parameterId` (string, required) — The ID of the procedure parameter version. Format: `schver_XXXXXXXX`.
- `value` (map from string to any, required) — A dict with the shape \{"value": \<TypedValue | null>}. The inner TypedValue must match the referenced parameter's configured data type. Supported types are ft\_float, ft\_string, and ft\_datetime (e.g., \{"type": "ft\_float", "floatValue": 1.5, "value": "1.5"} for numeric, \{"type": "ft\_string", "value": "text"} for text, or \{"type": "ft\_datetime", ...} for datetime). For plate-map-confirmed parameters with multiple setpoints, send one DataParameterValuePlanInput per setpoint, each with a scalar TypedValue.

### EquipmentValuePlanInput

- `equipmentId` (string, required) — The ID of the equipment parameter version. Format: `schver_XXXXXXXX`.
- `value` (map from string to any, required) — A dict with the shape \{"value": \{"equipment": \<TypedValue | null>}}. The equipment TypedValue must match the referenced equipment parameter's configured type: \{"type": "ft\_string", "value": "..."} for text inputs, or \{"type": "ft\_file\_link", "targetFiles": \[...]} for entity link inputs.

### MaterialInputValuePlanInput

- `materialInputId` (string, required) — The ID of the material input parameter version. Format: `schver_XXXXXXXX`.
- `value` (map from string to any, required) — A dict with the shape \{"value": \{"material": \<TypedValue | null>, "amount": \<TypedValue | null>}}. The material TypedValue must match the referenced material input's configured type: \{"type": "ft\_string", "value": "..."} for text inputs, or \{"type": "ft\_file\_link", "targetFiles": \[...]} for entity link inputs. The amount TypedValue is always ft\_float (e.g., \{"type": "ft\_float", "floatValue": 1.0, "value": "1.0"}). Either sub-field may be null independently.

### DataParameterValuePlan

A pre-filled value for a data parameter within a `MethodParametersPlan`. The `parameterId` references the `ProcedureParameterVersion` this value applies to. The `value` field contains the planned data in JSON format, which may be a number, string, or structured value depending on the parameter's data type configuration. Used during experiment planning to specify default values that will populate the parameter when the procedure run is created.

- `__typename` (string, optional)
- `parameterId` (string, optional)
- `value` (map from string to any, optional)

### EquipmentValuePlan

A pre-filled value for an equipment parameter within a `MethodParametersPlan`. The `equipmentId` references the `ProcedureParameterVersion` for the equipment parameter this value applies to. The `value` field contains the planned equipment assignment in JSON format, typically specifying which piece of lab equipment will be used. Used during experiment planning to pre-assign instruments or devices that will be used when the procedure run is executed.

- `__typename` (string, optional)
- `equipmentId` (string, optional)
- `value` (map from string to any, optional)

### MaterialInputValuePlan

A pre-filled value for a material input within a `MethodParametersPlan`. The `materialInputId` references the `ProcedureParameterVersion` for the material input this value applies to. The `value` field contains the planned material specification in JSON format, typically including sample references and quantities. Used during experiment planning to pre-assign samples, reagents, or other materials that will be used when the procedure run is executed.

- `__typename` (string, optional)
- `materialInputId` (string, optional)
- `value` (map from string to any, optional)

### ProcedureRunPlanConditionRef

- `__typename` (string, optional)
- `id` (string, optional)

## Examples

**Request**

```json
{
  "description": "10mg/kg treatment group",
  "methodParametersPlan": {
    "dataParameterValues": [
      {
        "parameterId": "schver_Rm4nTvWz",
        "value": {
          "value": {
            "floatValue": 10,
            "type": "ft_float",
            "value": "10.0"
          }
        }
      }
    ],
    "equipmentValues": [
      {
        "equipmentId": "equipmentId",
        "value": {
          "key": "value"
        }
      }
    ],
    "materialInputValues": [
      {
        "materialInputId": "materialInputId",
        "value": {
          "key": "value"
        }
      }
    ]
  },
  "name": "Low Dose",
  "procedureRunPlanId": "prp_Xk9mLpQr",
  "replicates": [
    {
      "replicateNumber": 1
    },
    {
      "replicateNumber": 2
    },
    {
      "replicateNumber": 3
    }
  ],
  "templateMethodVersionId": "pcmdv_Hn5kRtYw"
}
```

**Response**

```json
{
  "__typename": "__typename",
  "createdAt": "createdAt",
  "description": "description",
  "id": "id",
  "methodParametersPlan": {
    "__typename": "__typename",
    "dataParameterValues": [
      {}
    ],
    "equipmentValues": [
      {}
    ],
    "materialInputValues": [
      {}
    ]
  },
  "modifiedAt": "modifiedAt",
  "name": "name",
  "position": 1,
  "procedureRunPlan": {
    "__typename": "__typename",
    "id": "id"
  },
  "replicates": [
    {
      "__typename": "__typename",
      "replicateNumber": 1,
      "sourcePmeiIds": [
        "sourcePmeiIds"
      ]
    }
  ],
  "templateMethodVersion": {
    "__typename": "__typename",
    "id": "id"
  }
}
```

**SDK Code**

```python
import requests

url = "https://{tenant_name}.benchling.com/api/v3/procedure-run-plan-condition"

payload = {
    "description": "10mg/kg treatment group",
    "methodParametersPlan": {
        "dataParameterValues": [
            {
                "parameterId": "schver_Rm4nTvWz",
                "value": { "value": {
                        "floatValue": 10,
                        "type": "ft_float",
                        "value": "10.0"
                    } }
            }
        ],
        "equipmentValues": [
            {
                "equipmentId": "equipmentId",
                "value": { "key": "value" }
            }
        ],
        "materialInputValues": [
            {
                "materialInputId": "materialInputId",
                "value": { "key": "value" }
            }
        ]
    },
    "name": "Low Dose",
    "procedureRunPlanId": "prp_Xk9mLpQr",
    "replicates": [{ "replicateNumber": 1 }, { "replicateNumber": 2 }, { "replicateNumber": 3 }],
    "templateMethodVersionId": "pcmdv_Hn5kRtYw"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://{tenant_name}.benchling.com/api/v3/procedure-run-plan-condition';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"description":"10mg/kg treatment group","methodParametersPlan":{"dataParameterValues":[{"parameterId":"schver_Rm4nTvWz","value":{"value":{"floatValue":10,"type":"ft_float","value":"10.0"}}}],"equipmentValues":[{"equipmentId":"equipmentId","value":{"key":"value"}}],"materialInputValues":[{"materialInputId":"materialInputId","value":{"key":"value"}}]},"name":"Low Dose","procedureRunPlanId":"prp_Xk9mLpQr","replicates":[{"replicateNumber":1},{"replicateNumber":2},{"replicateNumber":3}],"templateMethodVersionId":"pcmdv_Hn5kRtYw"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```