> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getmcp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Settings

> Partially update plugin settings.

Updates one or more plugin settings. Only include the fields you want to change. Returns the complete updated settings object.

## Body Parameters

<ParamField body="default_rate_limit" type="integer">
  Default rate limit (requests per minute) for new servers.
</ParamField>

<ParamField body="default_timeout" type="integer">
  Default request timeout in seconds for new tools.
</ParamField>

<ParamField body="log_retention_days" type="integer">
  How many days to keep call log entries. Set to 0 for indefinite retention.
</ParamField>

<ParamField body="analytics_retention_days" type="integer">
  How many days to keep aggregated daily analytics.
</ParamField>

<ParamField body="log_response_data" type="boolean">
  Whether to store API response bodies in call logs. Disabled by default for privacy.
</ParamField>

<ParamField body="enable_health_checks" type="boolean">
  Enable or disable background health checks.
</ParamField>

<ParamField body="health_check_interval" type="integer">
  Health check interval in minutes.
</ParamField>

<ParamField body="notification_email" type="string">
  Email address for alert notifications.
</ParamField>

<ParamField body="enable_email_alerts" type="boolean">
  Enable or disable email alerts.
</ParamField>

<ParamField body="usage_alert_threshold" type="integer">
  Calls per hour threshold that triggers an alert email.
</ParamField>

<ParamField body="keep_data_on_uninstall" type="boolean">
  If `true`, all plugin data is preserved when the plugin is deleted.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request PATCH \
       --url https://yoursite.com/wp-json/getmcp/v1/settings \
       --header 'Authorization: Bearer gmcp_your_api_key' \
       --header 'content-type: application/json' \
       --data '
  {
    "log_retention_days": 60,
    "analytics_retention_days": 180,
    "enable_email_alerts": true,
    "notification_email": "ops@yourcompany.com",
    "usage_alert_threshold": 500
  }
  '
  ```

  ```python Python theme={null}
  import requests
  response = requests.patch(
      "https://yoursite.com/wp-json/getmcp/v1/settings",
      headers={
          "Authorization": "Bearer gmcp_your_api_key",
          "Content-Type": "application/json"
      },
      json={
          "log_retention_days": 60,
          "analytics_retention_days": 180,
          "enable_email_alerts": True,
          "notification_email": "ops@yourcompany.com",
          "usage_alert_threshold": 500
      }
  )
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://yoursite.com/wp-json/getmcp/v1/settings",
    {
      method: "PATCH",
      headers: {
        "Authorization": "Bearer gmcp_your_api_key",
        "Content-Type": "application/json"
      },
      body: JSON.stringify({
        log_retention_days: 60,
        analytics_retention_days: 180,
        enable_email_alerts: true,
        notification_email: "ops@yourcompany.com",
        usage_alert_threshold: 500
      })
    }
  );
  const data = await response.json();
  ```

  ```php PHP theme={null}
  $response = wp_remote_request(
      "https://yoursite.com/wp-json/getmcp/v1/settings",
      [
          "method"  => "PATCH",
          "headers" => [
              "Authorization" => "Bearer gmcp_your_api_key",
              "Content-Type"  => "application/json"
          ],
          "body" => json_encode([
              "log_retention_days"       => 60,
              "analytics_retention_days" => 180,
              "enable_email_alerts"      => true,
              "notification_email"       => "ops@yourcompany.com",
              "usage_alert_threshold"    => 500
          ])
      ]
  );
  $data = json_decode(wp_remote_retrieve_body($response), true);
  ```

  ```go Go theme={null}
  package main
  import (
  	"fmt"
  	"io"
  	"net/http"
  	"strings"
  )

  func main() {
  	body := strings.NewReader(`{
    "log_retention_days": 60,
    "analytics_retention_days": 180,
    "enable_email_alerts": true,
    "notification_email": "ops@yourcompany.com",
    "usage_alert_threshold": 500
  }`)

  	req, _ := http.NewRequest("PATCH", "https://yoursite.com/wp-json/getmcp/v1/settings", body)
  	req.Header.Set("Authorization", "Bearer gmcp_your_api_key")
  	req.Header.Set("Content-Type", "application/json")

  	client := &http.Client{}
  	resp, _ := client.Do(req)
  	defer resp.Body.Close()
  	data, _ := io.ReadAll(resp.Body)
  	fmt.Println(string(data))
  }
  ```

  ```java Java theme={null}
  import java.net.URI;
  import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;

  public class Main {
      public static void main(String[] args) throws Exception {
          String json = "{\n  \"log_retention_days\": 60,\n  \"analytics_retention_days\": 180,\n  \"enable_email_alerts\": true,\n  \"notification_email\": \"ops@yourcompany.com\",\n  \"usage_alert_threshold\": 500\n}";

          HttpRequest request = HttpRequest.newBuilder()
              .uri(URI.create("https://yoursite.com/wp-json/getmcp/v1/settings"))
              .header("Authorization", "Bearer gmcp_your_api_key")
              .header("Content-Type", "application/json")
              .method("PATCH", HttpRequest.BodyPublishers.ofString(json))
              .build();

          HttpClient client = HttpClient.newHttpClient();
          HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
          System.out.println(response.body());
      }
  }
  ```

  ```ruby Ruby theme={null}
  require 'net/http'
  require 'json'
  require 'uri'

  uri = URI('https://yoursite.com/wp-json/getmcp/v1/settings')
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = uri.scheme == 'https'

  request = Net::HTTP::Patch.new(uri)
  request['Authorization'] = 'Bearer gmcp_your_api_key'
  request['Content-Type'] = 'application/json'
  request.body = '{
    "log_retention_days": 60,
    "analytics_retention_days": 180,
    "enable_email_alerts": true,
    "notification_email": "ops@yourcompany.com",
    "usage_alert_threshold": 500
  }'

  response = http.request(request)
  puts JSON.parse(response.body)
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "default_rate_limit": 60,
    "default_timeout": 30,
    "log_retention_days": 60,
    "analytics_retention_days": 180,
    "log_response_data": false,
    "enable_health_checks": true,
    "health_check_interval": 60,
    "notification_email": "ops@yourcompany.com",
    "enable_email_alerts": true,
    "usage_alert_threshold": 500,
    "keep_data_on_uninstall": false
  }
  ```
</ResponseExample>
