# list_site_message_countries

Source: https://modulify.ai/docs/api/messages/list-site-message-countries

Lists every country texts can go to, with its code, its name, what one SMS part to it costs and whether the site may text it now.

- Title: Find the countries a site can text
- Scope: `config:read`
- Access: Read only
- Endpoint: `POST /v1/list_site_message_countries`

It is the same list as **Countries** on the **Settings** tab of the **Messages** tab, more than 230 countries. Each one has its ISO `code`, its English `name`, `credits`, what one SMS part to it costs, and `selected`, whether the site may text it now. The countries the site may text come first, then the rest by name.

`query` keeps the countries whose name or code holds every word of it, ignoring case and accents, so `port` finds Portugal and `PT` finds it by its code. `selectedOnly` true keeps only the countries the site may text. The answer also carries `selected`, the codes the site may text, `max`, how many countries the site's plan lets it pick, and `total`, how many countries texts can go to. Pick countries with `update_site_messages`. See [Countries](https://modulify.ai/docs/built-in/messages#countries).

## Request

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

It only reads and changes nothing, so retrying it is safe.

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

Over MCP, the same method is the [list_site_message_countries tool](https://modulify.ai/docs/mcp/messages/list-site-message-countries).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `projectId` | string | Yes | The site id. |
| `query` | string | No | Words to find in the country name or code, such as port or PT. |
| `selectedOnly` | boolean | No | True to list only the countries the site may text. |

## 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.