Detect IP Address
Detect the caller's public IP address as seen by EntryGuard. This is useful for debugging which IP will be whitelisted when starting a session.
Request
GET /detect-ip
Authentication
No authentication required. This endpoint is public.
Response
Returns a JSON object containing the detected IP address and its version.
Status Code: 200 OK
Response Body:
| Field | Type | Description |
|---|---|---|
| ip | string | The detected IP address |
| version | integer | IP version (4 for IPv4, 6 for IPv6) |
| timestamp | string | ISO 8601 timestamp of the detection |
Note: The IP address is extracted from the X-Forwarded-For header if the request is behind a proxy, otherwise it uses the direct connection IP.
Example
curl https://api.entryguard.io/api/v1/detect-ip
Response (IPv4):
{
"ip": "203.45.67.89",
"version": 4,
"timestamp": "2024-01-15T10:30:00Z"
}
Response (IPv6):
{
"ip": "2001:0db8:85a3:0000:0000:8a2e:0370:7334",
"version": 6,
"timestamp": "2024-01-15T10:30:00Z"
}