GXS Internal
Identity serverAPI reference

Admin

Set User Role

POST
/admin/set-role

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
userId*string

The user id

role*|array<>

The role to set, this can be a string or an array of strings. Eg: admin or [admin, user]

Response Body

User role updated

application/json
  1. response
user?
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/admin/set-role' \  -H 'Content-Type: application/json' \  -d '{  "userId": "string",  "role": "string"}'
{  "user": {    "id": "string",    "name": "string",    "email": "string",    "emailVerified": false,    "image": "string",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "username": "string",    "displayUsername": "string",    "twoFactorEnabled": false,    "role": "string",    "banned": false,    "banReason": "string",    "banExpires": "2019-08-24T14:15:22Z",    "lastLoginMethod": "string",    "phoneNumber": "string",    "metadata": null,    "emailOtpEnabled": false  }}

Get User

GET
/admin/get-user

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Query Parameters

id?string

The id of the User

Response Body

User

application/json
  1. response
user?
curl -X GET 'https://dev.auth.graphxserver.io/api/auth/admin/get-user'
{  "user": {    "id": "string",    "name": "string",    "email": "string",    "emailVerified": false,    "image": "string",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "username": "string",    "displayUsername": "string",    "twoFactorEnabled": false,    "role": "string",    "banned": false,    "banReason": "string",    "banExpires": "2019-08-24T14:15:22Z",    "lastLoginMethod": "string",    "phoneNumber": "string",    "metadata": null,    "emailOtpEnabled": false  }}

Create User

POST
/admin/create-user

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
email*string

The email of the user

password?string
name*string

The name of the user

role?|array<>
data?

Response Body

User created

application/json
  1. response
user?
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/admin/create-user' \  -H 'Content-Type: application/json' \  -d '{  "email": "string",  "name": "string"}'
{  "user": {    "id": "string",    "name": "string",    "email": "string",    "emailVerified": false,    "image": "string",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "username": "string",    "displayUsername": "string",    "twoFactorEnabled": false,    "role": "string",    "banned": false,    "banReason": "string",    "banExpires": "2019-08-24T14:15:22Z",    "lastLoginMethod": "string",    "phoneNumber": "string",    "metadata": null,    "emailOtpEnabled": false  }}

Admin Update User

POST
/admin/update-user

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
userId*string

The user id

data*

The user data to update

Response Body

User updated

application/json
  1. response
user?
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/admin/update-user' \  -H 'Content-Type: application/json' \  -d '{  "userId": "string",  "data": {    "property1": null,    "property2": null  }}'
{  "user": {    "id": "string",    "name": "string",    "email": "string",    "emailVerified": false,    "image": "string",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "username": "string",    "displayUsername": "string",    "twoFactorEnabled": false,    "role": "string",    "banned": false,    "banReason": "string",    "banExpires": "2019-08-24T14:15:22Z",    "lastLoginMethod": "string",    "phoneNumber": "string",    "metadata": null,    "emailOtpEnabled": false  }}

List Users

GET
/admin/list-users

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Query Parameters

searchValue?string
searchField?string

The field to search in, defaults to email. Can be email or name. Eg: "name"

Value in"email""name"
searchOperator?string

The operator to use for the search. Can be contains, starts_with or ends_with. Eg: "contains"

Value in"contains""starts_with""ends_with"
limit?|number
offset?|number
sortBy?string

The field to sort by

sortDirection?string

The direction to sort by

Value in"asc""desc"
filterField?string

The field to filter by

filterValue?|number|boolean|array<string>|array<number>
filterOperator?string

The operator to use for the filter

Value in"eq""ne""lt""lte""gt""gte""in""not_in""contains""starts_with""ends_with"

Response Body

List of users

application/json
  1. response
users*array<>
total*number
limit?number
offset?number
curl -X GET 'https://dev.auth.graphxserver.io/api/auth/admin/list-users'
{  "users": [    {      "id": "string",      "name": "string",      "email": "string",      "emailVerified": false,      "image": "string",      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z",      "username": "string",      "displayUsername": "string",      "twoFactorEnabled": false,      "role": "string",      "banned": false,      "banReason": "string",      "banExpires": "2019-08-24T14:15:22Z",      "lastLoginMethod": "string",      "phoneNumber": "string",      "metadata": null,      "emailOtpEnabled": false    }  ],  "total": 0,  "limit": 0,  "offset": 0}

Admin List User Sessions

POST
/admin/list-user-sessions

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
userId*string

The user id

Response Body

List of user sessions

application/json
  1. response
sessions?array<>
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/admin/list-user-sessions' \  -H 'Content-Type: application/json' \  -d '{  "userId": "string"}'
{  "sessions": [    {      "id": "string",      "expiresAt": "2019-08-24T14:15:22Z",      "token": "string",      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z",      "ipAddress": "string",      "userAgent": "string",      "userId": "string",      "impersonatedBy": "string",      "activeOrganizationId": "string",      "activeTeamId": "string"    }  ]}

Unban User

POST
/admin/unban-user

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
userId*string

The user id

Response Body

User unbanned

application/json
  1. response
user?
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/admin/unban-user' \  -H 'Content-Type: application/json' \  -d '{  "userId": "string"}'
{  "user": {    "id": "string",    "name": "string",    "email": "string",    "emailVerified": false,    "image": "string",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "username": "string",    "displayUsername": "string",    "twoFactorEnabled": false,    "role": "string",    "banned": false,    "banReason": "string",    "banExpires": "2019-08-24T14:15:22Z",    "lastLoginMethod": "string",    "phoneNumber": "string",    "metadata": null,    "emailOtpEnabled": false  }}

Ban User

POST
/admin/ban-user

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
userId*string

The user id

banReason?string

The reason for the ban

banExpiresIn?number

The number of seconds until the ban expires

Response Body

User banned

application/json
  1. response
user?
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/admin/ban-user' \  -H 'Content-Type: application/json' \  -d '{  "userId": "string"}'
{  "user": {    "id": "string",    "name": "string",    "email": "string",    "emailVerified": false,    "image": "string",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "username": "string",    "displayUsername": "string",    "twoFactorEnabled": false,    "role": "string",    "banned": false,    "banReason": "string",    "banExpires": "2019-08-24T14:15:22Z",    "lastLoginMethod": "string",    "phoneNumber": "string",    "metadata": null,    "emailOtpEnabled": false  }}

Impersonate User

POST
/admin/impersonate-user

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
userId*string

The user id

Response Body

Impersonation session created

application/json
  1. response
session?
user?
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/admin/impersonate-user' \  -H 'Content-Type: application/json' \  -d '{  "userId": "string"}'
{  "session": {    "id": "string",    "expiresAt": "2019-08-24T14:15:22Z",    "token": "string",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "ipAddress": "string",    "userAgent": "string",    "userId": "string",    "impersonatedBy": "string",    "activeOrganizationId": "string",    "activeTeamId": "string"  },  "user": {    "id": "string",    "name": "string",    "email": "string",    "emailVerified": false,    "image": "string",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "username": "string",    "displayUsername": "string",    "twoFactorEnabled": false,    "role": "string",    "banned": false,    "banReason": "string",    "banExpires": "2019-08-24T14:15:22Z",    "lastLoginMethod": "string",    "phoneNumber": "string",    "metadata": null,    "emailOtpEnabled": false  }}
POST
/admin/stop-impersonating

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Response Body

Bad Request. Usually due to missing parameters, or invalid parameters.

application/json
  1. response
message*string
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/admin/stop-impersonating'
{  "message": "string"}

Revoke User Session

POST
/admin/revoke-user-session

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
sessionToken*string

The session token

Response Body

Session revoked

application/json
  1. response
success?boolean
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/admin/revoke-user-session' \  -H 'Content-Type: application/json' \  -d '{  "sessionToken": "string"}'
{  "success": true}

Revoke User Sessions

POST
/admin/revoke-user-sessions

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
userId*string

The user id

Response Body

Sessions revoked

application/json
  1. response
success?boolean
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/admin/revoke-user-sessions' \  -H 'Content-Type: application/json' \  -d '{  "userId": "string"}'
{  "success": true}

Remove User

POST
/admin/remove-user

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
userId*string

The user id

Response Body

User removed

application/json
  1. response
success?boolean
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/admin/remove-user' \  -H 'Content-Type: application/json' \  -d '{  "userId": "string"}'
{  "success": true}

Set User Password

POST
/admin/set-user-password

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
newPassword*string

The new password

Length1 <= length
userId*string

The user id

Length1 <= length

Response Body

Password set

application/json
  1. response
status?boolean
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/admin/set-user-password' \  -H 'Content-Type: application/json' \  -d '{  "newPassword": "string",  "userId": "string"}'
{  "status": true}

/admin/has-permission

POST
/admin/has-permission

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
permissions*

The permission to check

Response Body

Success

application/json
  1. response
error?string
success*boolean
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/admin/has-permission' \  -H 'Content-Type: application/json' \  -d '{  "permissions": {}}'
{  "error": "string",  "success": true}