Update Network Config
Updates the operational configuration settings for a network, such as timeout and processing behavior flags.
Endpoint
POST /v2/networks/update-config
Request Body
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
networkId | integer | Yes | — | ID of the network to configure |
Additional configuration fields are network-specific. Contact ECGrid support or refer to the live Swagger UI for the full field list applicable to your account tier.
{
"networkId": 1001
}
Response
Returns a success indicator confirming the configuration was saved.
{
"success": true,
"data": null,
"errorCode": null,
"message": "Network configuration updated."
}
Code Examples
- cURL
- C#
- Java
- Node.js
- Python
curl -X POST "https://rest.ecgrid.io/v2/networks/update-config" \
-H "X-API-Key: $ECGRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "networkId": 1001 }'
// .NET 10 — update network configuration
var payload = new
{
networkId = 1001
// add additional config fields as returned by the Swagger spec for your account
};
var request = new HttpRequestMessage(HttpMethod.Post, "https://rest.ecgrid.io/v2/networks/update-config")
{
Content = JsonContent.Create(payload)
};
request.Headers.Add("X-API-Key", configuration["ECGrid:ApiKey"]);
var response = await httpClient.SendAsync(request);
response.EnsureSuccessStatusCode();
var result = await response.Content.ReadFromJsonAsync<ApiResponse<object>>();
Console.WriteLine($"Config update succeeded: {result?.Success}");
import java.net.URI;
import java.net.http.*;
String apiKey = System.getenv("ECGRID_API_KEY");
String body = "{ \"networkId\": 1001 }";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://rest.ecgrid.io/v2/networks/update-config"))
.header("X-API-Key", apiKey)
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
HttpClient client = HttpClient.newHttpClient();
HttpResponse<String> response = client.send(
request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
const apiKey = process.env.ECGRID_API_KEY;
const url = 'https://rest.ecgrid.io/v2/networks/update-config';
const response = await fetch(url, {
method: 'POST',
headers: {
'X-API-Key': apiKey,
'Content-Type': 'application/json',
},
body: JSON.stringify({ "networkId": 1001 }),
});
const data = await response.json();
console.log(data);
import os, requests
api_key = os.environ["ECGRID_API_KEY"]
headers = {"X-API-Key": api_key}
url = "https://rest.ecgrid.io/v2/networks/update-config"
response = requests.post(
url,
json={ "networkId": 1001 },
headers=headers,
)
response.raise_for_status()
print(response.json())