Create OAuth Key

OAuth Details

KeyTypeRequiredDescription

refresh_token

String

Required during POST

Token used to generate an OAuth Object.

scope

Array of Strings

Required during POST

Scopes denote which API calls and actions the OAuth key is allowed to do. This field is worth customizing if you will be sending the OAuth key to the client device for certain actions reducing the damage a man-in-the-middle attack can do.

Fingerprints

As fingerprints are required for OAuth key generation calls, there are options to consider related to the users fingerprint.

KeyTypeRequiredDescription

is_active

Boolean

Optional

Will execute the MFA flow, to allow changing of is_protected fingerprint value.

is_protected

Boolean

Optional (Requires is_active:true)

Setting to true prevents a fingerprint from being removed once the fingerprint array capacity limit is reached.

OAuth

POST https://api.synapsefi.com/v3.1/oauth/:user_id

This endpoint allows you to generate an OAuth token for a specific user so that you can perform necessary actions on behalf of the user.

Path Parameters

NameTypeDescription

user_id

string

ID of the user you wish to generate an OAuth token for.

Headers

NameTypeDescription

X-SP-USER

string

OAuth key and device fingerprint of the user separated by a pipe. In this API call, only the device fingerprint is required.

X-SP-USER-IP

string

IP Address of the user device.

X-SP-GATEWAY

string

Your Client ID and Secret separated by a pipe.

Request Body

NameTypeDescription

validation_pin

string

In case of MFA verification, the code delivered to the phone_number.

phone_number

string

Phone number where the MFA code will be sent in an instance of a new fingerprint registration.

scope

array

Array of Scopes the OAuth key will allow. Go to Possible Scopes to learn more.

refresh_token

string

Refresh token associated with the user.

{
    "client_id": "589acd9ecb3cd400fa75ac06",
    "client_name": "SynapseFi",
    "expires_at": "1607975765",
    "expires_in": "7200",
    "oauth_key": "oauth_CA1PJ45ILl2kyhaKGbNgntDQHwe6EifOsvz807ZV",
    "refresh_expires_in": 9,
    "refresh_token": "refresh_ydA5vGjnbHh2SipakwIMJe0TUVmKg7Dt8rBC6N1R",
    "scope": [
        "USER|PATCH",
        "USER|GET",
        "NODES|POST",
        "NODES|GET",
        "NODE|GET",
        "NODE|PATCH",
        "NODE|DELETE",
        "TRANS|POST",
        "TRANS|GET",
        "TRAN|GET",
        "TRAN|PATCH",
        "TRAN|DELETE",
        "SUBNETS|POST",
        "SUBNETS|GET",
        "SUBNET|GET",
        "SUBNET|PATCH",
        "STATEMENTS|GET",
        "STATEMENT|GET",
        "STATEMENTS|POST",
        "CONVERSATIONS|POST",
        "CONVERSATIONS|GET",
        "CONVERSATION|GET",
        "CONVERSATION|PATCH",
        "MESSAGES|POST",
        "MESSAGES|GET"
    ],
    "user_id": "5faa6da8f8db933dac59bdc5"
}

Example Request

POST /v3.1/oauth/5faa6da8f8db933dac59bdc5 HTTP/1.1
Host: uat-api.synapsefi.com
X-SP-GATEWAY: client_id_2bb1e412edd311e6bd04e285d6015267|client_secret_6zZVr8biuqGkyo9IxMO5jY2QlSp0nmD4EBAgKcJW
X-SP-USER-IP: 255.127.79.76
X-SP-USER: |e83cf6ddcf778e37bfe3d48fc78a6502062fc
Content-Type: application/json

{
  "refresh_token": "refresh_ydA5vGjnbHh2SipakwIMJe0TUVmKg7Dt8rBC6N1R",
  "scope": [
    "USER|PATCH",
    "USER|GET",
    "NODES|POST",
    "NODES|GET",
    "NODE|GET",
    "NODE|PATCH",
    "NODE|DELETE",
    "TRANS|POST",
    "TRANS|GET",
    "TRAN|GET",
    "TRAN|PATCH",
    "TRAN|DELETE",
    "SUBNETS|POST",
    "SUBNETS|GET",
    "SUBNET|GET",
    "SUBNET|PATCH",
    "STATEMENTS|GET",
    "STATEMENT|GET",
    "STATEMENTS|POST",
    "CONVERSATIONS|POST",
    "CONVERSATIONS|GET",
    "CONVERSATION|GET",
    "CONVERSATION|PATCH",
    "MESSAGES|POST",
    "MESSAGES|GET"
  ]
}

Last updated