IP Update
POST /ip/ipUpdate
DEPRECATED
This endpoint is deprecated and will be removed in a future release. It authenticates with the trading-account password, which is no longer SEBI-compliant for API access (Feb 2025 guidelines).
Please migrate to the new flow:
- Use the Web Dashboard — handles both first-time registration and subsequent updates with
apiKey+apiSecret-based authentication.
The endpoint below continues to work for existing integrations but should not be used for new ones.
The IP Update API is used to update the primary and/or secondary static IP addresses for a client. Once the IPs are updated, the client can access the APIs only from the newly registered IP addresses.
A user is allowed to update the IP addresses once every 7 days from their last change (per SEBI A.6). The IP address must be a valid IPv4 address. If a user tries to access the API from any other IP address, the request will be rejected with an error.
Parameter
| Name | Type | Required | Description |
|---|---|---|---|
clientId | string | true | The unique identification code assigned to you by SAMCO upon the successful opening of your trading account. |
password | string | true | Use the password set via any SAMCO platform (SAMCO Mobile App, SAMCO Web, or Stockbasket). If no password was set, use the one sent to you in the welcome email when you opened your account. |
primaryIp | string | true | The primary static IP address from which API access is allowed. |
secondaryIp | string | false | The secondary static IP address from which API access is allowed. This acts as a backup IP. |
Sample Request Body
requestBody={
"clientId" : "DV99999",
"primaryIp" : "XXX.XX.XX.XXX",
"secondaryIp" : "XXX.XX.XX.XXX",
"password" : "abc1234"
}Sample Code
var headers = {
'Content-Type' : 'application/json',
'Accept' : 'application/json'
};
$.ajax({
url : 'https://tradeapi.samco.in/ip/ipUpdate',
method : 'post',
data : JSON.stringify(requestBody),
headers : headers,
success : function(data){
console.log(JSON.stringify(data));
},
error : function(error){
console.log(error);
}
})import requests
import json
headers = {
'Content-Type' : 'application/json',
'Accept' : 'application/json'
}
r = requests.post('https://tradeapi.samco.in/ip/ipUpdate',
data=json.dumps(requestBody),
headers = headers)
print (r.json())Sample Response
{
"serverTime": "29/01/26 10:46:06",
"msgId": "d5f083f3-1b04-4b97-9385-1e578fdfeb7a",
"status": "Success",
"statusMessage": "Client IPs updated successfully",
"data": {
"user_id": "DV99999",
"primary_ip": "XXX.XX.XX.XXX",
"secondary_ip": "XXX.XX.XX.XXX",
"ip_updated_at": "2026-01-29T05:16:07.000Z"
}
}{
"serverTime": "29/01/26 11:12:30",
"msgId": "80898911-95f9-4423-8615-f920400a574f",
"status": "Failure",
"statusMessage": "IP update allowed only once per calendar week"
}{
"serverTime": "29/01/26 10:48:08",
"msgId": "7e7674d0-65e8-43f7-8e66-a681fb60bfb2",
"status": "Failure",
"statusMessage": "Incorrect Password"
}Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
serverTime | string | The date and time when the server generated the response. |
msgId | string | A unique identifier for the API response message. Useful for tracking or debugging purposes. |
status | string | The status of the API response. Possible values are 'Success', 'Error', or 'Failure'. |
statusMessage | string | A message describing the result of the API call. |
data | Object | Contains the registered IP details of the user. |
user_id | string | The unique client ID provided by SAMCO after account creation. |
primary_ip | string | The registered primary static IP address of the user. |
secondary_ip | string | The registered secondary static IP address of the user. |
ip_updated_at | string | The date and time when the IP address was last updated. |