---
title: Bulk Add / Update PCP Data
slug: bulk-add-update-pcp-data
docTags: 
createdAt: 2024-09-26T20:54:43.854Z
---

{
  "id": "Pcu26jDCBy8wdtZ323nX4",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://data.onxecta.com/api/production/pcp",
    "servers": [
      {
        "url": "https://data.onxecta.com/api/production/pcp",
        "description": "AWS Cloud API Endpoint"
      },
      {
        "url": "http://localhost/api/production/pcp",
        "description": "Local Testing API Endpoint"
      }
    ],
    "name": "Bulk Add / Update PCP Data",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "array",
          "description": "",
          "customType": "PCPInput[]",
          "schema": [
            {
              "name": "sourceWellId",
              "kind": "required",
              "type": "string",
              "nullable": false,
              "description": "SourceWellId of the well which owns the PCP",
              "maxLength": 100
            },
            {
              "name": "sourceWellboreId",
              "kind": "required",
              "type": "string",
              "nullable": false,
              "description": "SourceWellboreId of the wellbore which owns the PCP",
              "maxLength": 100
            },
            {
              "name": "sourceTubingId",
              "kind": "required",
              "type": "string",
              "nullable": false,
              "description": "SourceTubingId of the tubing string in which the PCP is installed",
              "maxLength": 100
            },
            {
              "name": "sourceId",
              "kind": "required",
              "type": "string",
              "nullable": false,
              "description": "SourceId of the PCP to enable upsert functionality",
              "maxLength": 100
            },
            {
              "name": "name",
              "kind": "required",
              "type": "string",
              "nullable": false,
              "description": "<p>Pump name, must match a pump in the catalog</p>",
              "maxLength": 100
            },
            {
              "name": "viscosityCorrection",
              "kind": "optional",
              "type": "boolean",
              "nullable": true,
              "description": "Should a viscosity correction be applied through the PCP."
            },
            {
              "name": "separationEfficiency",
              "kind": "optional",
              "type": "number<double>",
              "nullable": true,
              "description": "Percent separation Efficiency",
              "format": "double"
            },
            {
              "name": "runDate",
              "kind": "required",
              "type": "string<date-time>",
              "nullable": false,
              "description": "Date the pump was installed",
              "format": "date-time"
            },
            {
              "name": "pullDate",
              "kind": "optional",
              "type": "string<date-time>",
              "nullable": true,
              "description": "Date the pump was pulled",
              "format": "date-time"
            },
            {
              "name": "slipFactor",
              "kind": "optional",
              "type": "number<double>",
              "nullable": true,
              "description": "Slip factor override from bench test",
              "format": "double"
            },
            {
              "name": "flowFactor",
              "kind": "optional",
              "type": "number<double>",
              "nullable": true,
              "description": "Flow factor adjustment from bench test",
              "default": 1,
              "format": "double"
            },
            {
              "name": "headFactor",
              "kind": "optional",
              "type": "number<double>",
              "nullable": true,
              "description": "Head factor adjustment from bench test",
              "default": 1,
              "format": "double"
            },
            {
              "name": "powerFactor",
              "kind": "optional",
              "type": "number<double>",
              "nullable": true,
              "description": "Power factor adjustment from bench test",
              "default": 1,
              "format": "double"
            }
          ],
          "modelRef": "#/components/schemas/PCPInput",
          "isExpanded": true
        }
      ],
      "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": "PCP[]",
            "schema": [
              {
                "name": "xid",
                "kind": "required",
                "type": "string<uuid>",
                "nullable": false,
                "description": "",
                "format": "uuid"
              },
              {
                "name": "tubingXid",
                "kind": "required",
                "type": "string<uuid>",
                "nullable": false,
                "description": "",
                "format": "uuid"
              },
              {
                "name": "sourceId",
                "kind": "required",
                "type": "string",
                "nullable": false,
                "description": ""
              },
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "nullable": false,
                "description": ""
              },
              {
                "name": "viscosityCorrection",
                "kind": "optional",
                "type": "boolean",
                "nullable": true,
                "description": "Should a viscosity correction be applied through the PCP."
              },
              {
                "name": "separationEfficiency",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "Percent separation Efficiency",
                "format": "double"
              },
              {
                "name": "runDate",
                "kind": "required",
                "type": "string<date-time>",
                "nullable": false,
                "description": "Date the pump was installed",
                "format": "date-time"
              },
              {
                "name": "pullDate",
                "kind": "optional",
                "type": "string<date-time>",
                "nullable": true,
                "description": "Date the pump was pulled",
                "format": "date-time"
              },
              {
                "name": "slipFactor",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "Slip factor override from bench test",
                "format": "double"
              },
              {
                "name": "flowFactor",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "Flow factor adjustment from bench test",
                "default": 1,
                "format": "double"
              },
              {
                "name": "headFactor",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "Head factor adjustment from bench test",
                "default": 1,
                "format": "double"
              },
              {
                "name": "powerFactor",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "Power factor adjustment from bench test",
                "default": 1,
                "format": "double"
              }
            ],
            "modelRef": "#/components/schemas/PCP",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "hP7RcoMfJlw9ocz7_aOvO",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://data.onxecta.com/api/production/pcp \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '[\n     {\n     \"sourceWellId\": \"\",\n     \"sourceWellboreId\": \"\",\n     \"sourceTubingId\": \"\",\n     \"sourceId\": \"\",\n     \"name\": \"\",\n     \"runDate\": \"\",\n     \"flowFactor\": 1,\n     \"headFactor\": 1,\n     \"powerFactor\": 1\n     }\n     ]'"
        },
        {
          "id": "B7QziBNyMDpbVMnNqkF_a",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify([\n   {\n      \"sourceWellId\": \"\",\n      \"sourceWellboreId\": \"\",\n      \"sourceTubingId\": \"\",\n      \"sourceId\": \"\",\n      \"name\": \"\",\n      \"runDate\": \"\",\n      \"flowFactor\": 1,\n      \"headFactor\": 1,\n      \"powerFactor\": 1\n   }\n]);\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://data.onxecta.com/api/production/pcp\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "amVXXRKo4-qKBUNXYFyy9",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://data.onxecta.com/api/production/pcp\"\n\npayload = json.dumps([\n   {\n      \"sourceWellId\": \"\",\n      \"sourceWellboreId\": \"\",\n      \"sourceTubingId\": \"\",\n      \"sourceId\": \"\",\n      \"name\": \"\",\n      \"runDate\": \"\",\n      \"flowFactor\": 1,\n      \"headFactor\": 1,\n      \"powerFactor\": 1\n   }\n])\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        },
        {
          "id": "hnQmX23HqjebpG659Icu4",
          "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/pcp\", Method.Post);\nrequest.AddHeader(\"accept\", \"application/json\");\nrequest.AddHeader(\"content-type\", \"application/json\");\nvar body = @\"[\" + \"\\n\" +\n@\"  {\" + \"\\n\" +\n@\"    \"\"sourceWellId\"\": \"\"\"\",\" + \"\\n\" +\n@\"    \"\"sourceWellboreId\"\": \"\"\"\",\" + \"\\n\" +\n@\"    \"\"sourceTubingId\"\": \"\"\"\",\" + \"\\n\" +\n@\"    \"\"sourceId\"\": \"\"\"\",\" + \"\\n\" +\n@\"    \"\"name\"\": \"\"\"\",\" + \"\\n\" +\n@\"    \"\"runDate\"\": \"\"\"\",\" + \"\\n\" +\n@\"    \"\"flowFactor\"\": 1,\" + \"\\n\" +\n@\"    \"\"headFactor\"\": 1,\" + \"\\n\" +\n@\"    \"\"powerFactor\"\": 1\" + \"\\n\" +\n@\"  }\" + \"\\n\" +\n@\"]\";\nrequest.AddStringBody(body, DataFormat.Json);\nRestResponse response = await client.ExecuteAsync(request);\nConsole.WriteLine(response.Content);"
        },
        {
          "id": "WxAxTIulXomG6bF7VuRGv",
          "language": "java",
          "label": "Java",
          "code": "OkHttpClient client = new OkHttpClient().newBuilder()\n   .build();\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"[\\n  {\\n    \\\"sourceWellId\\\": \\\"\\\",\\n    \\\"sourceWellboreId\\\": \\\"\\\",\\n    \\\"sourceTubingId\\\": \\\"\\\",\\n    \\\"sourceId\\\": \\\"\\\",\\n    \\\"name\\\": \\\"\\\",\\n    \\\"runDate\\\": \\\"\\\",\\n    \\\"flowFactor\\\": 1,\\n    \\\"headFactor\\\": 1,\\n    \\\"powerFactor\\\": 1\\n  }\\n]\");\nRequest request = new Request.Builder()\n   .url(\"https://data.onxecta.com/api/production/pcp\")\n   .method(\"POST\", body)\n   .addHeader(\"accept\", \"application/json\")\n   .addHeader(\"content-type\", \"application/json\")\n   .build();\nResponse response = client.newCall(request).execute();"
        }
      ],
      "selectedLanguageId": "hP7RcoMfJlw9ocz7_aOvO"
    },
    "results": {
      "languages": [
        {
          "id": "UHSNx-TmSZ6XDmdr3mu1t",
          "language": "200",
          "code": "// OK\n[\n  {\n    \"xid\": \"\",\n    \"tubingXid\": \"\",\n    \"sourceId\": \"\",\n    \"name\": \"\",\n    \"viscosityCorrection\": false,\n    \"separationEfficiency\": \"\",\n    \"runDate\": \"\",\n    \"pullDate\": \"\",\n    \"slipFactor\": \"\",\n    \"flowFactor\": \"\",\n    \"headFactor\": \"\",\n    \"powerFactor\": \"\"\n  }\n]"
        }
      ],
      "selectedLanguageId": "UHSNx-TmSZ6XDmdr3mu1t"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}