> ## 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.

# Control channel (request / response)

> All client requests share one JSON envelope: `{ "id": "<guid>", "operation": "<Authenticate|Subscribe|Unsubscribe>", "data": { ... } }`. The server answers each request on the same connection with an acknowledgement that echoes the `id` and the `operation`. The `id` is a client-generated GUID used to correlate the request with its acknowledgement.



## AsyncAPI

````yaml api-reference/asyncapi.json connection
id: connection
title: Control channel (request / response)
description: >-
  All client requests share one JSON envelope: `{ "id": "<guid>", "operation":
  "<Authenticate|Subscribe|Unsubscribe>", "data": { ... } }`. The server answers
  each request on the same connection with an acknowledgement that echoes the
  `id` and the `operation`. The `id` is a client-generated GUID used to
  correlate the request with its acknowledgement.
servers:
  - id: etoro
    protocol: wss
    host: ws.etoro.com
    bindings: []
    variables: []
address: /ws
parameters: []
bindings:
  - protocol: ws
    version: 0.1.0
    value:
      method: GET
    schemaProperties:
      - name: method
        type: string
        description: GET
        required: false
operations:
  - &ref_6
    id: authenticate
    title: Authenticate
    description: >-
      Client → server. Authenticate the session before subscribing to private
      topics.
    type: send
    messages:
      - &ref_9
        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_0
                  - 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_0
              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_3
      - id: x-parser-unique-object-id
        value: connection
  - &ref_7
    id: subscribe
    title: Subscribe
    description: Client → server. Subscribe to one or more topics.
    type: send
    messages:
      - &ref_10
        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_1
                  - 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_2
                          - 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_1
              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_2
                    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_3
  - &ref_8
    id: unsubscribe
    title: Unsubscribe
    description: Client → server. Stop receiving messages for one or more topics.
    type: send
    messages:
      - &ref_11
        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_4
                  - 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_5
                          - 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_4
              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_5
                    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_3
sendOperations: []
receiveOperations:
  - *ref_6
  - *ref_7
  - *ref_8
sendMessages: []
receiveMessages:
  - *ref_9
  - *ref_10
  - *ref_11
extensions:
  - id: x-parser-unique-object-id
    value: connection
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: []

````