---
title: Wellbore Deviation Survey
slug: wellbore-deviation-survey
docTags: 
createdAt: 2023-03-22T19:17:00.000Z
---

A deviation survey is a measurement of the three-dimensional path of a wellbore, performed with magnetic or gyroscopic instrumentation. Measurements are taken at frequent intervals (stations) along the wellbore.

The unique constraint on deviation survey entries is **sourceWellboreId + sourceId**.

| **Variable**     | **Data Type** | **Unit of Measure** | **Is Nullable?** | **Default Value** | **Description**                                                                                                                                                                    |
| ---------------- | ------------- | ------------------- | ---------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| sourceId         | String        | -                   | No               | -                 | Source ID for the survey point<br /><br />**From WellView:** wvwellboredirsurveydata table, idrec column<br />**From OpenWells:** cd\_survey\_station table, survey\_id column     |
| sourceWellId     | String        | -                   | No               | -                 | Source ID for the well<br /><br />**From WellView:** wvwellboredirsurveydata table, idwell column<br />**From OpenWells:** cd\_survey\_station table, well\_id column              |
| sourceWellboreId | String        | -                   | No               | -                 | Source ID for the wellbore<br /><br />**From WellView:** wvwellboredirsurveydata table, idrecparent column<br />**From OpenWells:** cd\_survey\_station table, wellbore\_id column |
| md               | Double        | ft                  | No               | -                 | Measured depth                                                                                                                                                                     |
| inc              | Double        | decimal degrees     | Yes              | -                 | Inclination                                                                                                                                                                        |
| azi              | Double        | decimal degrees     | Yes              | -                 | Azimuth                                                                                                                                                                            |
| tvd              | Double        | ft                  | No               | -                 | True vertical depth                                                                                                                                                                |

:::hint{type="info"}
**Deviation Survey Notes**

Each well should have at least three deviation survey points; typically a survey contains numerous points describing the well trajectory. If fewer than three points are provided, the well model may not compute.
:::

***

# Data Integrity Checks

| **Condition**                                                         | **Response**    |
| --------------------------------------------------------------------- | --------------- |
| sourceId, sourceWellId, sourceWellboreId, md, or tvd is NULL or empty | Record Rejected |
| (sourceWellId, sourceWellboreId) does not match an existing wellbore  | Row Skipped     |

:::hint{type="info"}
**Partial success on bulk ingest**

Rows referencing an unknown wellbore are skipped while the remaining rows are written. The error response names each skipped row. An error response therefore does not mean nothing was written.
:::

***

# Common Error Messages

| **API**             | **Scenario**     | **Error Response**                                                                                                         |
| ------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------- |
| Add / Upsert survey | Unknown wellbore | DeviationSurvey with sourceId 'xxx' was skipped: wellbore with sourceWellId 'xxx' and sourceWellboreId 'xxx' was not found |
