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

# Update Settings

> Updates the instance behavior settings

**Auth:** `TokenAccount` or `TokenInstance` • **Rate-limit:** `Global` (100/min) • **Idempotent:** yes

## Description

Accepts a **partial body**, fields not sent are kept. At least one field must be informed.

If `keepOnlineStatus` is sent **and** the instance is connected, presence is applied in real time (sends `PresenceAvailable` or `PresenceUnavailable`).

## Examples

### Change only autoReadMessages

Partial body with only `autoReadMessages: true`, the other 6 settings are untouched, the server only updates the field sent and returns the full object in the response.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/instance/settings/my-instance" \
    -H "token: $Token_Instance" \
    -H "Content-Type: application/json" \
    -d '{"autoReadMessages":true}'
  ```

  ```javascript JavaScript theme={null}
  await fetch("https://ryzeapi.cloud/api/instance/settings/my-instance", {
    method: "POST",
    headers: {
      "token":        process.env.Token_Instance,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({ autoReadMessages: true })
  });
  ```

  ```python Python theme={null}
  import os, requests

  requests.post(
      "https://ryzeapi.cloud/api/instance/settings/my-instance",
      headers={
          "token":        os.environ["Token_Instance"],
          "Content-Type": "application/json"
      },
      json={"autoReadMessages": True}
  )
  ```

  ```go Go theme={null}
  package main

  import (
      "net/http"
      "os"
      "strings"
  )

  func main() {
      body := strings.NewReader(`{"autoReadMessages":true}`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/instance/settings/my-instance", body)
      req.Header.Set("token", os.Getenv("Token_Instance"))
      req.Header.Set("Content-Type", "application/json")
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

### Anti-noise combo

Applies four settings at once to silence the number: ignores group messages, ignores stories, rejects calls, and replies to the caller with the `callRejectMessage`. Typical combination for 1-to-1 bots that don't want to be interrupted.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/instance/settings/my-instance" \
    -H "token: $Token_Instance" \
    -H "Content-Type: application/json" \
    -d '{
      "ignoreGroupMessages": true,
      "ignoreStatus": true,
      "autoRejectCalls": true,
      "callRejectMessage": "I do not take calls here."
    }'
  ```

  ```javascript JavaScript theme={null}
  await fetch("https://ryzeapi.cloud/api/instance/settings/my-instance", {
    method: "POST",
    headers: {
      "token":        process.env.Token_Instance,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      ignoreGroupMessages: true,
      ignoreStatus:        true,
      autoRejectCalls:     true,
      callRejectMessage:   "I do not take calls here."
    })
  });
  ```

  ```python Python theme={null}
  import os, requests

  requests.post(
      "https://ryzeapi.cloud/api/instance/settings/my-instance",
      headers={
          "token":        os.environ["Token_Instance"],
          "Content-Type": "application/json"
      },
      json={
          "ignoreGroupMessages": True,
          "ignoreStatus":        True,
          "autoRejectCalls":     True,
          "callRejectMessage":   "I do not take calls here."
      }
  )
  ```

  ```go Go theme={null}
  package main

  import (
      "net/http"
      "os"
      "strings"
  )

  func main() {
      body := strings.NewReader(`{
          "ignoreGroupMessages": true,
          "ignoreStatus":        true,
          "autoRejectCalls":     true,
          "callRejectMessage":   "I do not take calls here."
      }`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/instance/settings/my-instance", body)
      req.Header.Set("token", os.Getenv("Token_Instance"))
      req.Header.Set("Content-Type", "application/json")
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

## Success response

The response includes **all 7 settings** (those not modified come with their current value from the database).

```json 200 OK theme={null}
{
  "success": true,
  "message": "Settings updated successfully",
  "settings": {
    "autoRejectCalls": true,
    "callRejectMessage": "I do not take calls here.",
    "ignoreGroupMessages": true,
    "keepOnlineStatus": false,
    "autoReadMessages": false,
    "disableHistorySync": true,
    "ignoreStatus": true
  }
}
```

## Path parameters

<ParamField path="instance" type="string" required>
  Instance name.
</ParamField>

## Headers

<ParamField header="token" type="string" required>
  TokenAccount or TokenInstance.
</ParamField>

<ParamField header="Content-Type" type="string" required>
  `application/json`.
</ParamField>

## Request body

<ParamField body="autoRejectCalls" type="boolean">
  Automatically rejects incoming calls.
</ParamField>

<ParamField body="callRejectMessage" type="string">
  Automatic message when rejecting a call.
</ParamField>

<ParamField body="ignoreGroupMessages" type="boolean">
  Does not process messages received in groups.
</ParamField>

<ParamField body="keepOnlineStatus" type="boolean">
  Keeps presence as `available`. Applied immediately if the instance is connected.
</ParamField>

<ParamField body="autoReadMessages" type="boolean">
  Marks received messages as read.
</ParamField>

<ParamField body="disableHistorySync" type="boolean" default="true">
  Disables history synchronization on the first `connect`. **Default `true`.**
</ParamField>

<ParamField body="ignoreStatus" type="boolean">
  Ignores "status" type messages (stories) from WhatsApp.
</ParamField>

## Notes

<Warning>
  `disableHistorySync=true` on update **does not delete** already imported history; it only affects future `connect` calls.
</Warning>

<Note>
  Applying `ignoreGroupMessages=true` **does not** delete already recorded group messages; it just stops recording new ones.
</Note>

## Errors

| HTTP | `error.message`                           | When                      |
| :--: | ----------------------------------------- | ------------------------- |
|  400 | `Invalid request body`                    | Malformed JSON.           |
|  400 | `At least one setting must be provided`   | Body without any field.   |
|  401 | `Invalid token`                           | Token missing or invalid. |
|  404 | `Instance not found`                      | Name does not exist.      |
|  429 | `Rate limit exceeded. Try again later.`   | More than 100 req/min.    |
|  500 | `Failed to update settings configuration` | Database error.           |

```json theme={null}
{
  "success": false,
  "error": {
    "message": "At least one setting must be provided"
  }
}
```
