GXS Internal
Identity serverAPI reference

Invite

Create Invitation

POST
/invite/create

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
role*string

The role to give the invited user

email?string|array<string>
tokenType?string

Type of token tu use, 24 character token, 6 digit code or custom options.generateToken

Value in"token""code""custom"
redirectToSignUp?string

The URL to redirect the user to create their account. If the token isn't valid or expired, it'll be redirected with a query parameter ?error=INVALID_TOKEN. If the token is valid, it'll be redirected with a query parameter `?token=VALID_TOKEN

redirectToSignIn?string

The URL to redirect the user to upgrade their role.

maxUses?number

The number of times an invitation can be used

expiresIn?number

Number of seconds the invitation token is valid for.

redirectToAfterUpgrade?string

The URL to redirect the user to after upgrade their role (if the user is already logged in)

shareInviterName?boolean

Whether the inviter's name should be shared with the invitee

senderResponse?string

How should the sender receive the token (sender only receives a token if no email is provided)

Value in"token""url"
senderResponseRedirect?string

Where should we redirect the user? (only if no email is provided)

Value in"signUp""signIn"
customInviteUrl?string

The user will be redirected here to activate their invite

Response Body

Success

application/json
  1. response
status?boolean
message?string
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/invite/create' \  -H 'Content-Type: application/json' \  -d '{  "role": "string"}'
{  "status": true,  "message": "string"}

Activate Invite

POST
/invite/activate

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
callbackURL?string

Where to redirect the user after sing in/up

token*string

The invite token

Response Body

Invite activated successfully

application/json
  1. response
status*boolean
message*string
action?string
redirectTo?string
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/invite/activate' \  -H 'Content-Type: application/json' \  -d '{  "token": "string"}'
{  "status": true,  "message": "string",  "action": "string",  "redirectTo": "string"}

Activate Invite Callback

GET
/invite/{token}

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Path Parameters

token*string

The invitation token

Query Parameters

callbackURL*string

Where to redirect the user after sing in/up

Response Body

Redirects the user to the callback URL. On error, includes 'error' and 'message' query parameters.

curl -X GET 'https://dev.auth.graphxserver.io/api/auth/invite/string?callbackURL=string'
Empty

Cancel Invite

POST
/invite/cancel

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
token*string

The invite token to cancel.

Response Body

Invite cancelled successfully

application/json
  1. response
status*boolean
message*string
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/invite/cancel' \  -H 'Content-Type: application/json' \  -d '{  "token": "string"}'
{  "status": true,  "message": "string"}

Get Invite

GET
/invite/get

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Query Parameters

token?string

The invite token to look up.

Response Body

Invite found

application/json
  1. response
status*boolean
inviter*
invitation*
curl -X GET 'https://dev.auth.graphxserver.io/api/auth/invite/get'
{  "status": true,  "inviter": {    "email": "string",    "name": "string",    "image": "string"  },  "invitation": {    "email": "string",    "emails": null,    "createdAt": "2019-08-24T14:15:22Z",    "role": "string",    "newAccount": true  }}

Reject Invite

POST
/invite/reject

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
token*string

The invite token to reject.

Response Body

Invite rejected successfully

application/json
  1. response
status*boolean
message*string
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/invite/reject' \  -H 'Content-Type: application/json' \  -d '{  "token": "string"}'
{  "status": true,  "message": "string"}

List Invites

GET
/invite/list

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Query Parameters

searchValue?string

The value to search for.

searchField?string

The field to search in, defaults to email. Can be email, name or domainWhitelist.

Value in"name""email""domainWhitelist"
searchOperator?string

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

Value in"contains""starts_with""ends_with"
limit?number

The numbers of invitations to return.

offset?number

The offset to start from.

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?||

The value to filter by.

filterOperator?string

The operator to use for the filter.

Value in"eq""ne""lt""lte""gt""gte"

Response Body

List of all issued invitations

application/json
  1. response
invitations?array<>
total?number
limit?number|undefined
offset?number|undefined
curl -X GET 'https://dev.auth.graphxserver.io/api/auth/invite/list'
{  "invitations": [    {}  ],  "total": 0,  "limit": 0,  "offset": 0}