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

{
  "id": "rf8UbuKVeQcLub4lTg_RE",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://data.onxecta.com/api/production/network",
    "servers": [
      {
        "url": "https://data.onxecta.com/api/production/network",
        "description": "AWS Cloud API Endpoint"
      },
      {
        "url": "http://localhost/api/production/network",
        "description": "Local Testing API Endpoint"
      }
    ],
    "name": "Bulk add / update network(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": "NetworkInput[]",
          "schema": [
            {
              "name": "sourceId",
              "kind": "required",
              "type": "string",
              "description": "Source ID for the network header. This sourceID enables upsert functionality from client source systems of record",
              "maxLength": 100
            },
            {
              "name": "type",
              "kind": "required",
              "type": "string",
              "description": "<p>Network type: PRODUCTION or INJECTION</p>",
              "modelRef": "#/components/schemas/NetworkType",
              "customType": "NetworkType",
              "schema": []
            },
            {
              "name": "name",
              "kind": "required",
              "type": "string",
              "description": "<p>Network name. Since the network can vary over time, the name is not required to be unique, but should be descriptive for end users</p>",
              "maxLength": 100
            },
            {
              "name": "date",
              "kind": "required",
              "type": "string<date-time>",
              "description": "Date at which the network name becomes valid. A given network name can have multiple versions over time",
              "format": "date-time"
            },
            {
              "name": "description",
              "kind": "required",
              "type": "string",
              "description": "Description to contextualize the network name",
              "maxLength": 500
            }
          ],
          "modelRef": "#/components/schemas/NetworkInput",
          "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": "Network[]",
            "schema": [
              {
                "name": "xid",
                "kind": "required",
                "type": "string<uuid>",
                "description": "xecta unique identifier",
                "format": "uuid"
              },
              {
                "name": "sourceId",
                "kind": "required",
                "type": "string",
                "description": "Source ID for the network header. This sourceID enables upsert functionality from client source systems of record"
              },
              {
                "name": "type",
                "kind": "required",
                "type": "string",
                "description": "<p>Network type: PRODUCTION or INJECTION</p>",
                "modelRef": "#/components/schemas/NetworkType",
                "customType": "NetworkType",
                "schema": []
              },
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": "<p>Network name. Since the network can vary over time, the name is not required to be unique, but should be descriptive for end users</p>"
              },
              {
                "name": "date",
                "kind": "required",
                "type": "string<date-time>",
                "description": "Date at which the network name becomes valid. A given network name can have multiple versions over time",
                "format": "date-time"
              },
              {
                "name": "description",
                "kind": "required",
                "type": "string",
                "description": "Description to contextualize the network name"
              }
            ],
            "modelRef": "#/components/schemas/Network",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "NvVlEK5PDLBN7Fq9CBrTG",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://data.onxecta.com/api/production/network \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '[\n     {\n     \"sourceId\": \"\",\n     \"type\": \"\",\n     \"name\": \"\",\n     \"date\": \"\",\n     \"description\": \"\"\n     }\n     ]'"
        },
        {
          "id": "qnXu1pRzWKBAWML4DtvmG",
          "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      \"sourceId\": \"\",\n      \"type\": \"\",\n      \"name\": \"\",\n      \"date\": \"\",\n      \"description\": \"\"\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\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "Qu8LZ0GUfdoLatnwoRWzB",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://data.onxecta.com/api/production/network\"\n\npayload = json.dumps([\n   {\n      \"sourceId\": \"\",\n      \"type\": \"\",\n      \"name\": \"\",\n      \"date\": \"\",\n      \"description\": \"\"\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": "15Q8lPdypBV4ibH8nTXAK",
          "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\", Method.Post);\nrequest.AddHeader(\"accept\", \"application/json\");\nrequest.AddHeader(\"content-type\", \"application/json\");\nvar body = @\"[\" + \"\\n\" +\n@\"  {\" + \"\\n\" +\n@\"    \"\"sourceId\"\": \"\"\"\",\" + \"\\n\" +\n@\"    \"\"type\"\": \"\"\"\",\" + \"\\n\" +\n@\"    \"\"name\"\": \"\"\"\",\" + \"\\n\" +\n@\"    \"\"date\"\": \"\"\"\",\" + \"\\n\" +\n@\"    \"\"description\"\": \"\"\"\"\" + \"\\n\" +\n@\"  }\" + \"\\n\" +\n@\"]\";\nrequest.AddStringBody(body, DataFormat.Json);\nRestResponse response = await client.ExecuteAsync(request);\nConsole.WriteLine(response.Content);"
        },
        {
          "id": "tvUaPF6doMhyzV-biI2do",
          "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    \\\"sourceId\\\": \\\"\\\",\\n    \\\"type\\\": \\\"\\\",\\n    \\\"name\\\": \\\"\\\",\\n    \\\"date\\\": \\\"\\\",\\n    \\\"description\\\": \\\"\\\"\\n  }\\n]\");\nRequest request = new Request.Builder()\n   .url(\"https://data.onxecta.com/api/production/network\")\n   .method(\"POST\", body)\n   .addHeader(\"accept\", \"application/json\")\n   .addHeader(\"content-type\", \"application/json\")\n   .build();\nResponse response = client.newCall(request).execute();"
        }
      ],
      "selectedLanguageId": "NvVlEK5PDLBN7Fq9CBrTG"
    },
    "results": {
      "languages": [
        {
          "id": "s2nefCT46fkucR9YXxWIe",
          "language": "200",
          "code": "// OK\n[\n  {\n    \"xid\": \"\",\n    \"sourceId\": \"\",\n    \"type\": \"\",\n    \"name\": \"\",\n    \"date\": \"\",\n    \"description\": \"\"\n  }\n]"
        }
      ],
      "selectedLanguageId": "s2nefCT46fkucR9YXxWIe"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}