sFOX API
Sign InOpen Account
Connect API
Connect API
  • Introduction
    • Welcome
    • Getting Started
    • Resources
      • Terminology
      • Systems & Operations
      • Integration Options
    • Guides
      • End User Onboarding & KYC
        • Individuals
        • Businesses
        • Enhanced Due Diligence
  • REST API
    • REST Endpoints
    • Authentication
    • End Users
      • Create End User Account
      • Request Verification Code
      • Confirm Verification Code
      • Create User Auth Token(s)
      • Get End User(s)
      • Get EDD Requests
      • Get EDD Prompts
      • Create EDD Responses
        • Uploading Files as Responses
      • Submit Documents
      • Deactivate User
    • Payments
      • Create Bank Account (Plaid)
      • Create Bank Account
      • Get Bank Account
      • Get Plaid Processors
      • Amend Plaid Processors
      • Verify Bank Account
      • Delete Bank Account
      • Get Wire Instructions
      • Get ACH Agreement Status
      • Request ACH Onboarding
      • Get ACH Deposit Limit
    • Withdrawals
      • Confirm Withdrawal
      • Resend Confirmation Code
      • Cancel Withdrawal
    • Transfers
      • Create Transfer
      • Confirm Transfer
      • Resend Confirmation Code
      • Cancel Transfer
      • Get Transfer Permissions
      • Get Transfer History
    • Monetization
      • Create Setting
      • Update Setting
      • Delete Setting
      • Get Settings
      • Get Permissions
      • Get Monetization History
  • WebSocket API
    • Connecting
    • Authentication
    • Subscribing & Unsubscribing
    • Message Format
    • End Users
      • Onboarding
      • Balances
      • Orders
      • Trades
    • Market Data
      • Order Book
      • Trades
      • Ticker
  • Single Sign-On
    • Overview
      • IdP Initiated SSO
    • IdP Data
    • SAML Response Data
  • Errors
    • Error Codes
Powered by GitBook
  1. WebSocket API
  2. End Users

Onboarding

PreviousEnd UsersNextBalances

Last updated 11 months ago

Provides real-time updates regarding new user registrations from your application.

Authentication required. Please refer to the

Subscription Instructions

Feed Name

private.enterprise.users

Payload Details

Key
Description

account_type

Individual or Corporation

account_role

Advisor or Client

user_id

Unique ID shared between sFOX and your enterprise

email

Email address of the user

first_name

First name of the user

last_name

Last name of the user

phone_number

Phone number of the user

status

Verification status of the user’s sFOX account

requirements

Status of verification requirements of the user's sFOX account

user_token

A User Auth Token for this partner_user_id .

The authentication token that your application will use to access this specific user’s account

Example Code

const WebSocket = require('ws')

const ws = new WebSocket('wss://ws.sfox.com/ws')

ws.on('open', function() {
  const authMessage = {
   type: 'authenticate',
   apiKey: `process.env.ENTERPRISE_API_KEY`,
   enterprise: 'true'
  }
  
  ws.send(JSON.stringify(authMessage))
})

// After successful authentication, subscribe to users feed
const subscribeMsg = {
  type: 'subscribe',
  feeds: ['private.enterprise.users']
}

ws.send(JSON.stringify(subscribeMsg))
import asyncio
import json
import websockets
import os

async def main(uri):
    async with websockets.connect(uri) as ws:
        await ws.send(json.dumps({
            "type": "authenticate",
            "apiKey": f"{os.environ['ENTERPRISE_API_KEY']}",
            "enterprise": "true"
        }))

        # After successful authentication message, subscribe to the users feed
        await ws.send(json.dumps({
            "type": "subscribe",
            "feeds": ["private.enterprise.users"]
        }))
        async for msg in ws:
            print(msg)


asyncio.run(main("wss://ws.sfox.com/ws"))
{
  "sequence": 5,
  "recipient": "private.enterprise.users",
  "timestamp": 1717005327995988841,
  "payload": {
    "user_id": "client_09e487c9-9b75-4ef5-be06-b3e5661f68e5",
    "first_name": "Brando",
    "last_name": "Marks",
    "email": "bruno@mailinator.com",
    "phone_number": "+12223334444",
    "account_role": "Client",
    "account_type": "individual",
    "status": "PENDING",
    "user_token": {
      "token": "2000611ea497d8ae4832c52166e0a26162cbb74716ab2662c50f8b47cdad3979",
      "expires": "2024-05-30T17:55:27.981Z",
      "partner_user_id": "client_09e487c9-9b75-4ef5-be06-b3e5661f68e5"
    },
    "requirements": {
      "sms": true,
      "email": true
    }
  }
}
{
  "sequence": 5,
  "recipient": "private.enterprise.users",
  "timestamp": 1717005327995988841,
  "payload": {
    "user_id": "client_09e487c9-9b75-4ef5-be06-b3e5661f68e5",
    "first_name": "Brando",
    "last_name": "Marks",
    "email": "bruno@mailinator.com",
    "phone_number": "+12223334444",
    "account_role": "Client",
    "account_type": "individual",
    "status": "VERIFIED",
    "user_token": {
      "token": "2000611ea497d8ae4832c52166e0a26162cbb74716ab2662c50f8b47cdad3979",
      "expires": "2024-05-30T17:55:27.981Z",
      "partner_user_id": "client_09e487c9-9b75-4ef5-be06-b3e5661f68e5"
    },
    "requirements": {
      "sms": false,
      "email": false
    }
  }
}

WebSocket Authentication page here for more details.