Skip to main content
POST
/
api
/
v2
/
agent-portfolios
Create Agent Portfolio (v2)
curl --request POST \
  --url https://public-api.etoro.com/api/v2/agent-portfolios \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <x-api-key>' \
  --header 'x-request-id: <x-request-id>' \
  --header 'x-user-key: <x-user-key>' \
  --data '
{
  "investmentAmountInUsd": 2000,
  "agentPortfolioName": "MyPort1",
  "userTokenName": "my-trading-token",
  "scopeNames": [
    "etoro-public:trade.real:read",
    "etoro-public:trade.real:write"
  ],
  "agentPortfolioDescription": "My trading portfolio",
  "ipsWhitelist": [
    "192.168.1.1"
  ],
  "expiresAt": "2026-12-31T23:59:59Z"
}
'
{
  "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"
      ],
      "scopes": [
        {
          "name": "etoro-public:trade.real:read"
        }
      ],
      "expiresAt": "2026-12-31T23:59:59Z"
    }
  ]
}

Headers

x-request-id
string<uuid>
required

A unique request identifier.

Example:

"1f7bab86-9687-4f77-9714-7caae8542911"

x-api-key
string<password>
required

API key for authentication.

Example:

"lhgfaslk21490FAScVPkdsb53F9dNkfHG4faZSG5vfjndfcfgdssdgsdHF4663"

x-user-key
string<password>
required

User-specific authentication key.

Example:

"eyJlYW4iOiJVbnJlZ2lzdGVyZWRBcHBsaWNhdGlvbiIsImVrIjoiOE5sZ2cwcW5EUVdROUFNWGpXT2lmOWktZnpidG5KcUlqWGJ3WHJZZkpZcldrbG90ZEhvLVBjSWhQaU8xU1ZtMW84aU1WZGZqN2xWNzFjLXFxLmcybXE1dnh4Q1hUT25xaWRUaTFlcEhmVk1fIn0_"

Body

application/json
investmentAmountInUsd
number
required

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.

Example:

2000

agentPortfolioName
string
required

A unique display name for the agent-portfolio (6-10 characters).

Example:

"MyPort1"

userTokenName
string
required

A human-readable name for the user token provisioned with the agent-portfolio.

Example:

"my-trading-token"

scopeNames
string[]
required

The set of permission scope names to grant to the provisioned user token. Available scopes: etoro-public:trade.real:read, etoro-public:trade.real:write, etoro-public:trade.demo:read, etoro-public:trade.demo:write.

Example:
[
"etoro-public:trade.real:read",
"etoro-public:trade.real:write"
]
agentPortfolioDescription
string

An optional description of the agent-portfolio's purpose or strategy.

Example:

"My trading portfolio"

ipsWhitelist
string[]

An optional set of IPv4 addresses allowed to use the provisioned user token.

Example:
["192.168.1.1"]
expiresAt
string<date-time>

An optional expiration date and time (UTC) for the provisioned user token.

Example:

"2026-12-31T23:59:59Z"

Response

Agent-portfolio and user token created successfully

agentPortfolioId
string<uuid>

The unique identifier of the newly created agent-portfolio.

Example:

"a1b2c3d4-e5f6-7890-abcd-ef1234567890"

agentPortfolioName
string

The display name assigned to the agent-portfolio.

Example:

"MyPort1"

agentPortfolioGcid
integer

The GCID associated with the agent-portfolio.

Example:

12345678

agentPortfolioVirtualBalance
number

The fixed virtual balance (in USD) that the agent-portfolio was funded with. The investmentAmountInUsd used to copy is proportional to this balance.

Example:

10000

mirrorId
integer

The Trading API mirror ID for this agent-portfolio's copy trade.

Example:

12345

userTokens
object[]

The user tokens generated during agent-portfolio creation.