curl --request PATCH \
--url https://public-api.etoro.com/api/v2/agent-portfolios/{agentPortfolioId}/user-tokens/{userTokenId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-request-id: <x-request-id>' \
--header 'x-user-key: <api-key>' \
--data '
{
"scopeNames": [
"etoro-public:trade.real:read",
"etoro-public:trade.real:write"
],
"ipsWhitelist": [
"192.168.1.1"
],
"expiresAt": "2026-12-31T23:59:59Z"
}
'import requests
url = "https://public-api.etoro.com/api/v2/agent-portfolios/{agentPortfolioId}/user-tokens/{userTokenId}"
payload = {
"scopeNames": ["etoro-public:trade.real:read", "etoro-public:trade.real:write"],
"ipsWhitelist": ["192.168.1.1"],
"expiresAt": "2026-12-31T23:59:59Z"
}
headers = {
"x-request-id": "<x-request-id>",
"x-api-key": "<api-key>",
"x-user-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'x-request-id': '<x-request-id>',
'x-api-key': '<api-key>',
'x-user-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
scopeNames: ['etoro-public:trade.real:read', 'etoro-public:trade.real:write'],
ipsWhitelist: ['192.168.1.1'],
expiresAt: '2026-12-31T23:59:59Z'
})
};
fetch('https://public-api.etoro.com/api/v2/agent-portfolios/{agentPortfolioId}/user-tokens/{userTokenId}', 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://public-api.etoro.com/api/v2/agent-portfolios/{agentPortfolioId}/user-tokens/{userTokenId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'scopeNames' => [
'etoro-public:trade.real:read',
'etoro-public:trade.real:write'
],
'ipsWhitelist' => [
'192.168.1.1'
],
'expiresAt' => '2026-12-31T23:59:59Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-request-id: <x-request-id>",
"x-user-key: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://public-api.etoro.com/api/v2/agent-portfolios/{agentPortfolioId}/user-tokens/{userTokenId}"
payload := strings.NewReader("{\n \"scopeNames\": [\n \"etoro-public:trade.real:read\",\n \"etoro-public:trade.real:write\"\n ],\n \"ipsWhitelist\": [\n \"192.168.1.1\"\n ],\n \"expiresAt\": \"2026-12-31T23:59:59Z\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-request-id", "<x-request-id>")
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-user-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://public-api.etoro.com/api/v2/agent-portfolios/{agentPortfolioId}/user-tokens/{userTokenId}")
.header("x-request-id", "<x-request-id>")
.header("x-api-key", "<api-key>")
.header("x-user-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"scopeNames\": [\n \"etoro-public:trade.real:read\",\n \"etoro-public:trade.real:write\"\n ],\n \"ipsWhitelist\": [\n \"192.168.1.1\"\n ],\n \"expiresAt\": \"2026-12-31T23:59:59Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.etoro.com/api/v2/agent-portfolios/{agentPortfolioId}/user-tokens/{userTokenId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-request-id"] = '<x-request-id>'
request["x-api-key"] = '<api-key>'
request["x-user-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"scopeNames\": [\n \"etoro-public:trade.real:read\",\n \"etoro-public:trade.real:write\"\n ],\n \"ipsWhitelist\": [\n \"192.168.1.1\"\n ],\n \"expiresAt\": \"2026-12-31T23:59:59Z\"\n}"
response = http.request(request)
puts response.read_bodyUpdate User Token (v2)
Rate limit: 60 requests per 60 seconds. This is the default shared quota — it is shared with every other endpoint that has no dedicated limit, so requests across those endpoints all draw from the same budget.
Updates the settings of an existing user token using scope names. At least one field must be provided. Scopes are specified by name (scopeNames); scope ids are not supported in v2.
curl --request PATCH \
--url https://public-api.etoro.com/api/v2/agent-portfolios/{agentPortfolioId}/user-tokens/{userTokenId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-request-id: <x-request-id>' \
--header 'x-user-key: <api-key>' \
--data '
{
"scopeNames": [
"etoro-public:trade.real:read",
"etoro-public:trade.real:write"
],
"ipsWhitelist": [
"192.168.1.1"
],
"expiresAt": "2026-12-31T23:59:59Z"
}
'import requests
url = "https://public-api.etoro.com/api/v2/agent-portfolios/{agentPortfolioId}/user-tokens/{userTokenId}"
payload = {
"scopeNames": ["etoro-public:trade.real:read", "etoro-public:trade.real:write"],
"ipsWhitelist": ["192.168.1.1"],
"expiresAt": "2026-12-31T23:59:59Z"
}
headers = {
"x-request-id": "<x-request-id>",
"x-api-key": "<api-key>",
"x-user-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'x-request-id': '<x-request-id>',
'x-api-key': '<api-key>',
'x-user-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
scopeNames: ['etoro-public:trade.real:read', 'etoro-public:trade.real:write'],
ipsWhitelist: ['192.168.1.1'],
expiresAt: '2026-12-31T23:59:59Z'
})
};
fetch('https://public-api.etoro.com/api/v2/agent-portfolios/{agentPortfolioId}/user-tokens/{userTokenId}', 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://public-api.etoro.com/api/v2/agent-portfolios/{agentPortfolioId}/user-tokens/{userTokenId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'scopeNames' => [
'etoro-public:trade.real:read',
'etoro-public:trade.real:write'
],
'ipsWhitelist' => [
'192.168.1.1'
],
'expiresAt' => '2026-12-31T23:59:59Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-request-id: <x-request-id>",
"x-user-key: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://public-api.etoro.com/api/v2/agent-portfolios/{agentPortfolioId}/user-tokens/{userTokenId}"
payload := strings.NewReader("{\n \"scopeNames\": [\n \"etoro-public:trade.real:read\",\n \"etoro-public:trade.real:write\"\n ],\n \"ipsWhitelist\": [\n \"192.168.1.1\"\n ],\n \"expiresAt\": \"2026-12-31T23:59:59Z\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-request-id", "<x-request-id>")
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-user-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://public-api.etoro.com/api/v2/agent-portfolios/{agentPortfolioId}/user-tokens/{userTokenId}")
.header("x-request-id", "<x-request-id>")
.header("x-api-key", "<api-key>")
.header("x-user-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"scopeNames\": [\n \"etoro-public:trade.real:read\",\n \"etoro-public:trade.real:write\"\n ],\n \"ipsWhitelist\": [\n \"192.168.1.1\"\n ],\n \"expiresAt\": \"2026-12-31T23:59:59Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.etoro.com/api/v2/agent-portfolios/{agentPortfolioId}/user-tokens/{userTokenId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-request-id"] = '<x-request-id>'
request["x-api-key"] = '<api-key>'
request["x-user-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"scopeNames\": [\n \"etoro-public:trade.real:read\",\n \"etoro-public:trade.real:write\"\n ],\n \"ipsWhitelist\": [\n \"192.168.1.1\"\n ],\n \"expiresAt\": \"2026-12-31T23:59:59Z\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
API key of the application. Only valid together with the x-user-key header — the pair is an alternative to OAuth bearer authentication, never sent alongside it. The pair is granted the same permissions the operation's OAuth scopes describe.
Demo credential for trying the API from these docs: lhgfaslk21490FAScVPkdsb53F9dNkfHG4faZSG5vfjndfcfgdssdgsdHF4663
User-specific authentication key. Only valid together with the x-api-key header — the pair is an alternative to OAuth bearer authentication, never sent alongside it.
Demo credential for trying the API from these docs: eyJlYW4iOiJVbnJlZ2lzdGVyZWRBcHBsaWNhdGlvbiIsImVrIjoiOE5sZ2cwcW5EUVdROUFNWGpXT2lmOWktZnpidG5KcUlqWGJ3WHJZZkpZcldrbG90ZEhvLVBjSWhQaU8xU1ZtMW84aU1WZGZqN2xWNzFjLXFxLmcybXE1dnh4Q1hUT25xaWRUaTFlcEhmVk1fIn0_
Headers
A unique request identifier.
"a4ef4d33-2615-4cdc-8fa2-67989ff77c0d"
Path Parameters
The unique identifier of the agent-portfolio.
The unique identifier of the user token to update.
Body
An updated set of permission scope names for the token. Available scopes: etoro-public:trade.real:read, etoro-public:trade.real:write, etoro-public:trade.demo:read, etoro-public:trade.demo:write.
[
"etoro-public:trade.real:read",
"etoro-public:trade.real:write"
]
An updated set of IPv4 addresses allowed to use this token.
["192.168.1.1"]
An updated expiration date and time (UTC) for the token.
"2026-12-31T23:59:59Z"
Response
User token updated successfully