sFOX API
Sign InOpen Account
sFOX API
sFOX API
  • Introduction
    • Welcome
    • Getting Started
    • Systems & Operations
    • Rate Limits
  • REST API
    • REST Endpoints
    • Authentication
    • Rate Limits
    • Account Management
      • Get All Balances
      • Get All Currencies
      • Get All Currency Pairs
      • Get All Transactions
      • Get Fees
    • Orders
      • Order Types
      • Create Order
      • Cancel Order
      • Cancel Multiple Orders
      • Cancel All Orders
      • Amend Order
      • Get Single Order
      • Get All Open Orders
      • Get All Done Orders
      • Get All Trades
    • Request for Quote (RFQ)
    • Post-Trade Settlement (PTS)
      • Get Account Risk Metrics
      • Get All Positions
      • Get All Funding Transactions
      • Get All Funding Rates
      • Get All Risk Modes
      • Create Transfer
    • Shorting
      • Get Account Risk Metrics
      • Get All Positions
    • Transfers
      • Get All Deposit Addresses
      • Get Single Deposit Address
      • Create Deposit Address
      • Deposit From Bank Account
      • Withdraw From Account
      • Get Single Withdrawal Fee
      • Create Transfer
    • Custody (sFOX SAFE)
      • Get Whitelisted Addresses
      • Add Whitelisted Address
      • Delete Whitelisted Address
      • Get Approval Rules
      • Create Approval Rule
      • Edit Approval Rule
      • Get Approval Requests
      • Respond to Approval Request
    • Staking
      • Get Staking Currencies
      • Get All Staking Transactions
      • Create Stake
      • Cancel Stake
      • Unstake
    • Market Data
      • Get Candlesticks
      • Get Volume Analytics
      • Get Order Estimate
      • Get Order Book
    • Reporting
      • Get Orders Report
      • Get Monthly Summary
      • Get Portfolio Valuation
      • Get All Transactions
  • WebSocket API
    • Introduction
    • Connecting
    • Rate Limits
    • Authentication
    • Subscribing & Unsubscribing
    • Message Format
    • Market Data
      • Order Book
      • Trades
      • Ticker
    • Orders & Account Data
      • Orders
      • Trades
      • Balances
      • Post-Trade Settlement
  • FIX API
    • FIX Order Entry
    • FIX Market Data
    • QuickFIX Guide
  • Errors
    • Error Codes
Powered by GitBook
  1. REST API
  2. Custody (sFOX SAFE)

Create Approval Rule

POST https://api.sfox.com/v1/approval-rules

Add a new crypto address to your account's whitelisted withdrawal addresses.

If you have an approval rule for altering SAFE settings, the new rule may not be immediately added to your account as it may require approval from other users in your account.

Body Parameters

Parameter
Type
Description

rule_type required

string

The type of approval rule to create. Possible values:

  • WITHDRAW: Approval rule for withdrawals.

  • ADD_ALTER_COLL: Adding/editing users in your account.

  • ALTER_SAFE: Adding/editing approval rules in your account.

required_approvals required

int

Number of approvals needed for the action to be approved.

threshold

number

The withdrawal amount (USD) required for the action to require approvals. Required if rule_type = WITHDRAW

Responses

200
{
  id: 1,
  rule_type: "WITHDRAW",
  date_added: "2021-03-17T16:19:47.000Z",
  status: "Pending",
  available_approver_count: 2,
  required_approvals: 2,
  threshold: 0,
}

Example Requests

curl -X POST \
  -H 'Content-type: application/json' \
  -H 'Authorization: Bearer <API_TOKEN>' \
  --data '{ "rule_type":  "WITHDRAW", 
            "required_approvals":  2, 
            "threshold":  100 }'  \
  'https://api.sfox.com/v1/approval-rules'
const axios = require('axios');

axios({
  method: 'post',
  url: 'https://api.sfox.com/v1/approval-rules',
  headers: {
    'Authorization': 'Bearer <API_KEY>'
  },
  data: { 
    rule_type:  "WITHDRAW", 
    required_approvals:  2, 
    threshold:  100 
  }
}).then(response => {
  console.log(response)
}).catch(err => {
  console.error(err)
});
import requests

data = requests.post(
  "https://api.sfox.com/v1/approval-rules",
  headers={
    "Authorization": "Bearer <API_KEY>",
  },
  data={
   "rule_type": "WITHDRAW",
   "required_approvals": 2,
   "threshold": 100
  }
)
print(data)
PreviousGet Approval RulesNextEdit Approval Rule

Last updated 1 year ago