SET Merchant API · API keys
Pin a key to your servers' addresses
POST/v1/api_keys/{id}/allowed_cidrs
Sets the addresses an active key may be used from: up to 20 IPv4 or IPv6 addresses or CIDR ranges, or [] for any address. A request with the key from anywhere else is refused with 403 ip_not_allowed. Event api_key.allowed_cidrs_changed.
Path parameters
idstringrequired- The key's id.
Headers
Idempotency-Keystring- Optional. The same key and body run once; a replay answers with
Idempotent-Replayed: true. Kept 24 hours.
Body
allowedCidrsstring[]required- The full list; it replaces the one before.
[]allows any address again.
Notes
- A key cannot shut itself out: changing the calling key's own list to one that leaves out the address you are calling from is
409 would_lock_out. Add the address, or make the change with another key. - The address checked is the one SET's network edge sees your request come from. A request that carries none is refused.
Errors
400 cidrs_invalid404 api_key_unknown409 would_lock_out401 api_key_required401 api_key_invalid401 api_key_wrong_mode403 scope_missing429 rate_limited