# IP address allowlist

https://docs.sendsms.to/en/guides/ip-allowlist/

The API accepts requests with a key only from the addresses you listed for that key, so a stolen key cannot be used to send spam from someone else’s server.

## Steps

1. When creating a key in API and integrations, fill in the required Allowed IP addresses field: one address or subnet per line, up to 20 entries. Add my address inserts the address you opened the cabinet from; if your server calls the API, enter the server’s address.
2. You can list single IPv4 (203.0.113.10) and IPv6 (2001:db8::10) addresses and subnets: IPv4 no wider than /24 (for example 203.0.113.0/28), IPv6 no wider than /48. 0.0.0.0/0, ::/0 and other overly wide subnets are rejected.
3. A request from an address that is not listed, or with a key that has no addresses, receives 403 with error: ip_not_allowed. The response contains clientIp — the address we see your request from; the key’s address list itself is never disclosed.
4. Before your server’s address changes (migration, new hosting, NAT, load balancer), first add the new address to the key (Change addresses), switch traffic, and only then remove the old address, so sending is not interrupted.
5. If your server reaches the internet over IPv6, add its IPv6 address or subnet: IPv4 and IPv6 addresses are checked separately. Keys issued before this rule are marked in the cabinet with No IP restriction — add addresses: add addresses before such keys are switched off.

## Keep in mind

A 403 ip_not_allowed response does not consume balance and does not create a message. Every change of the address list is recorded in the cabinet audit log.
