---
title: Fetch formations by wellbore
slug: fetch-formations-by-wellbore
docTags: 
createdAt: 2023-05-03T20:15:30.000Z
---

{
  "id": "9WCCslbGWmSzcgoQ3XByh",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://data.onxecta.com/api/production/well/{sourceWellId}/wellbore/{sourceWellboreId}/formation",
    "servers": [
      {
        "url": "https://data.onxecta.com/api/production/well/{sourceWellId}/wellbore/{sourceWellboreId}/formation",
        "description": "AWS Cloud API Endpoint"
      },
      {
        "url": "http://localhost/api/production/well/{sourceWellId}/wellbore/{sourceWellboreId}/formation",
        "description": "Local Testing API Endpoint"
      }
    ],
    "name": "Fetch formations by wellbore",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "sourceWellId",
          "type": "string",
          "description": ""
        },
        {
          "kind": "required",
          "name": "sourceWellboreId",
          "type": "string",
          "description": ""
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "bearerAuth",
          "name": "bearerAuth",
          "kind": "optional",
          "type": "http",
          "scheme": "bearer"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "",
            "customType": "Formation[]",
            "schema": [
              {
                "name": "xid",
                "kind": "required",
                "type": "string<uuid>",
                "description": "This is the xecta identifier",
                "format": "uuid"
              },
              {
                "name": "sourceId",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "nullable": true,
                "description": ""
              },
              {
                "name": "allocationFactor",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "",
                "default": 1,
                "format": "double"
              },
              {
                "name": "compressibilityRock",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "Formation rock compressibility",
                "format": "double"
              },
              {
                "name": "pressureFormationInitialDatum",
                "kind": "required",
                "type": "number<double>",
                "description": "The initial reservoir pressure value",
                "format": "double"
              },
              {
                "name": "temperatureFormationDatum",
                "kind": "required",
                "type": "number<double>",
                "description": "The reservoir temperature value",
                "format": "double"
              },
              {
                "name": "depth",
                "kind": "required",
                "type": "number<double>",
                "description": "<p>Depth of the formation, ft</p>",
                "format": "double"
              },
              {
                "name": "thicknessFormation",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "Thickness of the formation",
                "format": "double"
              },
              {
                "name": "porosity",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "Porosity of the formation",
                "format": "double"
              },
              {
                "name": "saturationWaterInitial",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "Initial water saturation",
                "format": "double"
              },
              {
                "name": "saturationGasInitial",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "Initial gas saturation",
                "format": "double"
              },
              {
                "name": "saturationOilInitial",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "Initial oil saturation",
                "format": "double"
              },
              {
                "name": "primaryFluidType",
                "kind": "optional",
                "type": "string",
                "description": "<p>OIL, GAS, WATER</p>",
                "default": "OIL",
                "modelRef": "#/components/schemas/FormationPrimaryFluidType",
                "customType": "FormationPrimaryFluidType",
                "schema": []
              },
              {
                "name": "rsi",
                "kind": "required",
                "type": "number<double>",
                "description": "Initial solution gas oil ratio",
                "format": "double"
              },
              {
                "name": "condensateGasRatio",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "Condensate gas Ratio",
                "format": "double"
              },
              {
                "name": "waterGasRatio",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "Water gas ratio",
                "format": "double"
              },
              {
                "name": "originalGasInPlace",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "Original Gas in Place",
                "format": "double"
              },
              {
                "name": "originalOilInPlace",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "Original Oil In Place",
                "format": "double"
              },
              {
                "name": "volumeAquiferInitial",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "Initial aquifer volume",
                "format": "double"
              },
              {
                "name": "fluidGravityApi",
                "kind": "required",
                "type": "number<double>",
                "description": "Oil API gravity",
                "format": "double"
              },
              {
                "name": "fluidGravityGas",
                "kind": "required",
                "type": "number<double>",
                "description": "Gas specific gravity",
                "format": "double"
              },
              {
                "name": "fluidSalinityWater",
                "kind": "required",
                "type": "number<double>",
                "description": "Water salinity",
                "format": "double"
              },
              {
                "name": "fluidCommingledGOR",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "<p>Gas Oil Ratio of the co-mingled fluid in multi wellbore wells</p>",
                "format": "double"
              },
              {
                "name": "fluidMolarFracN2",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "Molar fraction N2",
                "default": 0,
                "format": "double"
              },
              {
                "name": "fluidMolarFracCO2",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "Molar fraction CO2",
                "default": 0,
                "format": "double"
              },
              {
                "name": "fluidMolarFracH2S",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "Molar fraction H2S",
                "default": 0,
                "format": "double"
              },
              {
                "name": "startDate",
                "kind": "optional",
                "type": "string<date-time>",
                "nullable": true,
                "description": "This is the valid date of the formation",
                "format": "date-time"
              },
              {
                "name": "langmuirPressure",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "<p>Langmuir pressure (for coal seam gas reservoirs)</p>",
                "format": "double"
              },
              {
                "name": "langmuirVolume",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "<p>Langmuir volume (for coal seam gas reservoirs)</p>",
                "format": "double"
              },
              {
                "name": "initialGasContent",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "<p>Initial gas content (for coal seam gas reservoirs)</p>",
                "format": "double"
              },
              {
                "name": "bulkDensity",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "<p>Bulk density (for coal seam gas reservoirs)</p>",
                "format": "double"
              }
            ],
            "modelRef": "#/components/schemas/Formation",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "Wgg8gpo_H1cStcvEh6sKI",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://data.onxecta.com/api/production/well/{sourceWellId}/wellbore/{sourceWellboreId}/formation \\\n     --header 'accept: application/json'"
        },
        {
          "id": "sFH1sQdmkzgy1UkJju2oa",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://data.onxecta.com/api/production/well/{sourceWellId}/wellbore/{sourceWellboreId}/formation\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "HpgpnUkbi_RYL8x8b8Vnb",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://data.onxecta.com/api/production/well/{sourceWellId}/wellbore/{sourceWellboreId}/formation\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        },
        {
          "id": "KmgoPs94a_kkjzpJBktIG",
          "language": "csharp",
          "label": "C#",
          "code": "var options = new RestClientOptions(\"https://data.onxecta.com\")\n{\n   MaxTimeout = -1,\n};\nvar client = new RestClient(options);\nvar request = new RestRequest(\"/api/production/well/{sourceWellId}/wellbore/{sourceWellboreId}/formation\", Method.Get);\nrequest.AddHeader(\"accept\", \"application/json\");\nrequest.AddHeader(\"content-type\", \"application/json\");\nRestResponse response = await client.ExecuteAsync(request);\nConsole.WriteLine(response.Content);"
        },
        {
          "id": "uRraJ9v2Wa9JSCwXmGuKg",
          "language": "java",
          "label": "Java",
          "code": "OkHttpClient client = new OkHttpClient().newBuilder()\n   .build();\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"\");\nRequest request = new Request.Builder()\n   .url(\"https://data.onxecta.com/api/production/well/{sourceWellId}/wellbore/{sourceWellboreId}/formation\")\n   .method(\"GET\", body)\n   .addHeader(\"accept\", \"application/json\")\n   .addHeader(\"content-type\", \"application/json\")\n   .build();\nResponse response = client.newCall(request).execute();"
        }
      ],
      "selectedLanguageId": "Wgg8gpo_H1cStcvEh6sKI"
    },
    "results": {
      "languages": [
        {
          "id": "FPKwcmZCXZbXGEsXD9LR5",
          "language": "200",
          "code": "// OK\n[\n  {\n    \"xid\": \"\",\n    \"sourceId\": \"\",\n    \"name\": \"\",\n    \"allocationFactor\": \"\",\n    \"compressibilityRock\": \"\",\n    \"pressureFormationInitialDatum\": \"\",\n    \"temperatureFormationDatum\": \"\",\n    \"depth\": \"\",\n    \"thicknessFormation\": \"\",\n    \"porosity\": \"\",\n    \"saturationWaterInitial\": \"\",\n    \"saturationGasInitial\": \"\",\n    \"saturationOilInitial\": \"\",\n    \"primaryFluidType\": \"\",\n    \"rsi\": \"\",\n    \"condensateGasRatio\": \"\",\n    \"waterGasRatio\": \"\",\n    \"originalGasInPlace\": \"\",\n    \"originalOilInPlace\": \"\",\n    \"volumeAquiferInitial\": \"\",\n    \"fluidGravityApi\": \"\",\n    \"fluidGravityGas\": \"\",\n    \"fluidSalinityWater\": \"\",\n    \"fluidCommingledGOR\": \"\",\n    \"fluidMolarFracN2\": \"\",\n    \"fluidMolarFracCO2\": \"\",\n    \"fluidMolarFracH2S\": \"\",\n    \"startDate\": \"\",\n    \"langmuirPressure\": \"\",\n    \"langmuirVolume\": \"\",\n    \"initialGasContent\": \"\",\n    \"bulkDensity\": \"\"\n  }\n]"
        }
      ],
      "selectedLanguageId": "FPKwcmZCXZbXGEsXD9LR5"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}