logo

Barong

RESTful API for barong OAuth server

#Version: 2.7.0

Security

BearerToken

jwtundefined
DescriptionBearer Token authentication
NameAuthorization
Inheader

/api/v2/barong/identity/users/password/confirm_code

POST

Description

Sets new account password

Parameters
NameLocated inDescriptionRequiredSchema
reset_password_tokenformDataToken from emailYesstring
passwordformDataUser passwordYesstring
confirm_passwordformDataUser passwordYesstring
Responses
CodeDescription
201Resets password
400Required params are empty
404Record is not found
422Validation errors

/api/v2/barong/identity/users/password/generate_code

POST

Description

Send password reset instructions

Parameters
NameLocated inDescriptionRequiredSchema
emailformDataAccount emailYesstring
captcha_responseformDataResponse from captcha widgetNostring
Responses
CodeDescription
201Generated password reset code
400Required params are missing
404User doesn't exist
422Validation errors

/api/v2/barong/identity/users/email/confirm_code

POST

Description

Confirms an account

Parameters
NameLocated inDescriptionRequiredSchema
tokenformDataToken from emailYesstring
Responses
CodeDescription
201Confirms an account
400Required params are missing
422Validation errors

/api/v2/barong/identity/users/email/generate_code

POST

Description

Send confirmations instructions

Parameters
NameLocated inDescriptionRequiredSchema
emailformDataAccount emailYesstring
captcha_responseformDataResponse from captcha widgetNostring
Responses
CodeDescription
201Generated verification code
400Required params are missing
422Validation errors

/api/v2/barong/identity/users/register_geetest

GET

Description

Register Geetest captcha

Responses
CodeDescription
200Register Geetest captcha

/api/v2/barong/identity/users

POST

Description

Creates new user

Parameters
NameLocated inDescriptionRequiredSchema
emailformDataUser EmailYesstring
passwordformDataUser PasswordYesstring
usernameformDataUser UsernameNostring
refidformDataReferral uidNostring
captcha_responseformDataResponse from captcha widgetNostring
dataformDataAny additional key: value pairs in json string formatNostring
Responses
CodeDescription
201Creates new user
400Required params are missing
422Validation errors

/api/v2/barong/identity/users/access

POST

Description

Creates new whitelist restriction

Parameters
NameLocated inDescriptionRequiredSchema
whitelink_tokenformDataYesstring
Responses
CodeDescription
201Creates new user
400Required params are missing
422Validation errors

/api/v2/barong/identity/sessions

DELETE

Description

Destroy current session

Responses
CodeDescription
204Destroy current session
400Required params are empty
404Record is not found

POST

Description

Start a new session

Parameters
NameLocated inDescriptionRequiredSchema
emailformDataYesstring
passwordformDataYesstring
captcha_responseformDataResponse from captcha widgetNostring
otp_codeformDataCode from Google AuthenticatorNostring
Responses
CodeDescription
201Start a new session
400Required params are empty
404Record is not found

/api/v2/barong/identity/configs

GET

Description

Get barong configurations

Responses
CodeDescription
200Get barong configurations

/api/v2/barong/identity/version

GET

Description

Get barong version

Responses
CodeDescription
200Get barong version

/api/v2/barong/identity/time

GET

Description

Get server current unix timestamp.

Responses
CodeDescription
200Get server current unix timestamp.

/api/v2/barong/identity/ping

GET

Description

Test connectivity

Responses
CodeDescription
200Test connectivity

/api/v2/barong/identity/password/validate

POST

Description

Password strength testing

Parameters
NameLocated inDescriptionRequiredSchema
passwordformDataUser passwordYesstring
Responses
CodeDescription
201Password strength testing

/api/v2/barong/public/health/ready

GET

Description

Get application readiness status

Responses
CodeDescription
200Get application readiness status

/api/v2/barong/public/health/alive

GET

Description

Get application liveness status

Responses
CodeDescription
200Get application liveness status

/api/v2/barong/public/configs

GET

Description

Get barong configurations

Responses
CodeDescription
200Get barong configurations

/api/v2/barong/public/version

GET

Description

Get barong version

Responses
CodeDescription
200Get barong version

/api/v2/barong/public/time

GET

Description

Get server current unix timestamp.

Responses
CodeDescription
200Get server current unix timestamp.

/api/v2/barong/public/ping

GET

Description

Test connectivity

Responses
CodeDescription
200Test connectivity

/api/v2/barong/public/password/validate

POST

Description

Password strength testing

Parameters
NameLocated inDescriptionRequiredSchema
passwordformDataUser passwordYesstring
Responses
CodeDescription
201Password strength testing

/api/v2/barong/public/kyc

POST

Description

KYC callback

Responses
CodeDescription
201KYC callback

/api/v2/barong/resource/service_accounts/api_keys/{kid }

PUT

Description

Updates an api key

Parameters
NameLocated inDescriptionRequiredSchema
service_account_uidformDataYesstring
kidpathYesstring
scopeformDatacomma separated scopesNostring
stateformDataState of API Key. "active" state means key is active and can be used for authNostring
totp_codeformDataCode from Google AuthenticatorYesstring
Responses
CodeDescription
200Updates an api key
400Required params are empty
401Invalid bearer token
404Record is not found
422Validation errors
Security
Security SchemaScopes
BearerToken

DELETE

Description

Delete an api key for specific service account

Parameters
NameLocated inDescriptionRequiredSchema
service_account_uidqueryYesstring
kidpathYesstring
totp_codequeryCode from Google AuthenticatorYesstring
Responses
CodeDescription
204Succefully deleted
400Required params are empty
401Invalid bearer token
404Record is not found
Security
Security SchemaScopes
BearerToken

/api/v2/barong/resource/service_accounts/api_keys

POST

Description

Create api key for specific service account.

Parameters
NameLocated inDescriptionRequiredSchema
service_account_uidformDataYesstring
algorithmformDataYesstring
scopeformDatacomma separated scopesNostring
totp_codeformDataCode from Google AuthenticatorYesstring
Responses
CodeDescription
201Create api key for specific service account.
400Require 2FA and totp code
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

GET

Description

List all api keys for specific service account.

Parameters
NameLocated inDescriptionRequiredSchema
orderingqueryIf set, returned values will be sorted in specific order, defaults to 'asc'.Nostring
order_byqueryName of the field, which result will be ordered by.Nostring
pagequeryPage number (defaults to 1).Nointeger
limitqueryNumber of users per page (defaults to 100, maximum is 100).Nointeger
service_account_uidqueryYesstring
Responses
CodeDescription
200List all api keys for specific service account.
400Require 2FA and totp code
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

/api/v2/barong/resource/service_accounts

GET

Description

List all service accounts for current user.

Responses
CodeDescription
200List all service accounts for current user.
400Require 2FA and totp code
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

/api/v2/barong/resource/data_storage

POST

Description

Create data storage

Parameters
NameLocated inDescriptionRequiredSchema
titleformDataYesstring
dataformDataYesstring
Responses
CodeDescription
201Create data storage
401Invalid bearer token
422Validation errors
Security
Security SchemaScopes
BearerToken

/api/v2/barong/resource/api_keys

GET

Description

List all api keys for current account.

Parameters
NameLocated inDescriptionRequiredSchema
orderingqueryIf set, returned values will be sorted in specific order, defaults to 'asc'.Nostring
order_byqueryName of the field, which result will be ordered by.Nostring
pagequeryPage number (defaults to 1).Nointeger
limitqueryNumber of users per page (defaults to 100, maximum is 100).Nointeger
Responses
CodeDescription
200List all api keys for current account.
400Require 2FA and totp code
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

POST

Description

Create an api key

Parameters
NameLocated inDescriptionRequiredSchema
algorithmformDataYesstring
scopeformDatacomma separated scopesNostring
totp_codeformDataCode from Google AuthenticatorYesstring
Responses
CodeDescription
201Create an api key
400Required params are empty
401Invalid bearer token
422Validation errors
Security
Security SchemaScopes
BearerToken

/api/v2/barong/resource/api_keys/{kid }

DELETE

Description

Delete an api key

Parameters
NameLocated inDescriptionRequiredSchema
kidpathYesstring
totp_codequeryCode from Google AuthenticatorYesstring
Responses
CodeDescription
204Succefully deleted
400Required params are empty
401Invalid bearer token
404Record is not found
Security
Security SchemaScopes
BearerToken

PATCH

Description

Updates an api key

Parameters
NameLocated inDescriptionRequiredSchema
kidpathYesstring
scopeformDatacomma separated scopesNostring
stateformDataState of API Key. "active" state means key is active and can be used for authNostring
totp_codeformDataCode from Google AuthenticatorYesstring
Responses
CodeDescription
200Updates an api key
400Required params are empty
401Invalid bearer token
404Record is not found
422Validation errors
Security
Security SchemaScopes
BearerToken

/api/v2/barong/resource/otp/verify

POST

Description

Verify 2FA code

Parameters
NameLocated inDescriptionRequiredSchema
codeformDataCode from Google AuthenticatorYesstring
Responses
CodeDescription
201Verify 2FA code
4002FA has not been enabled for this account or code is missing
401Invalid bearer token
422Validation errors
Security
Security SchemaScopes
BearerToken

/api/v2/barong/resource/otp/disable

POST

Description

Disable 2FA

Parameters
NameLocated inDescriptionRequiredSchema
codeformDataCode from Google AuthenticatorYesstring
Responses
CodeDescription
201Disable 2FA
4002FA has not been enabled for this account or code is missing
401Invalid bearer token
422Validation errors
Security
Security SchemaScopes
BearerToken

/api/v2/barong/resource/otp/enable

POST

Description

Enable 2FA

Parameters
NameLocated inDescriptionRequiredSchema
codeformDataCode from Google AuthenticatorYesstring
Responses
CodeDescription
201Enable 2FA
4002FA has been enabled for this account or code is missing
401Invalid bearer token
422Validation errors
Security
Security SchemaScopes
BearerToken

/api/v2/barong/resource/otp/generate_qrcode

POST

Description

Generate qr code for 2FA

Responses
CodeDescription
201Generate qr code for 2FA
4002FA has been enabled for this account
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

/api/v2/barong/resource/phones/verify

POST

Description

Verify a phone

Parameters
NameLocated inDescriptionRequiredSchema
phone_numberformDataPhone number with country codeYesstring
verification_codeformDataVerification code from smsYesstring
Responses
CodeDescription
201Verify a phone
400Required params are empty
401Invalid bearer token
404Record is not found
Security
Security SchemaScopes
BearerToken

/api/v2/barong/resource/phones/send_code

POST

Description

Resend activation code

Parameters
NameLocated inDescriptionRequiredSchema
phone_numberformDataPhone number with country codeYesstring
channelformDataThe verification method to useNostring
Responses
CodeDescription
201Resend activation code
400Required params are empty
401Invalid bearer token
404Record is not found
422Validation errors
Security
Security SchemaScopes
BearerToken

/api/v2/barong/resource/phones

POST

Description

Add new phone

Parameters
NameLocated inDescriptionRequiredSchema
phone_numberformDataPhone number with country codeYesstring
channelformDataThe verification method to useNostring
Responses
CodeDescription
201Add new phone
400Required params are empty
401Invalid bearer token
404Record is not found
422Validation errors
Security
Security SchemaScopes
BearerToken

GET

Description

Returns list of user's phones

Responses
CodeDescription
200Returns list of user's phones
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

/api/v2/barong/resource/documents

POST

Description

Upload a new document for current user

Parameters
NameLocated inDescriptionRequiredSchema
doc_typeformDataDocument typeYesstring
doc_numberformDataDocument numberYesstring
uploadformDataArray of Rack::Multipart::UploadedFileYesstring
doc_expireformDataDocument expiration dateNodate
doc_categoryformDataCategory of the submitted document - front/back/selfie etc.Nostring
identificatorformDataIdentificator for documents to be supplied togetherNostring
metadataformDataAny additional key: value pairs in json string formatNostring
Responses
CodeDescription
201Document is uploaded
400Required params are empty
401Invalid bearer token
422Validation errors
Security
Security SchemaScopes
BearerToken

GET

Description

Return current user documents list

Responses
CodeDescription
200Return current user documents list
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

/api/v2/barong/resource/profiles

PUT

Description

Update a profile for current_user

Parameters
NameLocated inDescriptionRequiredSchema
first_nameformDataNostring
last_nameformDataNostring
dobformDataNodate
addressformDataNostring
postcodeformDataNostring
cityformDataNostring
countryformDataNostring
metadataformDataAny additional key: value pairs in json string formatNostring
confirmformDataProfile confirmationNoboolean
Responses
CodeDescription
200Update a profile for current_user
401Invalid bearer token
422Validation errors
Security
Security SchemaScopes
BearerToken

POST

Description

Create a profile for current_user

Parameters
NameLocated inDescriptionRequiredSchema
first_nameformDataNostring
last_nameformDataNostring
dobformDataNodate
addressformDataNostring
postcodeformDataNostring
cityformDataNostring
countryformDataNostring
metadataformDataAny additional key: value pairs in json string formatNostring
confirmformDataProfile confirmationNoboolean
Responses
CodeDescription
201Create a profile for current_user
400Required params are empty
401Invalid bearer token
409Profile already exists
422Validation errors
Security
Security SchemaScopes
BearerToken

/api/v2/barong/resource/profiles/me

GET

Description

Return profiles of current resource owner

Responses
CodeDescription
200Return profiles of current resource owner
401Invalid bearer token
404User has no profile
Security
Security SchemaScopes
BearerToken

/api/v2/barong/resource/labels/{key }

DELETE

Description

Delete a label with 'public' scope.

Parameters
NameLocated inDescriptionRequiredSchema
keypathLabel key.Yesstring
Responses
CodeDescription
204Succefully deleted
400Required params are empty
401Invalid bearer token
404Record is not found
Security
Security SchemaScopes
BearerToken

PATCH

Description

Update a label with 'public' scope.

Parameters
NameLocated inDescriptionRequiredSchema
keypathLabel key.Yesstring
valueformDataLabel value.Yesstring
Responses
CodeDescription
200Update a label with 'public' scope.
400Required params are empty
401Invalid bearer token
404Record is not found
422Validation errors
Security
Security SchemaScopes
BearerToken

GET

Description

Return a label by key.

Parameters
NameLocated inDescriptionRequiredSchema
keypathLabel key.Yesstring
Responses
CodeDescription
200Return a label by key.
400Required params are empty
401Invalid bearer token
404Record is not found
Security
Security SchemaScopes
BearerToken

/api/v2/barong/resource/labels

POST

Description

Create a label with 'public' scope.

Parameters
NameLocated inDescriptionRequiredSchema
keyformDataLabel key.Yesstring
valueformDataLabel value.Yesstring
Responses
CodeDescription
201Create a label with 'public' scope.
400Required params are empty
401Invalid bearer token
422Validation errors
Security
Security SchemaScopes
BearerToken

GET

Description

List all labels for current user.

Responses
CodeDescription
200List all labels for current user.
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

/api/v2/barong/resource/users/password

PUT

Description

Sets new account password

Parameters
NameLocated inDescriptionRequiredSchema
old_passwordformDataPrevious account passwordYesstring
new_passwordformDataUser passwordYesstring
confirm_passwordformDataUser passwordYesstring
Responses
CodeDescription
201Changes password
400Required params are empty
404Record is not found
422Validation errors

/api/v2/barong/resource/users/activity/{topic }

GET

Description

Returns user activity

Parameters
NameLocated inDescriptionRequiredSchema
topicpathTopic of user activity. Allowed: [all, password, session, otp]Yesstring
time_fromqueryAn integer represents the seconds elapsed since Unix epoch.If set, only activities created after the time will be returned.Nointeger
time_toqueryAn integer represents the seconds elapsed since Unix epoch.If set, only activities created before the time will be returned.Nointeger
resultqueryResult of user activity. Allowed: [succeed, failed, denied]Nostring
pagequeryPage number (defaults to 1).Nointeger
limitqueryNumber of users per page (defaults to 100, maximum is 100).Nointeger
Responses
CodeDescription
200Returns user activity

/api/v2/barong/resource/users/me

DELETE

Description

Blocks current user

Parameters
NameLocated inDescriptionRequiredSchema
passwordqueryAccount passwordYesstring
otp_codequeryCode from Google AuthenticatorNostring
Responses
CodeDescription
204Blocks current user

PUT

Description

Updates current user data field

Parameters
NameLocated inDescriptionRequiredSchema
dataformDataAny additional key: value pairs in json string formatYesstring
Responses
CodeDescription
200Updates current user data field

GET

Description

Returns current user

Responses
CodeDescription
200Returns current user

/api/v2/barong/resource/addresses

POST

Description

Upload a new address approval document for current user

Parameters
NameLocated inDescriptionRequiredSchema
countryformDataDocument typeYesstring
addressformDataDocument numberYesstring
uploadformDataArray of Rack::Multipart::UploadedFileYesstring
cityformDataDocument expiration dateYesstring
postcodeformDataAny additional key: value pairs in json string formatYesstring
Responses
CodeDescription
201Document is uploaded
400Required params are empty
401Invalid bearer token
422Validation errors
Security
Security SchemaScopes
BearerToken

Models

API_V2_Entities_Level

NameTypeDescriptionRequired
idintegerLevel identifier, level numberNo
keystringLabel key. [A-Za-z0-9_-] should be used. Min - 3, max - 255 characters.No
valuestringLabel value. [A-Za-z0-9_-] should be used. Min - 3, max - 255 characters.No

API_V2_Entities_Label

NameTypeDescriptionRequired
keystringLabel key. [a-z0-9_-]+ should be used. Min - 3, max - 255 characters.No
valuestringLabel value. [A-Za-z0-9_-] should be used. Min - 3, max - 255 characters.No
scopestringLabel scope: 'public' or 'private'No
created_atstringNo
updated_atstringNo

API_V2_Entities_APIKey

NameTypeDescriptionRequired
kidstringjwt public keyNo
algorithmstringcryptographic hash function typeNo
scopestringserialized array of scopesNo
statestringactive/non-active state of keyNo
secretstringNo
created_atstringNo
updated_atstringNo

API_V2_Entities_Profile

NameTypeDescriptionRequired
first_namestringNo
last_namestringSubmasked last nameNo
dobdateSubmasked birthday dateNo
addressstringNo
postcodestringNo
citystringNo
countrystringNo
statestringNo
metadataobjectProfile additional fieldsNo
created_atstringNo
updated_atstringNo

API_V2_Entities_User

NameTypeDescriptionRequired
emailstringNo
usernamestringUser usernameNo
uidstringNo
rolestringNo
levelintegerNo
otpbooleanis 2FA enabled for accountNo
statestringNo
referral_uidstringUID of referrerNo
datastringadditional phone and profile infoNo

API_V2_Entities_UserWithProfile

NameTypeDescriptionRequired
emailstringNo
usernamestringUser usernameNo
uidstringNo
rolestringNo
levelintegerNo
otpbooleanis 2FA enabled for accountNo
statestringNo
datastringadditional phone and profile infoNo
profilesAPI_V2_Entities_ProfileNo
referral_uidstringUID of referrerNo
created_atstringNo
updated_atstringNo

API_V2_Entities_UserWithKYC

NameTypeDescriptionRequired
emailstringNo
usernamestringUser usernameNo
uidstringNo
rolestringNo
levelintegerNo
otpbooleanNo
statestringNo
datastringadditional phone and profile infoNo
profilesAPI_V2_Entities_ProfileNo
labelsAPI_V2_Entities_AdminLabelViewNo
phonesAPI_V2_Entities_PhoneNo
documentsAPI_V2_Entities_DocumentNo
data_storagesAPI_V2_Entities_DataStorageNo
commentsAPI_V2_Entities_CommentNo
referral_uidstringUID of referrerNo
created_atstringNo
updated_atstringNo

API_V2_Entities_AdminLabelView

NameTypeDescriptionRequired
keystringLabel key. [a-z0-9_-]+ should be used. Min - 3, max - 255 characters.No
valuestringLabel value. [A-Za-z0-9_-] should be used. Min - 3, max - 255 characters.No
scopestringLabel scope: 'public' or 'private'No
descriptionstringLabel desc: json string with any additional informationNo
created_atstringNo
updated_atstringNo

API_V2_Entities_Phone

NameTypeDescriptionRequired
countrystringNo
numberstringSubmasker phone numberNo
validated_ats (g)No

API_V2_Entities_Document

NameTypeDescriptionRequired
uploadstringfile urlNo
doc_typestringdocument type: passport, driver licenseNo
doc_numberstringSubmasker document number: AB123123 typeNo
doc_expirestringexpire date of uploaded documentsNo
metadatastringany additional stored dataNo
created_atstringNo
updated_atstringNo

API_V2_Entities_DataStorage

NameTypeDescriptionRequired
titlestringany additional data titleNo
datastringany additional data json key:value pairsNo
created_atstringNo
updated_atstringNo

API_V2_Entities_Comment

NameTypeDescriptionRequired
idintegercomment idNo
author_uidstringcomment authorNo
titlestringcomment titleNo
datastringcomment plain textNo
created_atstringNo
updated_atstringNo

API_V2_Entities_UserWithFullInfo

NameTypeDescriptionRequired
emailstringNo
usernamestringUser usernameNo
uidstringNo
rolestringNo
levelintegerNo
otpbooleanNo
statestringNo
referral_uidstringUID of referrerNo
csrf_tokenstringcsrf protection tokenNo
datastringadditional phone and profile infoNo
created_atstringNo
updated_atstringNo
labelsAPI_V2_Entities_LabelNo
phonesAPI_V2_Entities_PhoneNo
profilesAPI_V2_Entities_ProfileNo
data_storagesAPI_V2_Entities_DataStorageNo

API_V2_Entities_Activity

NameTypeDescriptionRequired
user_ipstringNo
user_agentstringNo
topicstringNo
actionstringNo
resultstringNo
datastringNo
created_atstringNo

API_V2_Entities_ServiceAccounts

NameTypeDescriptionRequired
emailstringNo
uidstringNo
rolestringNo
levelintegerNo
statestringNo
userAPI_V2_Entities_UserNo
created_atstringNo
updated_atstringNo