Update Mailbox Config
Updates the operational configuration settings for a mailbox, such as processing options and delivery behavior.
Endpoint
POST /v2/mailboxes/update-config
Request Body
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
mailboxId | integer | Yes | — | ID of the mailbox to configure |
Additional configuration fields are mailbox-specific. Refer to the live Swagger UI for the full field list applicable to your account tier.
{
"mailboxId": 5001
}
Response
Returns a success indicator confirming the configuration was saved.
{
"success": true,
"data": null,
"errorCode": null,
"message": "Mailbox configuration updated."
}
Code Examples
- cURL
- C#
- Java
- Node.js
- Python
curl -X POST "https://rest.ecgrid.io/v2/mailboxes/update-config" \
-H "X-API-Key: $ECGRID_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "mailboxId": 5001 }'
// .NET 10 — update mailbox configuration settings
var payload = new
{
mailboxId = 5001
// add additional config fields as returned by the Swagger spec for your account
};
var request = new HttpRequestMessage(HttpMethod.Post, "https://rest.ecgrid.io/v2/mailboxes/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 = "{ \"mailboxId\": 5001 }";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://rest.ecgrid.io/v2/mailboxes/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/mailboxes/update-config';
const response = await fetch(url, {
method: 'POST',
headers: {
'X-API-Key': apiKey,
'Content-Type': 'application/json',
},
body: JSON.stringify({ "mailboxId": 5001 }),
});
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/mailboxes/update-config"
response = requests.post(
url,
json={ "mailboxId": 5001 },
headers=headers,
)
response.raise_for_status()
print(response.json())