Skip to main content

Get Static IPs

API to retrieve the primary and optional secondary static IP addresses registered for your user account (static IPs are managed at user level). The same registration applies regardless of which OAuth client issued your token.

When static-IP enforcement applies to order placement, requests from unregistered IPs may fail. For My Apps UI steps and platform rules, see the My Apps guide.

Registered addresses are returned in standard IPv4 or IPv6 notation.

Request

curl --location 'https://api.upstox.com/v2/user/ip' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your_access_token}'

For additional samples in various languages, please refer to the Sample code section on this page.


Responses

Response Body

{
"status": "success",
"data": {
"user_id": "858644",
"primary_ip": "122.181.101.247",
"secondary_ip": "128.1.1.2",
"primary_ip_updated_at": "2026-04-03 17:17:50",
"secondary_ip_updated_at": "2026-04-03 17:17:50"
}
}
NameTypeDescription
statusstringOutcome of the request. Typically success for successful operations.
dataobjectUser-level static IP configuration for the authenticated account.
data.user_idstringUpstox user_id for the authenticated account.
data.primary_ipstringRegistered primary static IP (IPv4 or IPv6, standard notation) from which API order traffic must originate once enforcement is active.
data.secondary_ipstringRegistered secondary static IP (IPv4 or IPv6, standard notation) for backup or failover, if configured. May be omitted or null if never set.
data.primary_ip_updated_atstringTimestamp when the primary IP was last updated (server time).
data.secondary_ip_updated_atstringTimestamp when the secondary IP was last updated, if configured. May be omitted or null if never set.

Sample Code

Get static IPs for the authenticated user

import requests

url = 'https://api.upstox.com/v2/user/ip'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {your_access_token}'
}

response = requests.get(url, headers=headers)

print(response.text)
Loading...