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 Single User Auth Token
      • Create Multiple User Auth Tokens
      • Get End User(s)
      • Get EDD Requests
      • Get EDD Prompts
      • Create EDD Responses
      • Submit Documents
        • Submit Documents (SFTP)
      • 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
On this page
  • Request
  • Path Parameters
  • Example Requests
  • Response
  • Response Fields
  • Responses
  1. REST API
  2. End Users

Create Single User Auth Token

POST

https://api.sfox.com/v1/enterprise/user-tokens/:user_id

Generate a user auth token for an end user.


User auth tokens are short-lived authentication tokens, expiring 24 hours after creation (expiration of a given token specified in the expires field of the response). User auth tokens are used for actions specific to a user's account (e.g. Initiate an ACH Deposit, Create an Order).

sFOX recommends that you do not store user auth tokens. Instead, create a new user auth token as needed whenever executing requests on behalf of a specific user.

There is no limit to the number of user auth tokens that may be created.

You can create user auth tokens for multiple users using Create Multiple User Auth Tokens requests.

Request

Path Parameters

Parameter
Description

user_id required, string

ID of the specific user you want to create a user auth token for.

Example Requests

export userId="156c5beb-7c9f-4f68-83c0-9479703ac490"

curl -X POST \
-H "Authorization: Bearer ${ENTERPRISE_API_KEY}" \
"https://api.sfox.com/v1/enterprise/user-tokens/${userId}"
const axios = require('axios');

const userId = "156c5beb-7c9f-4f68-83c0-9479703ac490"

const config = {
  method: 'post',
  url: `https://api.sfox.com/v1/enterprise/user-tokens/${userId}`,
  headers: {
    "Content-Type": "application/json",
    'Authorization': `Bearer ${process.env.ENTERPRISE_API_KEY}`
  }
}

axios(config)
  .then(response => {
    console.log(response.status)
    console.log(response.data)
  }).catch(err => {
    console.error(err.response.status)
    console.error(err.response.data)
  });
import requests
import os

userId = "156c5beb-7c9f-4f68-83c0-9479703ac490"

data = requests.post(
  f"https://api.sfox.com/v1/enterprise/user-tokens/{userId}",
  headers={
    "Authorization": f"Bearer {os.environ['ENTERPRISE_API_KEY']}"
  }
)
print(data.status_code)
print(data.json())

Response

Response Fields

Field
Description

data object

User auth token information.

token string

The user authentication token that you will use to access this specific user's sFOX account

partner_user_id string

The user_id the token grants access to.

expires string

The expiration date of the user auth token. ISO-8601 date and time in UTC time zone.

Responses

201 Created
User auth token for a single user_id
{
    "data": {
        "token": "bcf5ab0aa8dfebc86460338514dd022d63080277373002e6986d7925375a0087",
        "partner_user_id": "client_db29326e-5df6-4d8b-aaaa-b75dc194a0a2",
        "expires": "2024-05-14T19:22:09.901Z"
    }
}
PreviousConfirm Verification CodeNextCreate Multiple User Auth Tokens

Last updated 15 hours ago