logo

Barong

RESTful AdminAPI for barong OAuth server

#Version: 2.7.0

/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
CodeDescription
204Deletes user's data storage record
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

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

GET

Description

Returns user info

Parameters
NameLocated inDescriptionRequiredSchema
uidpathuser uniq idYesstring
Responses
CodeDescription
200Returns user info
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

/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
CodeDescription
200Returns array of users with pending or replaced documents as paginated collection
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

/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
200Update user attributes
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

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
CodeDescription
200Returns array of users as paginated collection
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

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

POST

Description

Update user role

Parameters
NameLocated inDescriptionRequiredSchema
uidformDatauser uniq idYesstring
roleformDatauser roleYesstring
Responses
CodeDescription
201Update user role
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

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

POST

Description

Update user attributes

Parameters
NameLocated inDescriptionRequiredSchema
uidformDatauser uniq idYesstring
stateformDatauser stateNostring
otpformDatauser 2fa statusNoboolean
Responses
CodeDescription
201Update user attributes
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

/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
204Deletes label for user
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

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
200Update user label scope
400Required params are empty
401Invalid bearer token
404Record is not found
422Validation errors
Security
Security SchemaScopes
BearerToken

POST

Description

Adds 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
201Adds label for user
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

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
CodeDescription
200Returns array of users as paginated collection
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

/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
201Update user label value
400Required params are empty
401Invalid bearer token
404Record is not found
422Validation errors
Security
Security SchemaScopes
BearerToken

/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
Security
Security SchemaScopes
BearerToken

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

DELETE

Description

Delete user's comment

Parameters
NameLocated inDescriptionRequiredSchema
idquerycomment uniq idYesinteger
Responses
CodeDescription
204Delete user's comment
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

PUT

Description

Edit user's comment

Parameters
NameLocated inDescriptionRequiredSchema
idformDatacomment uniq idYesinteger
titleformDatacomment titleNostring
dataformDatacomment dataNostring
Responses
CodeDescription
200Edit user's comment
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

POST

Description

Adds new user's comment

Parameters
NameLocated inDescriptionRequiredSchema
uidformDatauser uniq idYesstring
titleformDatacomment uniq titleYesstring
dataformDatacomment dataYesstring
Responses
CodeDescription
201Adds new user's comment
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

/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
CodeDescription
200List all api keys for selected account.
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

/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
200Update Permission
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

DELETE

Description

Deletes permission

Parameters
NameLocated inDescriptionRequiredSchema
idquerypermission idYesinteger
Responses
CodeDescription
204Deletes permission
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

POST

Description

Create permission

Parameters
NameLocated inDescriptionRequiredSchema
roleformDataYesstring
verbformDataYesstring
pathformDataYesstring
actionformDataYesstring
topicformDataNostring
Responses
CodeDescription
201Create permission
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

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
CodeDescription
200Returns array of permissions as paginated collection
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

/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
CodeDescription
200Returns array of activities as paginated collection
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

/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
CodeDescription
200Returns array of activities as paginated collection
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

/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
Security
Security SchemaScopes
BearerToken

/api/v2/barong/admin/restrictions

DELETE

Description

Delete restriction

Parameters
NameLocated inDescriptionRequiredSchema
idqueryRestriction idYesinteger
Responses
CodeDescription
204Delete restriction
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

PUT

Description

Update restriction

Parameters
NameLocated inDescriptionRequiredSchema
idformDataRestriction idYesinteger
scopeformDataNostring
categoryformDataNostring
valueformDataNostring
stateformDataNostring
codeformDataNointeger
Responses
CodeDescription
200Update restriction
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

POST

Description

Create restriction

Parameters
NameLocated inDescriptionRequiredSchema
scopeformDataYesstring
valueformDataYesstring
categoryformDataYesstring
stateformDataNostring
codeformDataNointeger
Responses
CodeDescription
201Create restriction
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

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
CodeDescription
200Returns array of restrictions as a paginated collection
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

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
201Create whitelink
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

/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
CodeDescription
201Create a profile for user
400Required params are empty
401Invalid bearer token
422Validation errors
Security
Security SchemaScopes
BearerToken

PUT

Description

Verify user's profile

Parameters
NameLocated inDescriptionRequiredSchema
uidformDataYesstring
stateformDataYesstring
Responses
CodeDescription
200Verify user's profile
400Required params are empty
401Invalid bearer token
422Validation errors
Security
Security SchemaScopes
BearerToken

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
CodeDescription
200Return all profiles
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

/api/v2/barong/admin/levels

GET

Description

Returns array of permissions as paginated collection

Responses
CodeDescription
200Returns array of permissions as paginated collection
401Invalid bearer token
Security
Security SchemaScopes
BearerToken

/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_ActivityWithUser

NameTypeDescriptionRequired
user_ipstringNo
user_agentstringNo
topicstringNo
actionstringNo
resultstringNo
datastringNo
userAPI_V2_Entities_UserNo
created_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_Admin_Entities_AdminActivity

NameTypeDescriptionRequired
user_ipstringNo
user_agentstringNo
topicstringNo
actionstringNo
resultstringNo
datastringNo
adminAPI_V2_Entities_UserNo
targetAPI_V2_Entities_UserNo
created_atstringNo

API_V2_Admin_Entities_Document

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

API_V2_Admin_Entities_Phone

NameTypeDescriptionRequired
countrystringNo
numberstringNo
validated_ats (g)No

API_V2_Admin_Entities_Profile

NameTypeDescriptionRequired
first_namestringNo
last_namestringLast nameNo
dobdateBirthday dateNo
addressstringNo
postcodestringNo
citystringNo
countrystringNo
statestringNo
metadataobjectProfile additional fieldsNo
created_atstringNo
updated_atstringNo

API_V2_Admin_Entities_UserWithKYC

NameTypeDescriptionRequired
emailstringNo
usernamestringUser usernameNo
uidstringNo
rolestringNo
levelintegerNo
otpbooleanNo
statestringNo
datastringadditional phone and profile infoNo
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
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_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_Admin_Entities_UserWithProfile

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