---
title: Network Well Constraint
slug: network-well-constraint
docTags: 
createdAt: 2023-10-11T07:16:36.120Z
---

The Network Well Constraint table describes time-based constraints applied to well elements in a network, for network optimization and forecasting defaults.

:::hint{type="info"}
**Constraints** apply from the last date they were set. For example, if a record is added with date 2023-01-01T00:00:00+0000 and **maxPressure** set to 2100 psi, that constraint continues to apply until a future record sets a different value for **maxPressure**.
:::

:::hint{type="warning"}
A **NULL** value for a particular constraint makes that variable unconstrained. If different constraint variables change on different time horizons, take care when posting updates — it is easy to unintentionally reset a constraint with a NULL value.
:::

The unique constraint on network well constraint entries is **sourceWellId + sourceId**.

| **Variable**                | **Data Type**  | **Unit of Measure** | **Is Nullable?** | **Default Value** | **Description**                                                                                                                        |
| --------------------------- | -------------- | ------------------- | ---------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| sourceNetworkId             | String         | -                   | No               | -                 | Source ID of the [Network Header](docId\:irXj-Rg5lEh701vW2okjL)                                                                        |
| sourceWellId                | String         | -                   | No               | -                 | Source ID of the [Network Well Definition](docId\:Y5PXM_hJtoozMHybVyztE)                                                               |
| sourceId                    | String         | -                   | No               | -                 | Source ID for the well/date constraint. This sourceId enables upsert functionality from client source systems of record.               |
| date                        | DateTimeOffset | -                   | No               | -                 | Date at which the constraint becomes applicable. Datetime offset (with timezone) in ISO 8601 format. Example: 2022-09-27T16:28:37+0000 |
| maxPressure                 | Double         | psig                | Yes              | -                 | Maximum pressure constraint                                                                                                            |
| minPressure                 | Double         | psig                | Yes              | -                 | Minimum pressure constraint                                                                                                            |
| maxOilRate                  | Double         | STB/d               | Yes              | -                 | Maximum oil rate constraint                                                                                                            |
| maxGasRate                  | Double         | Mscf/d              | Yes              | -                 | Maximum gas rate constraint                                                                                                            |
| maxWaterRate                | Double         | STB/d               | Yes              | -                 | Maximum water rate constraint                                                                                                          |
| maxLiquidRate               | Double         | STB/d               | Yes              | -                 | Maximum liquid rate constraint                                                                                                         |
| maxDrawdown                 | Double         | psig                | Yes              | -                 | Maximum drawdown constraint (reservoir pressure - bottomhole pressure)                                                                 |
| plannedDowntime             | Double         | %                   | Yes              | -                 | Planned downtime in percent, 0 - 100 (100% = 24 hours)                                                                                 |
| maxGasLiftInjectionRate     | Double         | Mscf/d              | Yes              | -                 | Maximum gas lift injection rate                                                                                                        |
| minGasLiftInjectionRate     | Double         | Mscf/d              | Yes              | -                 | Minimum gas lift injection rate                                                                                                        |
| maxGasLiftInjectionPressure | Double         | psig                | Yes              | -                 | Maximum gas lift injection pressure                                                                                                    |
| minGasLiftInjectionPressure | Double         | psig                | Yes              | -                 | Minimum gas lift injection pressure                                                                                                    |

***

# Data Integrity Checks

| **Condition**                                                            | **Response**    |
| ------------------------------------------------------------------------ | --------------- |
| Any non-nullable field is NULL or empty                                  | Record Rejected |
| (sourceNetworkId, sourceWellId) does not match a Network Well Definition | Record Rejected |
| plannedDowntime outside 0 - 100                                          | Record Rejected |

***

# Common Error Messages

| **API**                 | **Scenario**         | **Error Response**                                      |
| ----------------------- | -------------------- | ------------------------------------------------------- |
| Add / Upsert constraint | Unknown network well | Network Well was not found for network xxx and pipe xxx |
