---
title: Bulk add / update network pipe(s)
slug: bulk-add-update-network-pipes
docTags: 
createdAt: 2024-04-26T20:42:16.944Z
---

{
  "id": "TcJKSSzSWiFLgu6Ztg7M9",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://data.onxecta.com/api/production/network/pipe",
    "servers": [
      {
        "url": "https://data.onxecta.com/api/production/network/pipe",
        "description": "AWS Cloud API Endpoint"
      },
      {
        "url": "http://localhost/api/production/network/pipe",
        "description": "Local Testing API Endpoint"
      }
    ],
    "name": "Bulk add / update network pipe(s)",
    "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": "NetworkPipeInput[]",
          "schema": [
            {
              "name": "sourceNetworkId",
              "kind": "required",
              "type": "string",
              "description": "Source id of the network",
              "maxLength": 100
            },
            {
              "name": "sourceId",
              "kind": "required",
              "type": "string",
              "description": "Source ID for the pipe definition",
              "maxLength": 100
            },
            {
              "name": "date",
              "kind": "required",
              "type": "string<date-time>",
              "nullable": false,
              "description": "<p>Date at which the pipe becomes part of the network. Datetime offset (with timezone) in ISO 8601 format. Example: 2022-09-27T16:28</p><div></div>+0000<p></p>",
              "format": "date-time"
            },
            {
              "name": "upstreamSourceId",
              "kind": "required",
              "type": "string",
              "description": "Network element upstream of the pipe",
              "maxLength": 255
            },
            {
              "name": "downstreamSourceId",
              "kind": "required",
              "type": "string",
              "description": "Network element downstream of the pipe",
              "maxLength": 255
            },
            {
              "name": "enabled",
              "kind": "required",
              "type": "boolean",
              "description": "<p>Whether the pipe should participate in the network (false would be the equivalent of a mask in GAP)</p>"
            },
            {
              "name": "length",
              "kind": "required",
              "type": "array",
              "description": "<p>List of lengths making up the pipe segments (ft). All pipe property lists must be the same length.</p>",
              "example": "",
              "itemType": "number",
              "customType": "number[]",
              "itemExample": "",
              "itemDefault": ""
            },
            {
              "name": "trueVerticalDepth",
              "kind": "required",
              "type": "array",
              "description": "<p>List of true vertical depths making up the pipe segments (ft). All pipe property lists must be the same length.</p>",
              "example": "",
              "itemType": "number",
              "customType": "number[]",
              "itemExample": "",
              "itemDefault": ""
            },
            {
              "name": "innerDiameter",
              "kind": "required",
              "type": "array",
              "description": "<p>List of inner diameters making up the pipe segments (in). All pipe property lists must be the same length.</p>",
              "example": "",
              "itemType": "number",
              "customType": "number[]",
              "itemExample": "",
              "itemDefault": ""
            },
            {
              "name": "roughness",
              "kind": "required",
              "type": "array",
              "description": "<p>List of absolute roughness values making up the pipe segments (in). All pipe property lists must be the same length.</p>",
              "example": "",
              "itemType": "number",
              "customType": "number[]",
              "itemExample": "",
              "itemDefault": ""
            }
          ],
          "modelRef": "#/components/schemas/NetworkPipeInput",
          "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": "NetworkPipe[]",
            "schema": [
              {
                "name": "xid",
                "kind": "required",
                "type": "string<uuid>",
                "description": "xecta unique identifier",
                "format": "uuid"
              },
              {
                "name": "sourceNetworkId",
                "kind": "required",
                "type": "string",
                "description": "SourceNetworkId the pipe belongs to"
              },
              {
                "name": "sourceId",
                "kind": "required",
                "type": "string",
                "description": "Source ID for the pipe definition. This sourceID enables upsert functionality from client source systems of record"
              },
              {
                "name": "date",
                "kind": "required",
                "type": "string<date-time>",
                "nullable": false,
                "description": "<p>Date at which the pipe becomes part of the network. Datetime offset (with timezone) in ISO 8601 format. Example: 2022-09-27T16:28</p><div></div>+0000<p></p>",
                "format": "date-time"
              },
              {
                "name": "upstreamSourceId",
                "kind": "required",
                "type": "string",
                "description": "Network element upstream of the pipe"
              },
              {
                "name": "downstreamSourceId",
                "kind": "required",
                "type": "string",
                "description": "Network element downstream of the pipe"
              },
              {
                "name": "enabled",
                "kind": "required",
                "type": "boolean",
                "description": "<p>Whether the pipe should participate in the network (false would be the equivalent of a mask in GAP)</p>"
              },
              {
                "name": "length",
                "kind": "required",
                "type": "array",
                "description": "<p>List of lengths making up the pipe segments (ft). All pipe property lists must be the same length.</p>",
                "example": "",
                "itemType": "number",
                "customType": "number[]",
                "itemExample": "",
                "itemDefault": ""
              },
              {
                "name": "trueVerticalDepth",
                "kind": "required",
                "type": "array",
                "description": "<p>List of true vertical depths making up the pipe segments (ft). All pipe property lists must be the same length.</p>",
                "example": "",
                "itemType": "number",
                "customType": "number[]",
                "itemExample": "",
                "itemDefault": ""
              },
              {
                "name": "innerDiameter",
                "kind": "required",
                "type": "array",
                "description": "<p>List of inner diameters making up the pipe segments (in). All pipe property lists must be the same length.</p>",
                "example": "",
                "itemType": "number",
                "customType": "number[]",
                "itemExample": "",
                "itemDefault": ""
              },
              {
                "name": "roughness",
                "kind": "required",
                "type": "array",
                "description": "<p>List of absolute roughness values making up the pipe segments, in. All pipe property lists must be the same length.</p>",
                "example": "",
                "itemType": "number",
                "customType": "number[]",
                "itemExample": "",
                "itemDefault": ""
              }
            ],
            "modelRef": "#/components/schemas/NetworkPipe",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "VBrcTv_z6l_X20177Zjpq",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://data.onxecta.com/api/production/network/pipe \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '[\n     {\n     \"sourceNetworkId\": \"\",\n     \"sourceId\": \"\",\n     \"date\": \"\",\n     \"upstreamSourceId\": \"\",\n     \"downstreamSourceId\": \"\",\n     \"enabled\": \"\",\n     \"length\": [],\n     \"trueVerticalDepth\": [],\n     \"innerDiameter\": [],\n     \"roughness\": []\n     }\n     ]'"
        },
        {
          "id": "gZGBZE2TytOmYrmVr6D1d",
          "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      \"sourceNetworkId\": \"\",\n      \"sourceId\": \"\",\n      \"date\": \"\",\n      \"upstreamSourceId\": \"\",\n      \"downstreamSourceId\": \"\",\n      \"enabled\": \"\",\n      \"length\": [],\n      \"trueVerticalDepth\": [],\n      \"innerDiameter\": [],\n      \"roughness\": []\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/network/pipe\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "f7HiDPDTU1RdjhQckY0Xd",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://data.onxecta.com/api/production/network/pipe\"\n\npayload = json.dumps([\n   {\n      \"sourceNetworkId\": \"\",\n      \"sourceId\": \"\",\n      \"date\": \"\",\n      \"upstreamSourceId\": \"\",\n      \"downstreamSourceId\": \"\",\n      \"enabled\": \"\",\n      \"length\": [],\n      \"trueVerticalDepth\": [],\n      \"innerDiameter\": [],\n      \"roughness\": []\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": "hIMwMX42AIaEJ1Wa3l69S",
          "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/network/pipe\", Method.Post);\nrequest.AddHeader(\"accept\", \"application/json\");\nrequest.AddHeader(\"content-type\", \"application/json\");\nvar body = @\"[\" + \"\\n\" +\n@\"  {\" + \"\\n\" +\n@\"    \"\"sourceNetworkId\"\": \"\"\"\",\" + \"\\n\" +\n@\"    \"\"sourceId\"\": \"\"\"\",\" + \"\\n\" +\n@\"    \"\"date\"\": \"\"\"\",\" + \"\\n\" +\n@\"    \"\"upstreamSourceId\"\": \"\"\"\",\" + \"\\n\" +\n@\"    \"\"downstreamSourceId\"\": \"\"\"\",\" + \"\\n\" +\n@\"    \"\"enabled\"\": \"\"\"\",\" + \"\\n\" +\n@\"    \"\"length\"\": [],\" + \"\\n\" +\n@\"    \"\"trueVerticalDepth\"\": [],\" + \"\\n\" +\n@\"    \"\"innerDiameter\"\": [],\" + \"\\n\" +\n@\"    \"\"roughness\"\": []\" + \"\\n\" +\n@\"  }\" + \"\\n\" +\n@\"]\";\nrequest.AddStringBody(body, DataFormat.Json);\nRestResponse response = await client.ExecuteAsync(request);\nConsole.WriteLine(response.Content);"
        },
        {
          "id": "7gnzoNTxUjaWtKmV6Wgo7",
          "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    \\\"sourceNetworkId\\\": \\\"\\\",\\n    \\\"sourceId\\\": \\\"\\\",\\n    \\\"date\\\": \\\"\\\",\\n    \\\"upstreamSourceId\\\": \\\"\\\",\\n    \\\"downstreamSourceId\\\": \\\"\\\",\\n    \\\"enabled\\\": \\\"\\\",\\n    \\\"length\\\": [],\\n    \\\"trueVerticalDepth\\\": [],\\n    \\\"innerDiameter\\\": [],\\n    \\\"roughness\\\": []\\n  }\\n]\");\nRequest request = new Request.Builder()\n   .url(\"https://data.onxecta.com/api/production/network/pipe\")\n   .method(\"POST\", body)\n   .addHeader(\"accept\", \"application/json\")\n   .addHeader(\"content-type\", \"application/json\")\n   .build();\nResponse response = client.newCall(request).execute();"
        }
      ],
      "selectedLanguageId": "VBrcTv_z6l_X20177Zjpq"
    },
    "results": {
      "languages": [
        {
          "id": "1StbDo7uiw3d_vS8r7yXu",
          "language": "200",
          "code": "// OK\n[\n  {\n    \"xid\": \"\",\n    \"sourceNetworkId\": \"\",\n    \"sourceId\": \"\",\n    \"date\": \"\",\n    \"upstreamSourceId\": \"\",\n    \"downstreamSourceId\": \"\",\n    \"enabled\": false,\n    \"length\": [\n      0\n    ],\n    \"trueVerticalDepth\": [\n      0\n    ],\n    \"innerDiameter\": [\n      0\n    ],\n    \"roughness\": [\n      0\n    ]\n  }\n]"
        }
      ],
      "selectedLanguageId": "1StbDo7uiw3d_vS8r7yXu"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}