curl --request POST \
--url https://public-api.etoro.com/api/v1/agent-portfolios/{agentPortfolioId}/user-tokens \
--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 '
{
"userTokenName": "my-trading-token",
"scopeIds": [
211,
212
],
"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/v1/agent-portfolios/{agentPortfolioId}/user-tokens"
payload = {
"userTokenName": "my-trading-token",
"scopeIds": [211, 212],
"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.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-request-id': '<x-request-id>',
'x-api-key': '<api-key>',
'x-user-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
userTokenName: 'my-trading-token',
scopeIds: [211, 212],
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/v1/agent-portfolios/{agentPortfolioId}/user-tokens', 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/v1/agent-portfolios/{agentPortfolioId}/user-tokens",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'userTokenName' => 'my-trading-token',
'scopeIds' => [
211,
212
],
'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/v1/agent-portfolios/{agentPortfolioId}/user-tokens"
payload := strings.NewReader("{\n \"userTokenName\": \"my-trading-token\",\n \"scopeIds\": [\n 211,\n 212\n ],\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("POST", 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.post("https://public-api.etoro.com/api/v1/agent-portfolios/{agentPortfolioId}/user-tokens")
.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 \"userTokenName\": \"my-trading-token\",\n \"scopeIds\": [\n 211,\n 212\n ],\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/v1/agent-portfolios/{agentPortfolioId}/user-tokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.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 \"userTokenName\": \"my-trading-token\",\n \"scopeIds\": [\n 211,\n 212\n ],\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_body{
"userTokenId": "f9e8d7c6-b5a4-3210-fedc-ba9876543210",
"userToken": "sk_live_a1b2c3d4e5f6...",
"userTokenName": "my-trading-token",
"clientId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"ipsWhitelist": [
"192.168.1.1"
],
"scopeNames": [
"etoro-public:trade.real:read"
],
"expiresAt": "2026-12-31T23:59:59Z",
"createdAt": "2026-03-06T12:00:00Z"
}Create User Token
Deprecated: This endpoint is marked deprecated in the etoro Public API Swagger. Prefer the current replacement endpoints where available.
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.
[DEPRECATED — use POST /api/v2/agent-portfolios//user-tokens (scope names) instead] Creates a new user token for the specified agent-portfolio.
curl --request POST \
--url https://public-api.etoro.com/api/v1/agent-portfolios/{agentPortfolioId}/user-tokens \
--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 '
{
"userTokenName": "my-trading-token",
"scopeIds": [
211,
212
],
"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/v1/agent-portfolios/{agentPortfolioId}/user-tokens"
payload = {
"userTokenName": "my-trading-token",
"scopeIds": [211, 212],
"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.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-request-id': '<x-request-id>',
'x-api-key': '<api-key>',
'x-user-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
userTokenName: 'my-trading-token',
scopeIds: [211, 212],
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/v1/agent-portfolios/{agentPortfolioId}/user-tokens', 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/v1/agent-portfolios/{agentPortfolioId}/user-tokens",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'userTokenName' => 'my-trading-token',
'scopeIds' => [
211,
212
],
'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/v1/agent-portfolios/{agentPortfolioId}/user-tokens"
payload := strings.NewReader("{\n \"userTokenName\": \"my-trading-token\",\n \"scopeIds\": [\n 211,\n 212\n ],\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("POST", 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.post("https://public-api.etoro.com/api/v1/agent-portfolios/{agentPortfolioId}/user-tokens")
.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 \"userTokenName\": \"my-trading-token\",\n \"scopeIds\": [\n 211,\n 212\n ],\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/v1/agent-portfolios/{agentPortfolioId}/user-tokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.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 \"userTokenName\": \"my-trading-token\",\n \"scopeIds\": [\n 211,\n 212\n ],\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_body{
"userTokenId": "f9e8d7c6-b5a4-3210-fedc-ba9876543210",
"userToken": "sk_live_a1b2c3d4e5f6...",
"userTokenName": "my-trading-token",
"clientId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"ipsWhitelist": [
"192.168.1.1"
],
"scopeNames": [
"etoro-public:trade.real:read"
],
"expiresAt": "2026-12-31T23:59:59Z",
"createdAt": "2026-03-06T12:00:00Z"
}Authorizations
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_
Scopes
Headers
Body
The set of permission scope names (preferred; replaces the deprecated scopeIds). Provide either scopeNames or scopeIds. Available scopes: etoro-public:real:read, etoro-public:demo:read, etoro-public:real:write, etoro-public:demo:write.
[
"etoro-public:trade.real:read",
"etoro-public:trade.real:write"
]
Response
User token created successfully