logo

Barong

RESTful AdminAPI for barong OAuth server

#Version: 2.6.49

Security

BearerToken

basicBasic
DescriptionBearer Token authentication
NameAuthorization
Inheader

/api/v2/barong/admin/users/data_storage

DELETE

Description

Deletes user's data storage record

Parameters
NameLocated inDescriptionRequiredSchema
uidqueryuser uniq idYesstring
titlequerydata storage uniq titleYesstring
Responses
CodeDescriptionSchema
204Deletes user's data storage recordAPI_V2_Admin_Entities_UserWithKYC
401Invalid bearer token

/api/v2/barong/admin/users/{uid }

GET

Description

Returns user info

Parameters
NameLocated inDescriptionRequiredSchema
uidpathuser uniq idYesstring
Responses
CodeDescriptionSchema
200Returns user infoAPI_V2_Admin_Entities_UserWithKYC
401Invalid bearer token

/api/v2/barong/admin/users/documents/pending

GET

Description

Returns array of users with pending or replaced documents as paginated collection

Parameters
NameLocated inDescriptionRequiredSchema
extendedqueryWhen true endpoint returns full information about usersNoboolean
uidqueryNostring
emailqueryNostring
rolequeryNostring
first_namequeryNostring
last_namequeryNostring
countryqueryNostring
levelqueryNointeger
statequeryNostring
rangequeryNostring
fromqueryAn integer represents the seconds elapsed since Unix epoch.If set, only records FROM the time will be retrieved.Nointeger
toqueryAn integer represents the seconds elapsed since Unix epoch.If set, only records BEFORE the time will be retrieved.Nointeger
pagequeryPage number (defaults to 1).Nointeger
limitqueryNumber of users per page (defaults to 100, maximum is 100).Nointeger
Responses
CodeDescriptionSchema
200Returns array of users with pending or replaced documents as paginated collectionAPI_V2_Entities_User
401Invalid bearer token

/api/v2/barong/admin/users

PUT

Description

Update user attributes

Parameters
NameLocated inDescriptionRequiredSchema
uidformDatauser uniq idYesstring
emailformDataUser EmailNostring
stateformDatauser stateNostring
otpformDatauser 2fa statusNoboolean
Responses
CodeDescription
200User attributes were created
401Invalid bearer token

GET

Description

Returns array of users as paginated collection

Parameters
NameLocated inDescriptionRequiredSchema
extendedqueryWhen true endpoint returns full information about usersNoboolean
uidqueryNostring
emailqueryNostring
rolequeryNostring
countryqueryNostring
levelqueryNointeger
statequeryNostring
rangequeryNostring
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
fromqueryAn integer represents the seconds elapsed since Unix epoch.If set, only records FROM the time will be retrieved.Nointeger
toqueryAn integer represents the seconds elapsed since Unix epoch.If set, only records BEFORE the time will be retrieved.Nointeger
pagequeryPage number (defaults to 1).Nointeger
limitqueryNumber of users per page (defaults to 100, maximum is 100).Nointeger
Responses
CodeDescriptionSchema
200Returns array of users as paginated collectionAPI_V2_Entities_User
401Invalid bearer token

/api/v2/barong/admin/users/role

POST

Description

Update user role

Parameters
NameLocated inDescriptionRequiredSchema
uidformDatauser uniq idYesstring
roleformDatauser roleYesstring
Responses
CodeDescription
200User role was created
401Invalid bearer token

/api/v2/barong/admin/users/update

POST

Description

Update user attributes

Parameters
NameLocated inDescriptionRequiredSchema
uidformDatauser uniq idYesstring
stateformDatauser stateNostring
otpformDatauser 2fa statusNoboolean
Responses
CodeDescription
200User attributes were updated
401Invalid bearer token

/api/v2/barong/admin/users/labels

DELETE

Description

Deletes label for user

Parameters
NameLocated inDescriptionRequiredSchema
uidqueryuser uniq idYesstring
keyquerylabel key. [a-z0-9_-]+ should be used. Min - 3, max - 255 characters.Yesstring
scopequerylabel key. [a-z0-9_-]+ should be used. Min - 3, max - 255 characters.Yesstring
Responses
CodeDescription
204Label was deleted
401Invalid bearer token

PUT

Description

Update user label scope

Parameters
NameLocated inDescriptionRequiredSchema
uidformDatauser uniq idYesstring
keyformDataLabel key.Yesstring
scopeformDatalabel key. [a-z0-9_-]+ should be used. Min - 3, max - 255 characters.Yesstring
descriptionformDatalabel description. [A-Za-z0-9_-] should be used. max - 255 characters.Nostring
valueformDataLabel value.Yesstring
Responses
CodeDescription
200Label was updated
400Required params are empty
401Invalid bearer token
404Record is not found
422Validation errors

POST

Description

Add label for user

Parameters
NameLocated inDescriptionRequiredSchema
uidformDatauser uniq idYesstring
keyformDatalabel key. [a-z0-9_-]+ should be used. Min - 3, max - 255 characters.Yesstring
valueformDatalabel value. [A-Za-z0-9_-] should be used. Min - 3, max - 255 characters.Yesstring
descriptionformDatalabel description. [A-Za-z0-9_-] should be used. max - 255 characters.Nostring
scopeformDataLabel scope: 'public' or 'private'. Default is publicNostring
Responses
CodeDescription
200Label was created
401Invalid bearer token

GET

Description

Returns array of users as paginated collection

Parameters
NameLocated inDescriptionRequiredSchema
keyqueryLabel keyYesstring
valuequeryLabel valueYesstring
pagequeryPage number (defaults to 1).Nointeger
limitqueryNumber of users per page (defaults to 100, maximum is 100).Nointeger
Responses
CodeDescriptionSchema
200Returns array of users as paginated collectionAPI_V2_Entities_User
401Invalid bearer token

/api/v2/barong/admin/users/labels/update

POST

Description

Update user label value

Parameters
NameLocated inDescriptionRequiredSchema
uidformDatauser uniq idYesstring
keyformDataLabel key.Yesstring
scopeformDatalabel key. [a-z0-9_-]+ should be used. Min - 3, max - 255 characters.Yesstring
valueformDataLabel value.Yesstring
descriptionformDatalabel description. [A-Za-z0-9_-] should be used. max - 255 characters.Nostring
replaceformDataWhen true label will be created if not existNoboolean
Responses
CodeDescription
200Label was updated
400Required params are empty
401Invalid bearer token
404Record is not found
422Validation errors

/api/v2/barong/admin/users/labels/list

GET

Description

Returns existing labels keys and values

Responses
CodeDescription
200Returns existing labels keys and values
401Invalid bearer token

/api/v2/barong/admin/users/comments

DELETE

Description

Delete user's comment

Parameters
NameLocated inDescriptionRequiredSchema
idquerycomment uniq idYesinteger
Responses
CodeDescriptionSchema
204Delete user's commentAPI_V2_Admin_Entities_UserWithKYC
401Invalid bearer token

PUT

Description

Edit user's comment

Parameters
NameLocated inDescriptionRequiredSchema
idformDatacomment uniq idYesinteger
titleformDatacomment titleNostring
dataformDatacomment dataNostring
Responses
CodeDescriptionSchema
200Edit user's commentAPI_V2_Admin_Entities_UserWithKYC
401Invalid bearer token

POST

Description

Adds new user's comment

Parameters
NameLocated inDescriptionRequiredSchema
uidformDatauser uniq idYesstring
titleformDatacomment uniq titleYesstring
dataformDatacomment dataYesstring
Responses
CodeDescriptionSchema
201Adds new user's commentAPI_V2_Admin_Entities_UserWithKYC
401Invalid bearer token

/api/v2/barong/admin/api_keys

GET

Description

List all api keys for selected account.

Parameters
NameLocated inDescriptionRequiredSchema
uidqueryuser uniq idYesstring
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
CodeDescriptionSchema
200List all api keys for selected account.API_V2_Entities_APIKey
401Invalid bearer token

/api/v2/barong/admin/permissions

PUT

Description

Update Permission

Parameters
NameLocated inDescriptionRequiredSchema
idformDataPermission idYesinteger
roleformDatapermission field - roleNostring
verbformDatapermission field - request verbNostring
pathformDatapermission field - request pathNostring
actionformDataNostring
topicformDataNostring
Responses
CodeDescription
200Permission was updated
401Invalid bearer token

DELETE

Description

Deletes permission

Parameters
NameLocated inDescriptionRequiredSchema
idquerypermission idYesinteger
Responses
CodeDescription
204Permission was deleted
401Invalid bearer token

POST

Description

Create permission

Parameters
NameLocated inDescriptionRequiredSchema
roleformDataYesstring
verbformDataYesstring
pathformDataYesstring
actionformDataYesstring
topicformDataNostring
Responses
CodeDescription
200Permission was created
401Invalid bearer token

GET

Description

Returns array of permissions as paginated collection

Parameters
NameLocated inDescriptionRequiredSchema
pagequeryPage number (defaults to 1).Nointeger
limitqueryNumber of users per page (defaults to 100, maximum is 100).Nointeger
Responses
CodeDescriptionSchema
200Returns array of permissions as paginated collectionAPI_V2_Entities_Permission
401Invalid bearer token

/api/v2/barong/admin/activities/admin

GET

Description

Returns array of activities as paginated collection

Parameters
NameLocated inDescriptionRequiredSchema
topicqueryNostring
actionqueryNostring
uidqueryNostring
emailqueryNostring
fromqueryAn integer represents the seconds elapsed since Unix epoch.If set, only records FROM the time will be retrieved.Nointeger
toqueryAn integer represents the seconds elapsed since Unix epoch.If set, only records BEFORE the time will be retrieved.Nointeger
pagequeryPage number (defaults to 1).Nointeger
limitqueryNumber of users per page (defaults to 100, maximum is 100).Nointeger
target_uidqueryNostring
rangequeryNostring
Responses
CodeDescriptionSchema
200Returns array of activities as paginated collectionAPI_V2_Admin_Entities_AdminActivity
401Invalid bearer token

/api/v2/barong/admin/activities

GET

Description

Returns array of activities as paginated collection

Parameters
NameLocated inDescriptionRequiredSchema
topicqueryNostring
actionqueryNostring
uidqueryNostring
emailqueryNostring
fromqueryAn integer represents the seconds elapsed since Unix epoch.If set, only records FROM the time will be retrieved.Nointeger
toqueryAn integer represents the seconds elapsed since Unix epoch.If set, only records BEFORE the time will be retrieved.Nointeger
pagequeryPage number (defaults to 1).Nointeger
limitqueryNumber of users per page (defaults to 100, maximum is 100).Nointeger
Responses
CodeDescriptionSchema
200Returns array of activities as paginated collectionAPI_V2_Admin_Entities_ActivityWithUser
401Invalid bearer token

/api/v2/barong/admin/metrics

GET

Description

Returns main statistic in the given time period

Parameters
NameLocated inDescriptionRequiredSchema
created_fromqueryNostring
created_toqueryNostring
Responses
CodeDescription
200Returns main statistic in the given time period
401Invalid bearer token

/api/v2/barong/admin/restrictions

DELETE

Description

Delete restriction

Parameters
NameLocated inDescriptionRequiredSchema
idqueryRestriction idYesinteger
Responses
CodeDescription
204Restriction was deleted
401Invalid bearer token

PUT

Description

Update restriction

Parameters
NameLocated inDescriptionRequiredSchema
idformDataRestriction idYesinteger
scopeformDataNostring
categoryformDataNostring
valueformDataNostring
stateformDataNostring
codeformDataNointeger
Responses
CodeDescription
200Restriction was updated
401Invalid bearer token

POST

Description

Create restriction

Parameters
NameLocated inDescriptionRequiredSchema
scopeformDataYesstring
valueformDataYesstring
categoryformDataYesstring
stateformDataNostring
codeformDataNointeger
Responses
CodeDescription
200Restriction was created
401Invalid bearer token

GET

Description

Returns array of restrictions as a paginated collection

Parameters
NameLocated inDescriptionRequiredSchema
scopequeryNostring
categoryqueryNostring
rangequeryNostring
pagequeryPage number (defaults to 1).Nointeger
limitqueryNumber of users per page (defaults to 100, maximum is 100).Nointeger
Responses
CodeDescriptionSchema
200Returns array of restrictions as a paginated collectionAPI_V2_Entities_Restriction
401Invalid bearer token

POST

Description

Create whitelink

Parameters
NameLocated inDescriptionRequiredSchema
expire_timeformDatalink will be active for (Time.now + expire_time in following range)Nointeger
rangeformDataIn combination with expire_time gives full controll over token expirationNostring
Responses
CodeDescription
200Created whitelink
401Invalid bearer token

/api/v2/barong/admin/profiles

POST

Description

Create a profile for user

Parameters
NameLocated inDescriptionRequiredSchema
uidformDataYesstring
first_nameformDataNostring
last_nameformDataNostring
dobformDataNodate
addressformDataNostring
postcodeformDataNostring
cityformDataNostring
countryformDataNostring
metadataformDataAny additional key: value pairs in json string formatNostring
Responses
CodeDescriptionSchema
201Create a profile for userAPI_V2_Admin_Entities_Profile
400Required params are empty
401Invalid bearer token
422Validation errors

PUT

Description

Verify user's profile

Parameters
NameLocated inDescriptionRequiredSchema
uidformDataYesstring
stateformDataYesstring
Responses
CodeDescriptionSchema
200Verify user's profileAPI_V2_Admin_Entities_Profile
400Required params are empty
401Invalid bearer token
422Validation errors

GET

Description

Return all profiles

Parameters
NameLocated inDescriptionRequiredSchema
pagequeryPage number (defaults to 1).Nointeger
limitqueryNumber of users per page (defaults to 100, maximum is 100).Nointeger
Responses
CodeDescriptionSchema
200Return all profilesAPI_V2_Admin_Entities_Profile
401Invalid bearer token

/api/v2/barong/admin/levels

GET

Description

Returns array of permissions as paginated collection

Responses
CodeDescriptionSchema
200Returns array of permissions as paginated collectionAPI_V2_Entities_Level
401Invalid bearer token

/api/v2/barong/admin/abilities

GET

Description

Get all roles and admin_permissions of barong cancan.

Responses
CodeDescription
200Get all roles and admin_permissions of barong cancan.

Models

API_V2_Admin_Entities_UserWithKYC

Adds new user's comment

NameTypeDescriptionRequired
emailstringUser EmailNo
uidstringUser UIDNo
rolestringUser roleNo
levelintegerUser levelNo
otpbooleanis 2FA enabled for accountNo
statestringUser state: active, pending, inactiveNo
referral_uidstringUID of referrerNo
datastringAdditional phone and profile infoNo
usernamestringUser usernameNo
profilesAPI_V2_Admin_Entities_ProfileNo
labelsAPI_V2_Entities_AdminLabelViewNo
phonesAPI_V2_Admin_Entities_PhoneNo
documentsAPI_V2_Admin_Entities_DocumentNo
data_storagesAPI_V2_Entities_DataStorageNo
commentsAPI_V2_Entities_CommentNo
created_atstringNo
updated_atstringNo

API_V2_Admin_Entities_Profile

Return all profiles

NameTypeDescriptionRequired
first_namestringFirst NameNo
last_namestringLast nameNo
dobdateBirth dateNo
addressstringAddressNo
postcodestringAddress PostcodeNo
citystringCity nameNo
countrystringCountry nameNo
statestringProfile state: drafted, submitted, verified, rejectedNo
metadataobjectProfile additional fieldsNo
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_Admin_Entities_Phone

NameTypeDescriptionRequired
countrystringPhone countryNo
numberstringPhone numberNo
validated_ats (g)Phone validation dateNo

API_V2_Admin_Entities_Document

NameTypeDescriptionRequired
uploadstringFile urlNo
doc_typestringDocument type: passport, driver license, utility bill, identity card, institutional, address, residentalNo
doc_numberstringdocument 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 author UIDNo
titlestringComment titleNo
datastringComment plain textNo
created_atstringNo
updated_atstringNo

API_V2_Entities_User

Returns array of users as paginated collection

NameTypeDescriptionRequired
emailstringUser EmailNo
uidstringUser UIDNo
rolestringUser roleNo
levelintegerUser levelNo
otpbooleanis 2FA enabled for accountNo
statestringUser state: active, pending, inactiveNo
referral_uidstringUID of referrerNo
datastringAdditional phone and profile infoNo
usernamestringUser usernameNo

API_V2_Entities_APIKey

List all api keys for selected account.

NameTypeDescriptionRequired
kidstringJWT public keyNo
algorithmstringCryptographic hash function typeNo
scopestringSerialized array of scopesNo
statestringactive/non-active state of keyNo
secretstringApi key secretNo
created_atstringNo
updated_atstringNo

API_V2_Entities_Permission

Returns array of permissions as paginated collection

NameTypeDescriptionRequired
idintegerPermission idNo
actionstringPermission action: accept (allow access (drop access), audit (record activity)No
rolestringPermission user roleNo
verbstringPermission verb: put, post, delete, getNo
pathstringAPI pathNo
topicstringPermission topic: general, session etcNo
created_atstringNo
updated_atstringNo

API_V2_Admin_Entities_AdminActivity

Returns array of activities as paginated collection

NameTypeDescriptionRequired
user_ipstringUser IPNo
user_ip_countrystringUser IP countryNo
user_agentstringUser Browser AgentNo
topicstringDefined topic (session, adjustments) or general by defaultNo
actionstringAPI action: POST => 'create', PUT => 'update', GET => 'read', DELETE => 'delete', PATCH => 'update' or system if there is no match of HTTP methodNo
resultstringStatus of API response: succeed, failed, deniedNo
datastringParameters which was sent to specific API endpointNo
adminAPI_V2_Entities_UserNo
targetAPI_V2_Entities_UserNo
created_atstringNo

API_V2_Admin_Entities_ActivityWithUser

Returns array of activities as paginated collection

NameTypeDescriptionRequired
user_ipstringUser IPNo
user_ip_countrystringUser IP countryNo
user_agentstringUser Browser AgentNo
topicstringDefined topic (session, adjustments) or general by defaultNo
actionstringAPI action: POST => 'create', PUT => 'update', GET => 'read', DELETE => 'delete', PATCH => 'update' or system if there is no match of HTTP methodNo
resultstringStatus of API response: succeed, failed, deniedNo
datastringParameters which was sent to specific API endpointNo
userAPI_V2_Entities_UserNo
created_atstringNo

API_V2_Entities_Restriction

Returns array of restrictions as a paginated collection

NameTypeDescriptionRequired
idintegerRestriction idNo
categorystringRestriction categories: blacklist, maintenance, whitelist, blockloginNo
scopestringRestriction scopes: continent, country, ip, ip_subnet, allNo
valuestringRestriction value: IP address, country abbreviation, allNo
codeintegerRestriction codes: {"continent"=>423, "country"=>423, "ip_subnet"=>403, "ip"=>401, "all"=>401}No
statestringRestriction states: disabled, enabledNo
created_atstringNo
updated_atstringNo

API_V2_Entities_Level

Returns array of permissions as paginated collection

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_Admin_Entities_UserWithProfile

NameTypeDescriptionRequired
emailstringUser EmailNo
uidstringUser UIDNo
rolestringUser roleNo
levelintegerUser levelNo
otpbooleanis 2FA enabled for accountNo
statestringUser state: active, pending, inactiveNo
referral_uidstringUID of referrerNo
datastringAdditional phone and profile infoNo
usernamestringUser usernameNo
profilesAPI_V2_Admin_Entities_ProfileNo
created_atstringNo
updated_atstringNo