> ## Documentation Index
> Fetch the complete documentation index at: https://api-portal.etoro.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Private portfolio updates

> Subscribe with topic `private` (requires a prior successful Authenticate). Each push carries a `content` field that is a JSON-encoded string of a trading order update (e.g. `Trading.OrderForOpen.Update`, `Trading.OrderForCloseMultiple.Update`).



## AsyncAPI

````yaml api-reference/asyncapi.json privatePortfolio
id: privatePortfolio
title: Private portfolio updates
description: >-
  Subscribe with topic `private` (requires a prior successful Authenticate).
  Each push carries a `content` field that is a JSON-encoded string of a trading
  order update (e.g. `Trading.OrderForOpen.Update`,
  `Trading.OrderForCloseMultiple.Update`).
servers:
  - id: etoro
    protocol: wss
    host: ws.etoro.com
    bindings: []
    variables: []
address: private
parameters: []
bindings:
  - protocol: ws
    version: 0.1.0
    value:
      method: GET
    schemaProperties:
      - name: method
        type: string
        description: GET
        required: false
operations:
  - &ref_12
    id: receiveOrderUpdate
    title: Order update
    description: >-
      Server → client. Order / transaction update on the authenticated `private`
      topic.
    type: receive
    messages:
      - &ref_18
        id: orderUpdate
        contentType: application/json
        payload:
          - name: Order update push
            description: >-
              A batch of one or more order / transaction updates for the
              authenticated user.
            type: object
            properties:
              - name: messages
                type: array
                required: true
                properties:
                  - name: topic
                    type: string
                    description: Always `private` for portfolio updates.
                    examples: &ref_0
                      - private
                    required: true
                  - name: type
                    type: string
                    description: Message type discriminator.
                    examples: &ref_1
                      - Trading.OrderForOpen.Update
                      - Trading.OrderForCloseMultiple.Update
                    required: true
                  - name: id
                    type: string
                    description: Unique id of this push message.
                    required: true
                  - name: content
                    type: string
                    description: >-
                      A JSON-encoded string. Parse it to obtain an order update
                      object (described by contentSchema). Parse it to obtain a
                      `OrderUpdate` object.
                    required: true
        headers: []
        jsonPayloadSchema:
          type: object
          description: Server push envelope. `messages` holds one or more updates.
          required:
            - messages
          properties:
            messages:
              type: array
              items:
                type: object
                required:
                  - topic
                  - content
                  - id
                  - type
                properties:
                  topic:
                    type: string
                    description: Always `private` for portfolio updates.
                    examples: *ref_0
                    x-parser-schema-id: <anonymous-schema-37>
                  type:
                    type: string
                    description: Message type discriminator.
                    examples: *ref_1
                    x-parser-schema-id: <anonymous-schema-38>
                  id:
                    type: string
                    format: uuid
                    description: Unique id of this push message.
                    x-parser-schema-id: <anonymous-schema-39>
                  content:
                    type: string
                    description: >-
                      A JSON-encoded string. Parse it to obtain an order update
                      object (described by contentSchema). Parse it to obtain a
                      `OrderUpdate` object.
                    contentMediaType: application/json
                    contentSchema:
                      type: object
                      description: Decoded `content` of an order update message.
                      properties:
                        OrderID:
                          type: integer
                          format: int64
                          description: Unique order identifier.
                          examples:
                            - 981286176
                          x-parser-schema-id: <anonymous-schema-76>
                        OrderType:
                          type: integer
                          description: Order type code.
                          x-parser-schema-id: <anonymous-schema-77>
                        CID:
                          type: integer
                          format: int64
                          description: Customer (account) id.
                          x-parser-schema-id: <anonymous-schema-78>
                        StatusID:
                          type: integer
                          description: Order status code.
                          x-parser-schema-id: <anonymous-schema-79>
                        InstrumentID:
                          type: integer
                          description: Instrument the order refers to.
                          examples:
                            - 1111
                          x-parser-schema-id: <anonymous-schema-80>
                        RequestGuid:
                          type: string
                          format: uuid
                          x-parser-schema-id: <anonymous-schema-81>
                        RequestOccurred:
                          type: string
                          format: date-time
                          x-parser-schema-id: <anonymous-schema-82>
                        RequestToken:
                          type: string
                          format: uuid
                          x-parser-schema-id: <anonymous-schema-83>
                        ErrorCode:
                          type: integer
                          description: 0 when successful.
                          x-parser-schema-id: <anonymous-schema-84>
                        RequestedUnits:
                          type: number
                          format: float
                          x-parser-schema-id: <anonymous-schema-85>
                        ExecutedUnits:
                          type: number
                          format: float
                          x-parser-schema-id: <anonymous-schema-86>
                        EndRate:
                          type: number
                          format: float
                          x-parser-schema-id: <anonymous-schema-87>
                        NetProfit:
                          type: number
                          format: float
                          x-parser-schema-id: <anonymous-schema-88>
                        CloseReason:
                          type: integer
                          x-parser-schema-id: <anonymous-schema-89>
                        PendingClosePositionIDs:
                          type: array
                          items:
                            type: integer
                            format: int64
                            x-parser-schema-id: <anonymous-schema-91>
                          x-parser-schema-id: <anonymous-schema-90>
                        OpenDateTime:
                          type: string
                          format: date-time
                          x-parser-schema-id: <anonymous-schema-92>
                        IsInMirror:
                          type: boolean
                          x-parser-schema-id: <anonymous-schema-93>
                      x-parser-schema-id: OrderUpdate
                    x-parser-schema-id: <anonymous-schema-40>
                x-parser-schema-id: OrderUpdatePushItem
              x-parser-schema-id: <anonymous-schema-36>
          x-parser-schema-id: OrderUpdateEnvelope
        title: Order update push
        description: >-
          A batch of one or more order / transaction updates for the
          authenticated user.
        example: |-
          {
            "messages": [
              {
                "topic": "private",
                "content": "{\"OrderID\":981286176,\"OrderType\":20,\"CID\":32612044,\"StatusID\":11,\"InstrumentID\":1111,\"RequestGuid\":\"fca38698-1fcf-407d-b930-3222e57274fa\",\"RequestOccurred\":\"2025-04-01T08:55:53.6910145Z\",\"ErrorCode\":0,\"RequestedUnits\":13.859902,\"ExecutedUnits\":0.0}",
                "id": "5263070a-c52f-436b-8ca8-10b3bd6d2970",
                "type": "Trading.OrderForCloseMultiple.Update"
              }
            ]
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: orderUpdate
    bindings: []
    extensions: &ref_4
      - id: x-topic
        value: private
      - id: x-parser-unique-object-id
        value: privatePortfolio
  - &ref_13
    id: receivePositionClosed
    title: Position closed
    description: >-
      Server -> client. Pushed when a position is closed for the authenticated
      user.
    type: receive
    messages:
      - &ref_19
        id: positionClosed
        contentType: application/json
        payload:
          - name: Position closed
            description: Pushed when a position is closed for the authenticated user.
            type: object
            properties:
              - name: messages
                type: array
                required: true
                properties:
                  - name: topic
                    type: string
                    examples: &ref_2
                      - private
                    required: true
                  - name: type
                    type: string
                    description: Message type discriminator.
                    examples: &ref_3
                      - Trading.Position.Closed
                    required: true
                  - name: id
                    type: string
                    required: true
                  - name: content
                    type: string
                    description: >-
                      A JSON-encoded string. Parse it to obtain a
                      Trading.Position.Closed object (described by
                      contentSchema).
                    required: true
        headers: []
        jsonPayloadSchema:
          type: object
          description: Server push envelope. `messages` holds one or more updates.
          required:
            - messages
          properties:
            messages:
              type: array
              items:
                type: object
                required:
                  - topic
                  - content
                  - id
                  - type
                properties:
                  topic:
                    type: string
                    examples: *ref_2
                    x-parser-schema-id: <anonymous-schema-42>
                  type:
                    type: string
                    description: Message type discriminator.
                    examples: *ref_3
                    x-parser-schema-id: <anonymous-schema-43>
                  id:
                    type: string
                    format: uuid
                    x-parser-schema-id: <anonymous-schema-44>
                  content:
                    type: string
                    description: >-
                      A JSON-encoded string. Parse it to obtain a
                      Trading.Position.Closed object (described by
                      contentSchema).
                    contentMediaType: application/json
                    contentSchema:
                      type: object
                      description: >-
                        Decoded `content` of a Trading.Position.Closed message.
                        THIS is the only part you actually design.
                      properties:
                        PositionID:
                          type: integer
                          format: int64
                          examples:
                            - 2980225895
                          x-parser-schema-id: <anonymous-schema-94>
                        InstrumentID:
                          type: integer
                          examples:
                            - 1001
                          x-parser-schema-id: <anonymous-schema-95>
                        CloseRate:
                          type: number
                          format: float
                          description: Rate at which the position was closed.
                          x-parser-schema-id: <anonymous-schema-96>
                        NetProfit:
                          type: number
                          format: float
                          description: Net profit/loss realised on close.
                          x-parser-schema-id: <anonymous-schema-97>
                        CloseReason:
                          type: integer
                          description: Close reason code.
                          x-parser-schema-id: <anonymous-schema-98>
                        CloseDateTime:
                          type: string
                          format: date-time
                          x-parser-schema-id: <anonymous-schema-99>
                      x-parser-schema-id: PositionClosed
                    x-parser-schema-id: <anonymous-schema-45>
                x-parser-schema-id: PositionClosedPushItem
              x-parser-schema-id: <anonymous-schema-41>
          x-parser-schema-id: PositionClosedEnvelope
        title: Position closed
        description: Pushed when a position is closed for the authenticated user.
        example: |-
          {
            "messages": [
              {
                "topic": "private",
                "content": "{\"PositionID\":2980225895,\"InstrumentID\":1001,\"CloseRate\":188.42,\"NetProfit\":30.62,\"CloseReason\":1,\"CloseDateTime\":\"2025-04-01T09:42:11.1234567Z\"}",
                "id": "b81d4e2a-7c3f-4a90-9d12-5e6f7a8b9c01",
                "type": "Trading.Position.Closed"
              }
            ]
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: positionClosed
    bindings: []
    extensions: *ref_4
  - &ref_14
    id: receivePositionOpened
    title: Position opened
    description: >-
      Server → client. Pushed when a new position is opened. (Illustrative
      example type.)
    type: receive
    messages:
      - &ref_20
        id: positionOpened
        contentType: application/json
        payload:
          - name: Position opened
            description: >-
              Pushed when a new position is opened for the authenticated user.
              (Illustrative example of an additional private message type.)
            type: object
            properties:
              - name: messages
                type: array
                required: true
                properties:
                  - name: topic
                    type: string
                    examples: &ref_5
                      - private
                    required: true
                  - name: type
                    type: string
                    description: Message type discriminator.
                    examples: &ref_6
                      - Trading.Position.Opened
                    required: true
                  - name: id
                    type: string
                    required: true
                  - name: content
                    type: string
                    description: >-
                      A JSON-encoded string. Parse it to obtain a
                      Trading.Position.Opened object (described by
                      contentSchema).
                    required: true
        headers: []
        jsonPayloadSchema:
          type: object
          description: Server push envelope. `messages` holds one or more updates.
          required:
            - messages
          properties:
            messages:
              type: array
              items:
                type: object
                required:
                  - topic
                  - content
                  - id
                  - type
                properties:
                  topic:
                    type: string
                    examples: *ref_5
                    x-parser-schema-id: <anonymous-schema-47>
                  type:
                    type: string
                    description: Message type discriminator.
                    examples: *ref_6
                    x-parser-schema-id: <anonymous-schema-48>
                  id:
                    type: string
                    format: uuid
                    x-parser-schema-id: <anonymous-schema-49>
                  content:
                    type: string
                    description: >-
                      A JSON-encoded string. Parse it to obtain a
                      Trading.Position.Opened object (described by
                      contentSchema).
                    contentMediaType: application/json
                    contentSchema:
                      type: object
                      description: >-
                        Decoded `content` of a Trading.Position.Opened message.
                        (Illustrative example schema.)
                      properties:
                        PositionID:
                          type: integer
                          format: int64
                          examples:
                            - 2980225895
                          x-parser-schema-id: <anonymous-schema-100>
                        InstrumentID:
                          type: integer
                          examples:
                            - 1001
                          x-parser-schema-id: <anonymous-schema-101>
                        IsBuy:
                          type: boolean
                          description: >-
                            True for a buy (long) position, false for sell
                            (short).
                          x-parser-schema-id: <anonymous-schema-102>
                        OpenRate:
                          type: number
                          format: float
                          description: Rate at which the position was opened.
                          x-parser-schema-id: <anonymous-schema-103>
                        Amount:
                          type: number
                          format: float
                          description: Invested amount.
                          x-parser-schema-id: <anonymous-schema-104>
                        Leverage:
                          type: integer
                          x-parser-schema-id: <anonymous-schema-105>
                        OpenDateTime:
                          type: string
                          format: date-time
                          x-parser-schema-id: <anonymous-schema-106>
                      x-parser-schema-id: PositionOpened
                    x-parser-schema-id: <anonymous-schema-50>
                x-parser-schema-id: PositionOpenedPushItem
              x-parser-schema-id: <anonymous-schema-46>
          x-parser-schema-id: PositionOpenedEnvelope
        title: Position opened
        description: >-
          Pushed when a new position is opened for the authenticated user.
          (Illustrative example of an additional private message type.)
        example: |-
          {
            "messages": [
              {
                "topic": "private",
                "content": "{\"PositionID\":2980225895,\"InstrumentID\":1001,\"IsBuy\":true,\"OpenRate\":182.30,\"Amount\":500.0,\"Leverage\":2,\"OpenDateTime\":\"2025-04-01T08:55:53.6910145Z\"}",
                "id": "7c2f0a1b-9d3e-4f6a-8b21-2c4a6e8f1d00",
                "type": "Trading.Position.Opened"
              }
            ]
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: positionOpened
    bindings: []
    extensions: *ref_4
  - &ref_15
    id: privatePortfolioAuthenticate
    title: Authenticate
    description: Authenticate the connection. Required before subscribing to `private`.
    type: send
    messages:
      - &ref_21
        id: authenticateRequest
        contentType: application/json
        payload:
          - name: Authenticate request
            description: Authenticate the WebSocket session with your API credentials.
            type: object
            properties:
              - name: id
                type: string
                description: >-
                  Client-generated correlation id, echoed back on the
                  acknowledgement.
                examples: &ref_7
                  - ed72693c-1545-4fa1-8a10-aca7cf5419a6
                required: true
              - name: operation
                type: string
                enumValues:
                  - Authenticate
                required: true
              - name: data
                type: object
                required: true
                properties:
                  - name: userKey
                    type: string
                    description: Your eToro user key (x-user-key).
                    required: true
                  - name: apiKey
                    type: string
                    description: Your eToro API key (x-api-key).
                    required: true
        headers: []
        jsonPayloadSchema:
          type: object
          description: Client request envelope for the Authenticate operation.
          required:
            - id
            - operation
            - data
          properties:
            id:
              type: string
              format: uuid
              description: >-
                Client-generated correlation id, echoed back on the
                acknowledgement.
              examples: *ref_7
              x-parser-schema-id: <anonymous-schema-1>
            operation:
              type: string
              enum:
                - Authenticate
              x-parser-schema-id: <anonymous-schema-2>
            data:
              type: object
              required:
                - userKey
                - apiKey
              properties:
                userKey:
                  type: string
                  description: Your eToro user key (x-user-key).
                  x-parser-schema-id: <anonymous-schema-3>
                apiKey:
                  type: string
                  description: Your eToro API key (x-api-key).
                  x-parser-schema-id: <anonymous-schema-4>
              x-parser-schema-id: AuthenticateData
          x-parser-schema-id: AuthenticateEnvelope
        title: Authenticate request
        description: Authenticate the WebSocket session with your API credentials.
        example: |-
          {
            "id": "ed72693c-1545-4fa1-8a10-aca7cf5419a6",
            "operation": "Authenticate",
            "data": {
              "userKey": "eyJlYW4iOiJVbnJlZ2lzdGVyZWRBcHBsaWNhdGlvbiIsImVrIjoiOE5sZ2cwcW5EUVdROUFNWGpXT2lmOWktZnpidG5KcUlqWGJ3WHJZZkpZcldrbG90ZEhvLVBjSWhQaU8xU1ZtMW84aU1WZGZqN2xWNzFjLXFxLmcybXE1dnh4Q1hUT25xaWRUaTFlcEhmVk1fIn0_",
              "apiKey": "lhgfaslk21490FAScVPkdsb53F9dNkfHG4faZSG5vfjndfcfgdssdgsdHF4663"
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: authenticateRequest
    bindings: []
    extensions: *ref_4
  - &ref_16
    id: privatePortfolioSubscribe
    title: Subscribe
    description: Subscribe to `private`.
    type: send
    messages:
      - &ref_22
        id: subscribeRequest
        contentType: application/json
        payload:
          - name: Subscribe request
            description: Subscribe to one or more topics.
            type: object
            properties:
              - name: id
                type: string
                examples: &ref_8
                  - ed72693c-1545-4fa1-8a10-aca7cf5419a6
                required: true
              - name: operation
                type: string
                enumValues:
                  - Subscribe
                required: true
              - name: data
                type: object
                required: true
                properties:
                  - name: topics
                    type: array
                    description: >-
                      Topics to subscribe to. e.g. `instrument:<instrumentId>`
                      for market rates, or `private` for the authenticated
                      user's order/portfolio updates.
                    required: true
                    properties:
                      - name: item
                        type: string
                        examples: &ref_9
                          - instrument:100000
                          - private
                        required: false
                  - name: snapshot
                    type: boolean
                    description: >-
                      Applies to market-data topics only (e.g. `instrument:*`):
                      when true, the current rate is sent immediately on
                      subscribe. Has no effect on the `private` topic.
                    required: false
        headers: []
        jsonPayloadSchema:
          type: object
          description: Client request envelope for the Subscribe operation.
          required:
            - id
            - operation
            - data
          properties:
            id:
              type: string
              format: uuid
              examples: *ref_8
              x-parser-schema-id: <anonymous-schema-5>
            operation:
              type: string
              enum:
                - Subscribe
              x-parser-schema-id: <anonymous-schema-6>
            data:
              type: object
              required:
                - topics
              properties:
                topics:
                  type: array
                  description: >-
                    Topics to subscribe to. e.g. `instrument:<instrumentId>` for
                    market rates, or `private` for the authenticated user's
                    order/portfolio updates.
                  items:
                    type: string
                    examples: *ref_9
                    x-parser-schema-id: <anonymous-schema-8>
                  x-parser-schema-id: <anonymous-schema-7>
                snapshot:
                  type: boolean
                  description: >-
                    Applies to market-data topics only (e.g. `instrument:*`):
                    when true, the current rate is sent immediately on
                    subscribe. Has no effect on the `private` topic.
                  default: false
                  x-parser-schema-id: <anonymous-schema-9>
              x-parser-schema-id: SubscribeData
          x-parser-schema-id: SubscribeEnvelope
        title: Subscribe request
        description: Subscribe to one or more topics.
        example: |-
          {
            "id": "ed72693c-1545-4fa1-8a10-aca7cf5419a6",
            "operation": "Subscribe",
            "data": {
              "topics": [
                "instrument:100000"
              ],
              "snapshot": false
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribeRequest
    bindings: []
    extensions: *ref_4
  - &ref_17
    id: privatePortfolioUnsubscribe
    title: Unsubscribe
    description: Unsubscribe from `private`.
    type: send
    messages:
      - &ref_23
        id: unsubscribeRequest
        contentType: application/json
        payload:
          - name: Unsubscribe request
            description: Stop receiving messages for one or more topics.
            type: object
            properties:
              - name: id
                type: string
                examples: &ref_10
                  - ed72693c-1545-4fa1-8a10-aca7cf5419a6
                required: true
              - name: operation
                type: string
                enumValues:
                  - Unsubscribe
                required: true
              - name: data
                type: object
                required: true
                properties:
                  - name: topics
                    type: array
                    description: Topics to unsubscribe from.
                    required: true
                    properties:
                      - name: item
                        type: string
                        examples: &ref_11
                          - instrument:100000
                        required: false
        headers: []
        jsonPayloadSchema:
          type: object
          description: Client request envelope for the Unsubscribe operation.
          required:
            - id
            - operation
            - data
          properties:
            id:
              type: string
              format: uuid
              examples: *ref_10
              x-parser-schema-id: <anonymous-schema-10>
            operation:
              type: string
              enum:
                - Unsubscribe
              x-parser-schema-id: <anonymous-schema-11>
            data:
              type: object
              required:
                - topics
              properties:
                topics:
                  type: array
                  description: Topics to unsubscribe from.
                  items:
                    type: string
                    examples: *ref_11
                    x-parser-schema-id: <anonymous-schema-13>
                  x-parser-schema-id: <anonymous-schema-12>
              x-parser-schema-id: UnsubscribeData
          x-parser-schema-id: UnsubscribeEnvelope
        title: Unsubscribe request
        description: Stop receiving messages for one or more topics.
        example: |-
          {
            "id": "ed72693c-1545-4fa1-8a10-aca7cf5419a6",
            "operation": "Unsubscribe",
            "data": {
              "topics": [
                "instrument:100000"
              ]
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: unsubscribeRequest
    bindings: []
    extensions: *ref_4
sendOperations:
  - *ref_12
  - *ref_13
  - *ref_14
receiveOperations:
  - *ref_15
  - *ref_16
  - *ref_17
sendMessages:
  - *ref_18
  - *ref_19
  - *ref_20
receiveMessages:
  - *ref_21
  - *ref_22
  - *ref_23
extensions:
  - id: x-topic
    value: private
  - id: x-parser-unique-object-id
    value: privatePortfolio
securitySchemes:
  - id: apiKeyPair
    name: apiKeyPair
    type: userPassword
    description: >-
      eToro API credentials, sent as a pair inside the `Authenticate` request's
      `data` object -- `userKey` (the user identifier) and `apiKey` (the secret)
      -- not as an HTTP header. Required before subscribing to the `private`
      topic; public market topics (`instrument:<instrumentId>`) need no
      authentication. Both values come from the API key section of eToro account
      settings, which appears once the account is verified.
    extensions: []

````