Check IP Whitelist
curl --request GET \
--url https://api.yativo.com/api/v1/ip-whitelist/check \
--header 'X-Api-Key: <api-key>' \
--header 'X-Api-Secret: <api-key>'import requests
url = "https://api.yativo.com/api/v1/ip-whitelist/check"
headers = {
"X-Api-Key": "<api-key>",
"X-Api-Secret": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Api-Key': '<api-key>', 'X-Api-Secret': '<api-key>'}
};
fetch('https://api.yativo.com/api/v1/ip-whitelist/check', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.yativo.com/api/v1/ip-whitelist/check",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <api-key>",
"X-Api-Secret: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.yativo.com/api/v1/ip-whitelist/check"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("X-Api-Secret", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.yativo.com/api/v1/ip-whitelist/check")
.header("X-Api-Key", "<api-key>")
.header("X-Api-Secret", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yativo.com/api/v1/ip-whitelist/check")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
request["X-Api-Secret"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "success",
"status_code": 200,
"message": "<string>",
"data": {
"key_usage": {
"authenticated_with_api_key": true,
"key": "yativo_pk_9f1c2a...",
"request_ip": "203.0.113.10",
"allowed_server": true,
"matched_entry": "203.0.113.10",
"message": "<string>"
},
"result": "pass",
"summary": "203.0.113.10 passes the IP whitelist.",
"tested_ip": "203.0.113.10",
"tested_ip_source": "detected",
"network": {
"detected_ip": "203.0.113.10",
"warning": "<string>"
},
"api_key": {
"key": "yativo_pk_9f1c2a...",
"label": "Production backend",
"key_allowed_ips": [
"<string>"
],
"account_whitelisted_ips": [
"<string>"
],
"matched_entry": "<string>",
"would_allow": true,
"would_return": {
"http_status": 403,
"error": "This IP address is not allowed to use this API key."
}
},
"sitewide": {
"account_whitelisted_ips": [
"<string>"
],
"matches_own_account_ip": true,
"would_allow": true,
"would_return": {
"http_status": 123,
"error": "<string>"
}
}
}
}{
"status": "failed",
"status_code": 123,
"message": "Request failed.",
"data": {
"error": "<string>"
},
"error_details": {
"code": "validation_error",
"message": "The amount field is required.",
"http_status": 422,
"fields": {},
"retryable": false,
"retry_after": 123
}
}{
"status": "failed",
"status_code": 123,
"message": "Request failed.",
"data": {
"error": "<string>"
},
"error_details": {
"code": "validation_error",
"message": "The amount field is required.",
"http_status": 422,
"fields": {},
"retryable": false,
"retry_after": 123
}
}IP Whitelist
Check IP Whitelist
See the IP Yativo detects for your request and whether it can use your API key
GET
/
ip-whitelist
/
check
Check IP Whitelist
curl --request GET \
--url https://api.yativo.com/api/v1/ip-whitelist/check \
--header 'X-Api-Key: <api-key>' \
--header 'X-Api-Secret: <api-key>'import requests
url = "https://api.yativo.com/api/v1/ip-whitelist/check"
headers = {
"X-Api-Key": "<api-key>",
"X-Api-Secret": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Api-Key': '<api-key>', 'X-Api-Secret': '<api-key>'}
};
fetch('https://api.yativo.com/api/v1/ip-whitelist/check', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.yativo.com/api/v1/ip-whitelist/check",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <api-key>",
"X-Api-Secret: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.yativo.com/api/v1/ip-whitelist/check"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("X-Api-Secret", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.yativo.com/api/v1/ip-whitelist/check")
.header("X-Api-Key", "<api-key>")
.header("X-Api-Secret", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yativo.com/api/v1/ip-whitelist/check")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
request["X-Api-Secret"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "success",
"status_code": 200,
"message": "<string>",
"data": {
"key_usage": {
"authenticated_with_api_key": true,
"key": "yativo_pk_9f1c2a...",
"request_ip": "203.0.113.10",
"allowed_server": true,
"matched_entry": "203.0.113.10",
"message": "<string>"
},
"result": "pass",
"summary": "203.0.113.10 passes the IP whitelist.",
"tested_ip": "203.0.113.10",
"tested_ip_source": "detected",
"network": {
"detected_ip": "203.0.113.10",
"warning": "<string>"
},
"api_key": {
"key": "yativo_pk_9f1c2a...",
"label": "Production backend",
"key_allowed_ips": [
"<string>"
],
"account_whitelisted_ips": [
"<string>"
],
"matched_entry": "<string>",
"would_allow": true,
"would_return": {
"http_status": 403,
"error": "This IP address is not allowed to use this API key."
}
},
"sitewide": {
"account_whitelisted_ips": [
"<string>"
],
"matches_own_account_ip": true,
"would_allow": true,
"would_return": {
"http_status": 123,
"error": "<string>"
}
}
}
}{
"status": "failed",
"status_code": 123,
"message": "Request failed.",
"data": {
"error": "<string>"
},
"error_details": {
"code": "validation_error",
"message": "The amount field is required.",
"http_status": 422,
"fields": {},
"retryable": false,
"retry_after": 123
}
}{
"status": "failed",
"status_code": 123,
"message": "Request failed.",
"data": {
"error": "<string>"
},
"error_details": {
"code": "validation_error",
"message": "The amount field is required.",
"http_status": 422,
"fields": {},
"retryable": false,
"retry_after": 123
}
}Call this from the server that uses your API key. It never blocks the request, so you can run it any time, including right after changing a key’s allowed IPs.
key_usage.allowed_serveristruewhen the calling server can use the key.key_usage.request_ipis the IP to whitelist if it isn’t the one you expected.- Add
?ip=<address>to test a server you haven’t deployed yet.
Authorizations
Your API key (yativo_pk_...) from Developers → API Keys. Send together with X-Api-Secret.
Your API secret (yativo_sk_...), shown once when the key is created.
Query Parameters
Check this IP against your whitelist instead of the detected one. key_usage still describes the calling server.
Example:
"198.51.100.7"

