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

# Authenticate (control channel)

> 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 connectionAuthenticate
id: connectionAuthenticate
title: Authenticate (control channel)
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_1
    id: authenticate
    title: Authenticate
    description: >-
      Client → server. Authenticate the session before subscribing to private
      topics.
    type: send
    messages:
      - &ref_2
        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": "<your user key>",
              "apiKey": "<your API key>"
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: authenticateRequest
    bindings: []
    extensions:
      - id: x-parser-unique-object-id
        value: connectionAuthenticate
sendOperations: []
receiveOperations:
  - *ref_1
sendMessages: []
receiveMessages:
  - *ref_2
extensions:
  - id: x-parser-unique-object-id
    value: connectionAuthenticate
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: []

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.