---
title: Bulk add / update compressor constraint(s)
slug: bulk-add-update-compressor-constraints
docTags: 
createdAt: 2024-08-13T18:19:32.495Z
---

{
  "id": "uhqV8zQN8ge4LZd1VZ2oq",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://data.onxecta.com/api/production/network/compressor/constraint",
    "servers": [
      {
        "url": "https://data.onxecta.com/api/production/network/compressor/constraint",
        "description": "AWS Cloud API Endpoint"
      },
      {
        "url": "http://localhost/api/production/network/compressor/constraint",
        "description": "Local Testing API Endpoint"
      }
    ],
    "name": "Bulk add / update compressor constraint(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": "NetworkCompressorConstraintInput[]",
          "schema": [
            {
              "name": "sourceNetworkId",
              "kind": "required",
              "type": "string",
              "description": "Source ID of the Network Header",
              "maxLength": 100
            },
            {
              "name": "sourceCompressorId",
              "kind": "required",
              "type": "string",
              "description": "Source ID of Network Compressor Definition",
              "maxLength": 100
            },
            {
              "name": "sourceId",
              "kind": "required",
              "type": "string",
              "description": "<p>Source ID for the compressor/date constraint. This sourceID enables upsert functionality from client source systems of record</p>",
              "maxLength": 100
            },
            {
              "name": "date",
              "kind": "required",
              "type": "string<date-time>",
              "nullable": false,
              "description": "<p>Date at which the constraint becomes applicable. Datetime offset (with timezone) in ISO 8601 format. Example: 2022-09-27T16:28</p><div></div>+0000<p></p>",
              "format": "date-time"
            },
            {
              "name": "maxGasLiftInjectionRate",
              "kind": "optional",
              "type": "number<double>",
              "nullable": true,
              "description": "<p>Maximum gas lift injection rate constraint, Mscf/d</p>",
              "format": "double"
            },
            {
              "name": "maxGasLiftInjectionPressure",
              "kind": "optional",
              "type": "number<double>",
              "nullable": true,
              "description": "<p>Maximum gas lift injection pressure constraint, psig</p>",
              "format": "double"
            }
          ],
          "modelRef": "#/components/schemas/NetworkCompressorConstraintInput",
          "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": "NetworkCompressorConstraint[]",
            "schema": [
              {
                "name": "xid",
                "kind": "required",
                "type": "string<uuid>",
                "description": "Xecta constraint identifier",
                "format": "uuid"
              },
              {
                "name": "compressorXid",
                "kind": "required",
                "type": "string<uuid>",
                "description": "Xecta compressor identifier",
                "format": "uuid"
              },
              {
                "name": "sourceNetworkId",
                "kind": "required",
                "type": "string",
                "description": "Source ID of the Network Header"
              },
              {
                "name": "sourceCompressorId",
                "kind": "required",
                "type": "string",
                "description": "Source ID of Network Compressor Definition"
              },
              {
                "name": "sourceId",
                "kind": "required",
                "type": "string",
                "description": "<p>Source ID for the compressor/date constraint. This sourceID enables upsert functionality from client source systems of record</p>"
              },
              {
                "name": "date",
                "kind": "required",
                "type": "string<date-time>",
                "nullable": false,
                "description": "<p>Date at which the constraint becomes applicable. Datetime offset (with timezone) in ISO 8601 format. Example: 2022-09-27T16:28</p><div></div>+0000<p></p>",
                "format": "date-time"
              },
              {
                "name": "maxGasLiftInjectionRate",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "<p>Maximum gas lift injection rate constraint, Mscf/d</p>",
                "format": "double"
              },
              {
                "name": "maxGasLiftInjectionPressure",
                "kind": "optional",
                "type": "number<double>",
                "nullable": true,
                "description": "<p>Maximum gas lift injection pressure constraint, psig</p>",
                "format": "double"
              }
            ],
            "modelRef": "#/components/schemas/NetworkCompressorConstraint",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "y8ArmU5RWDWrDmoTrK4TK",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://data.onxecta.com/api/production/network/compressor/constraint \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '[\n     {\n     \"sourceNetworkId\": \"\",\n     \"sourceCompressorId\": \"\",\n     \"sourceId\": \"\",\n     \"date\": \"\"\n     }\n     ]'"
        },
        {
          "id": "GbHEQlDVHFos1yGaT8AK4",
          "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      \"sourceCompressorId\": \"\",\n      \"sourceId\": \"\",\n      \"date\": \"\"\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/compressor/constraint\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "pOfRy2kd6W7UaoHYqGo2H",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://data.onxecta.com/api/production/network/compressor/constraint\"\n\npayload = json.dumps([\n   {\n      \"sourceNetworkId\": \"\",\n      \"sourceCompressorId\": \"\",\n      \"sourceId\": \"\",\n      \"date\": \"\"\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": "kosw8z2o6gI5dVB-vaYUr",
          "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/compressor/constraint\", Method.Post);\nrequest.AddHeader(\"accept\", \"application/json\");\nrequest.AddHeader(\"content-type\", \"application/json\");\nvar body = @\"[\" + \"\\n\" +\n@\"  {\" + \"\\n\" +\n@\"    \"\"sourceNetworkId\"\": \"\"\"\",\" + \"\\n\" +\n@\"    \"\"sourceCompressorId\"\": \"\"\"\",\" + \"\\n\" +\n@\"    \"\"sourceId\"\": \"\"\"\",\" + \"\\n\" +\n@\"    \"\"date\"\": \"\"\"\"\" + \"\\n\" +\n@\"  }\" + \"\\n\" +\n@\"]\";\nrequest.AddStringBody(body, DataFormat.Json);\nRestResponse response = await client.ExecuteAsync(request);\nConsole.WriteLine(response.Content);"
        },
        {
          "id": "CdddJyh20QGPQKojeXgpx",
          "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    \\\"sourceCompressorId\\\": \\\"\\\",\\n    \\\"sourceId\\\": \\\"\\\",\\n    \\\"date\\\": \\\"\\\"\\n  }\\n]\");\nRequest request = new Request.Builder()\n   .url(\"https://data.onxecta.com/api/production/network/compressor/constraint\")\n   .method(\"POST\", body)\n   .addHeader(\"accept\", \"application/json\")\n   .addHeader(\"content-type\", \"application/json\")\n   .build();\nResponse response = client.newCall(request).execute();"
        }
      ],
      "selectedLanguageId": "y8ArmU5RWDWrDmoTrK4TK"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// OK\n[\n  {\n    \"xid\": \"\",\n    \"compressorXid\": \"\",\n    \"sourceNetworkId\": \"\",\n    \"sourceCompressorId\": \"\",\n    \"sourceId\": \"\",\n    \"date\": \"\",\n    \"maxGasLiftInjectionRate\": \"\",\n    \"maxGasLiftInjectionPressure\": \"\"\n  }\n]"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}