Create OAuth Key

post
OAuth

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.
Request
Response
Request
Path Parameters
user_id
required
string
ID of the user you wish to generate an OAuth token for.
Headers
X-SP-USER
required
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
required
string
IP Address of the user device.
X-SP-GATEWAY
required
string
Your Client ID and Secret separated by a pipe.
Body Parameters
validation_pin
optional
string
In case of MFA verification, the code delivered to the phone_number.
phone_number
optional
string
Phone number where the MFA code will be sent in an instance of a new fingerprint registration.
scope
required
array
Array of Scopes the OAuth key will allow. Go to Possible Scopes to learn more.
refresh_token
required
string
Refresh token associated with the user.
Response
200: OK
Cake successfully retrieved.
{
"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"
}
202: Accepted
Incase where supplied Fingerprint is not registered to the user profile. User will be prompted to go through the MFA flow. Phone Numbers are pulled from the `phone_numbers field on the User Object.
Before MFA
After MFA
Before MFA
{
"error": {
"en": "Fingerprint not registered. Please perform the MFA flow."
},
"error_code": "10",
"http_code": "202",
"phone_numbers": [
"901.111.1111"
],
"success": false
}
After MFA
{
"error_code": "10",
"http_code": "202",
"message": {
"en": "MFA sent to 901.942.8167."
},
"success": true
}
400: Bad Request
Request Failing.
{
"error": {
"code": "invalid_fingerprint",
"en": "Fingerprint not registered."
},
"error_code": "300",
"http_code": "401",
"success": false
}

Example Request

HTTP
cURL
Python
JS
PHP
GO
HTTP
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"
]
}
cURL
curl --location --request POST 'https://uat-api.synapsefi.com/v3.1/oauth/5faa6da8f8db933dac59bdc5' \
--header 'X-SP-GATEWAY: client_id_2bb1e412edd311e6bd04e285d6015267|client_secret_6zZVr8biuqGkyo9IxMO5jY2QlSp0nmD4EBAgKcJW' \
--header 'X-SP-USER-IP: 255.127.79.76' \
--header 'X-SP-USER: |e83cf6ddcf778e37bfe3d48fc78a6502062fc' \
--header 'Content-Type: application/json' \
--data-raw '{
"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"
]
}'
Python
JS
PHP
GO