curl --request POST \
--url https://public-api.etoro.com/api/v1/agent-portfolios \
--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 '
{
"investmentAmountInUsd": 2000,
"agentPortfolioName": "MyPort1",
"userTokenName": "my-trading-token",
"agentPortfolioDescription": "My trading portfolio",
"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"
payload = {
"investmentAmountInUsd": 2000,
"agentPortfolioName": "MyPort1",
"userTokenName": "my-trading-token",
"agentPortfolioDescription": "My trading portfolio",
"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({
investmentAmountInUsd: 2000,
agentPortfolioName: 'MyPort1',
userTokenName: 'my-trading-token',
agentPortfolioDescription: 'My trading portfolio',
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', 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",
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([
'investmentAmountInUsd' => 2000,
'agentPortfolioName' => 'MyPort1',
'userTokenName' => 'my-trading-token',
'agentPortfolioDescription' => 'My trading portfolio',
'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"
payload := strings.NewReader("{\n \"investmentAmountInUsd\": 2000,\n \"agentPortfolioName\": \"MyPort1\",\n \"userTokenName\": \"my-trading-token\",\n \"agentPortfolioDescription\": \"My trading portfolio\",\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")
.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 \"investmentAmountInUsd\": 2000,\n \"agentPortfolioName\": \"MyPort1\",\n \"userTokenName\": \"my-trading-token\",\n \"agentPortfolioDescription\": \"My trading portfolio\",\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")
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 \"investmentAmountInUsd\": 2000,\n \"agentPortfolioName\": \"MyPort1\",\n \"userTokenName\": \"my-trading-token\",\n \"agentPortfolioDescription\": \"My trading portfolio\",\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{
"agentPortfolioId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"agentPortfolioName": "MyPort1",
"agentPortfolioGcid": 12345678,
"agentPortfolioVirtualBalance": 10000,
"mirrorId": 12345,
"userTokens": [
{
"userTokenId": "f9e8d7c6-b5a4-3210-fedc-ba9876543210",
"userToken": "sk_live_a1b2c3d4e5f6...",
"userTokenName": "my-trading-token",
"clientId": "c1d2e3f4-a5b6-7890-cdef-123456789abc",
"ipsWhitelist": [
"192.168.1.1"
],
"scopeIds": [
211,
212
],
"scopeNames": [
"etoro-public:trade.real:read",
"etoro-public:trade.real:write"
],
"expiresAt": "2026-12-31T23:59:59Z"
}
]
}Create Agent Portfolio
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 (scope names) instead] Creates a new agent-portfolio — a dedicated user account that receives its own fixed virtual balance (returned in agentPortfolioVirtualBalance). IMPORTANT: investmentAmountInUsd is the amount deducted from YOUR (the caller’s) account balance to copy-trade this agent-portfolio — it is NOT the agent-portfolio’s own balance. Positions are mirrored proportionally: e.g. if you invest 2,000andagentPortfolioVirtualBalanceis10,000, each position is copied at 20% of its size into your account.
curl --request POST \
--url https://public-api.etoro.com/api/v1/agent-portfolios \
--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 '
{
"investmentAmountInUsd": 2000,
"agentPortfolioName": "MyPort1",
"userTokenName": "my-trading-token",
"agentPortfolioDescription": "My trading portfolio",
"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"
payload = {
"investmentAmountInUsd": 2000,
"agentPortfolioName": "MyPort1",
"userTokenName": "my-trading-token",
"agentPortfolioDescription": "My trading portfolio",
"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({
investmentAmountInUsd: 2000,
agentPortfolioName: 'MyPort1',
userTokenName: 'my-trading-token',
agentPortfolioDescription: 'My trading portfolio',
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', 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",
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([
'investmentAmountInUsd' => 2000,
'agentPortfolioName' => 'MyPort1',
'userTokenName' => 'my-trading-token',
'agentPortfolioDescription' => 'My trading portfolio',
'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"
payload := strings.NewReader("{\n \"investmentAmountInUsd\": 2000,\n \"agentPortfolioName\": \"MyPort1\",\n \"userTokenName\": \"my-trading-token\",\n \"agentPortfolioDescription\": \"My trading portfolio\",\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")
.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 \"investmentAmountInUsd\": 2000,\n \"agentPortfolioName\": \"MyPort1\",\n \"userTokenName\": \"my-trading-token\",\n \"agentPortfolioDescription\": \"My trading portfolio\",\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")
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 \"investmentAmountInUsd\": 2000,\n \"agentPortfolioName\": \"MyPort1\",\n \"userTokenName\": \"my-trading-token\",\n \"agentPortfolioDescription\": \"My trading portfolio\",\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{
"agentPortfolioId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"agentPortfolioName": "MyPort1",
"agentPortfolioGcid": 12345678,
"agentPortfolioVirtualBalance": 10000,
"mirrorId": 12345,
"userTokens": [
{
"userTokenId": "f9e8d7c6-b5a4-3210-fedc-ba9876543210",
"userToken": "sk_live_a1b2c3d4e5f6...",
"userTokenName": "my-trading-token",
"clientId": "c1d2e3f4-a5b6-7890-cdef-123456789abc",
"ipsWhitelist": [
"192.168.1.1"
],
"scopeIds": [
211,
212
],
"scopeNames": [
"etoro-public:trade.real:read",
"etoro-public:trade.real:write"
],
"expiresAt": "2026-12-31T23:59:59Z"
}
]
}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 amount in USD deducted from the CALLER's account balance to copy-trade this agent-portfolio. This is NOT the agent-portfolio's own balance — the agent-portfolio receives a separate fixed virtual balance (returned as agentPortfolioVirtualBalance). Positions are mirrored proportionally: e.g. $2,000 with a $10,000 virtual balance = 20% position sizing.
2000
[DEPRECATED — use scopeNames instead] The set of permission scope identifiers to grant to the provisioned user token. Available scopes: 200 = etoro-public:real:read, 201 = etoro-public:demo:read, 202 = etoro-public:real:write, 203 = etoro-public:demo:write.
[211, 212]
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
Agent-portfolio and user token created successfully