Skip to content
WhatSync/DocsAPI v1

Update WhatsApp sync settings

Change what WhatSync saves: pause or resume all saving (syncEnabled; paused also blocks sends, and the owner sees it in Settings), turn saving of one-to-one chats on or off, select groups, switch the people list between include and exclude, or set the time zone.

POST/api/v1/tools/update_sync_settingsWrite
Key permissions
Read chats and messages + Change saved chats and filters
Authentication
Authorization: Bearer $WHATSYNC_API_KEY
How keys work

How it works

  • Changing the mode reinterprets the existing people list; read the settings first.
  • Turning one-to-one saving off stops new direct chats being saved and hides saved contacts; it does not delete history.
  • Sending is not changed here: use turn_off_sending.

Body parameters

idempotencyKeystringbody or header

A fresh random UUID for each new action; never build it from dates, names, counters or step numbers, which repeat across runs. Reuse it exactly only to retry the same action.

syncEnabledbooleanoptional

See the example and input schema for this value.

directChatSyncEnabledbooleanoptional

See the example and input schema for this value.

groupSyncEnabledbooleanoptional

See the example and input schema for this value.

selectedGroupsobject[]optional

See the example and input schema for this value.

groupModeselected | all_exceptoptional

See the example and input schema for this value.

excludedGroupsobject[]optional

See the example and input schema for this value.

consentbooleanoptional

Explicit permission to save all current and future groups when switching to all_except.

numberFilterModeinclude | excludeoptional

See the example and input schema for this value.

timezonestringoptional

IANA timezone such as Asia/Kolkata

fromNumberstringoptional

Which of the account's WhatsApp numbers acts, with country code, as listed in whatsapp_numbers from get_account_context. Only matters when the account has several numbers. Omit for the account's first number.

Conditions and pagination

  • Supply the settings you intend to change; omitted settings are preserved. Enabling group sync requires at least one selected group. Inspect current settings first.
  • Use a unique idempotency key for each intended action. Reuse the same key and exactly the same input on a retry. The body key takes precedence over Idempotency-Key.

Response

The response wraps tool-specific data in result. Save operation_id and inspect get_operation with operationId if the outcome is uncertain. completed means the operation completed; it does not prove message delivery or Meta approval. An uncertain operation returns HTTP 409 with error.operation_id.

Every response includes X-Request-Id. Errors use the shared error format and retry rules.

Schemas

Input JSON Schema
Input JSON Schema
{
  "type": "object",
  "properties": {
    "idempotencyKey": {
      "type": "string",
      "pattern": "^[A-Za-z0-9._:-]{8,128}$",
      "description": "A fresh random UUID for each new action; never build it from dates, names, counters or step numbers, which repeat across runs. Reuse it exactly only to retry the same action."
    },
    "syncEnabled": {
      "type": "boolean"
    },
    "directChatSyncEnabled": {
      "type": "boolean"
    },
    "groupSyncEnabled": {
      "type": "boolean"
    },
    "selectedGroups": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "jid": {
            "type": "string",
            "pattern": "^\\d[\\d-]*@g\\.us$"
          },
          "name": {
            "type": "string",
            "maxLength": 100
          }
        },
        "required": [
          "jid"
        ],
        "additionalProperties": false
      },
      "maxItems": 500
    },
    "groupMode": {
      "type": "string",
      "enum": [
        "selected",
        "all_except"
      ]
    },
    "excludedGroups": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "jid": {
            "$ref": "#/properties/selectedGroups/items/properties/jid"
          },
          "name": {
            "type": "string",
            "maxLength": 100
          }
        },
        "required": [
          "jid"
        ],
        "additionalProperties": false
      },
      "maxItems": 500
    },
    "consent": {
      "type": "boolean",
      "description": "Explicit permission to save all current and future groups when switching to all_except."
    },
    "numberFilterMode": {
      "type": "string",
      "enum": [
        "include",
        "exclude"
      ]
    },
    "timezone": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64,
      "description": "IANA timezone such as Asia/Kolkata"
    },
    "fromNumber": {
      "type": "string",
      "minLength": 7,
      "maxLength": 30,
      "description": "Which of the account's WhatsApp numbers acts, with country code, as listed in whatsapp_numbers from get_account_context. Only matters when the account has several numbers. Omit for the account's first number."
    }
  },
  "required": [
    "idempotencyKey"
  ],
  "additionalProperties": false,
  "$schema": "http://json-schema.org/draft-07/schema#"
}
Response JSON Schema
Response JSON Schema
{
  "type": "object",
  "properties": {
    "operation_id": {
      "type": "string",
      "format": "uuid"
    },
    "status": {
      "type": "string",
      "enum": [
        "completed"
      ]
    },
    "replayed": {
      "type": "boolean"
    },
    "result": {
      "type": "object",
      "properties": {
        "changed": {
          "type": "boolean"
        },
        "sync_enabled": {
          "type": "boolean"
        },
        "direct_chat_sync_enabled": {
          "type": "boolean"
        },
        "group_sync_enabled": {
          "type": "boolean"
        },
        "selected_groups": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "jid": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [],
            "additionalProperties": true
          }
        },
        "number_filter_mode": {
          "type": "string"
        },
        "timezone": {
          "type": "string"
        },
        "note": {
          "type": "string"
        }
      },
      "required": [],
      "additionalProperties": true
    },
    "note": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "operation_id",
    "status",
    "result"
  ],
  "additionalProperties": true
}