# Authentication

The sFOX WebSocket feeds described in this document require authentication.&#x20;

The authentication command should be JSON with the following properties using your Enterprise Partner Bearer Token as the `apiKey`.

<table><thead><tr><th width="187">Property</th><th width="141.33333333333331">Type</th><th>Command</th></tr></thead><tbody><tr><td><code>type</code></td><td>string</td><td><code>"authenticate"</code></td></tr><tr><td><code>apiKey</code></td><td>string</td><td><code>"&#x3C;YOUR-API-KEY>"</code></td></tr><tr><td><code>enterprise</code></td><td>boolean</td><td><code>true</code></td></tr></tbody></table>

{% tabs %}
{% tab title="NodeJS" %}

```javascript
const authMessage = {
   type: 'authenticate',
   apiKey: '<API_KEY>',
   enterprise: true
}
ws.send(JSON.stringify(authMessage))
```

{% endtab %}

{% tab title="Python" %}

```python
auth_message={
  "type": "authenticate",
  "apiKey": "<API KEY>",
  "enterprise": True
}

await ws.send(json_dumps(auth_message))
```

{% endtab %}

{% tab title="Example Responses" %}
Success

```json
{
  "type": "success",
  "sequence": 2,
  "timestamp": 1649898453577592461,
  "payload": {
    "action": "authenticate"
  },
  "action": "authenticate"
}
```

Failure

```json
{
  "type": "error",
  "sequence": 2,
  "timestamp": 1649898453577592461,
  "payload": {
    "action": "authenticate"
  },
  "action": "authenticate"
}
```

{% endtab %}
{% endtabs %}
