---
title: Well Events
slug: well-events
docTags: 
createdAt: 2024-07-02T12:48:57.800Z
---

The Well Events table captures significant events and notes over a well's history. Events fall into two categories: **interventions**, which represent workover history, and **comments**, which can be any event or note that adds context to the well during analysis.

The unique constraint on well events is **sourceWellId + date + eventType** — a well can have both an INTERVENTION and a COMMENT at the same timestamp.

| **Variable** | **Data Type**   | **Unit of Measure** | **Is Nullable?** | **Default Value** | **Description**                                                                                                                                                                           |
| ------------ | --------------- | ------------------- | ---------------- | ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| sourceWellId | String          | -                   | No               | -                 | Source ID for the well<br /><br />**From WellView:** wvwellheader table, idwell column<br />**From OpenWells:** cd\_well table, well\_id column                                           |
| date         | Datetime Offset | -                   | No               | -                 | Datetime of the event. Datetime offset (with timezone) in ISO 8601 format. Example: 2022-09-27T16:28:37+0000                                                                              |
| eventType    | String          | -                   | No               | -                 | INTERVENTION or COMMENT. This broad categorization determines the icon shown in the ProdX platform: INTERVENTION highlights workover events, COMMENT is for any general note on the well. |
| comment      | String          | -                   | No               | -                 | Description of the event or comment. Max 1000 characters.                                                                                                                                 |

***

# Data Integrity Checks

| **Condition**                                 | **Response**                              |
| --------------------------------------------- | ----------------------------------------- |
| sourceWellId does not exist in the Well table | Record Rejected and current batch aborted |
| eventType is not INTERVENTION or COMMENT      | Record Rejected                           |
| comment exceeds 1000 characters               | Record Rejected                           |
| Any non-nullable field is NULL                | Record Rejected                           |

:::hint{type="warning"}
If any record in a POST references an unknown **sourceWellId**, the whole batch is aborted — records earlier in the payload are not committed.
:::

***

# Common Error Messages

| **API**            | **Scenario**         | **Error Response**                                           |
| ------------------ | -------------------- | ------------------------------------------------------------ |
| Add / Upsert event | Unknown sourceWellId | Well with source id xxx was not found, current batch aborted |

