# update_site_messages

Source: https://modulify.ai/docs/api/messages/update-site-messages

Turns texting on or off for a site, or sets the countries it may text.

- Title: Change how a site texts
- Scope: `config:write`
- Access: Makes changes
- Endpoint: `POST /v1/update_site_messages`

Send only what changes. Texting is on for every site until someone turns it off, and `enabled` false refuses every text from the site until it is turned back on. `countries` replaces the whole list, up to 5 countries on Pro, and a text to any other country is refused. `list_site_message_countries` finds the codes. `allCountries` true picks every country texts can go to in one go, and is refused when the site's plan allows fewer countries than that. Send `countries` or `allCountries`, not both. Texts to US numbers go out from a US number of the site's own, which needs a paid plan, and adding `US` on a paid plan gets the site that number, see [Countries](https://modulify.ai/docs/built-in/messages#countries). The tool tells the client to ask you first before it adds `US` and before it turns texting off. See [Turn texting off and on](https://modulify.ai/docs/built-in/messages#turn-texting-off-and-on).

## Request

Call it with a `POST` to `https://api.modulify.ai/v1/update_site_messages`, sending the inputs below as a JSON object. The token needs the `config:write` scope.

It makes changes, so send an [Idempotency-Key](https://modulify.ai/docs/api/idempotency) header whenever you might retry it. A retry with the same key gets the first answer back instead of running again.

```bash
curl -X POST https://api.modulify.ai/v1/update_site_messages \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"projectId":"PROJECT_ID"}'
```

Over MCP, the same method is the [update_site_messages tool](https://modulify.ai/docs/mcp/messages/update-site-messages).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `projectId` | string | Yes | The site id. |
| `enabled` | boolean | No | Turn texting on or off. |
| `countries` | array of strings | No | Every ISO country code the site may text, replacing the list. |
| `allCountries` | boolean | No | True to pick every country texts can go to, when the plan allows that many. |

## Response

Every call answers with the [JSON envelope](https://modulify.ai/docs/api/requests-and-responses#the-response) of `success`, `message`, `data`, `code` and `version`. `data` holds the result described above, and on a method that returns a total, `count` carries it. The [response headers](https://modulify.ai/docs/api/requests-and-responses#headers-on-every-method-call) carry the call's `X-Request-Id` and what is left of your per-minute budget in `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. [Errors](https://modulify.ai/docs/api/errors) explains every status code a call can answer with.