GXS Internal
Identity serverAPI reference

Default

Social Sign In

POST
/sign-in/social

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
callbackURL?string

Callback URL to redirect to after the user has signed in

newUserCallbackURL?string
errorCallbackURL?string

Callback URL to redirect to if an error happens

provider*|string
disableRedirect?boolean

Disable automatic redirection to the provider. Useful for handling the redirection yourself

idToken?
scopes?array<string>

Array of scopes to request from the provider. This will override the default scopes passed.

requestSignUp?boolean

Explicitly request sign-up. Useful when disableImplicitSignUp is true for this provider

loginHint?string

The login hint to use for the authorization code request

additionalParams?

Extra query parameters to append to the provider authorization URL (e.g. Cognito identity_provider, Google hd).

additionalData?

Response Body

Success - Returns session details (idToken branch) or an authorize URL (redirect branch)

application/json
  1. response

Returns session details when idToken is provided, or an authorize URL otherwise

token?string
user?
url?string
redirect*boolean
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/sign-in/social' \  -H 'Content-Type: application/json' \  -d '{  "provider": "apple"}'
{  "token": "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  },  "url": "string",  "redirect": true}

/callback/{id}

GET
/callback/{id}

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Path Parameters

id*string

Response Body

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

application/json
  1. response
message*string
curl -X GET 'https://dev.auth.graphxserver.io/api/auth/callback/string'
{  "message": "string"}

/callback/{id}

POST
/callback/{id}

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Path Parameters

id*string

Request Body

application/json
  1. body
code?string
error?string
device_id?string
error_description?string
state?string
user?string
iss?string

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/callback/string' \  -H 'Content-Type: application/json' \  -d '{}'
{  "message": "string"}

Get Session

GET
/get-session

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Response Body

Success

application/json
  1. response
session*
user*
curl -X GET 'https://dev.auth.graphxserver.io/api/auth/get-session'
{  "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  }}

Get Session Post

POST
/get-session

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body

Response Body

Success

application/json
  1. response
session*
user*
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/get-session' \  -H 'Content-Type: application/json' \  -d '{}'
{  "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  }}

Sign Out

POST
/sign-out

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
callbackURL?string

The URL to redirect to after provider logout

disableRedirect?boolean

Return the provider logout URL without redirecting

state?string

State to pass to the provider logout endpoint

Response Body

Success

application/json
  1. response
success?boolean
url?string

Provider logout URL when RP-initiated logout is available

redirect?boolean

Whether the client should redirect to the provider logout URL

curl -X POST 'https://dev.auth.graphxserver.io/api/auth/sign-out' \  -H 'Content-Type: application/json' \  -d '{}'
{  "success": true,  "url": "string",  "redirect": true}
POST
/sign-up/email

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
name*string

The name of the user

email*string

The email of the user

password*string

The password of the user

image?string

The profile image URL of the user

callbackURL?string

The URL to use for email verification callback

rememberMe?boolean

If this is false, the session will not be remembered. Default is true.

phoneNumber?string
metadata?unknown
username?string
displayUsername?string

Response Body

Successfully created user

application/json
  1. response
token?string

Authentication token for the session

user*
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/sign-up/email' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "email": "string",  "password": "string"}'
{  "token": "string",  "user": {    "id": "string",    "email": "user@example.com",    "name": "string",    "image": "http://example.com",    "emailVerified": true,    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  }}

Sign In Email

POST
/sign-in/email

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
email*string

Email of the user

password*string

Password of the user

callbackURL?string

Callback URL to use as a redirect for email verification

rememberMe?boolean

If this is false, the session will not be remembered. Default is true.

Response Body

Success - Returns either session details or redirect URL

application/json
  1. response

Session response when idToken is provided

redirect*false
Value infalse
token*string

Session token

url?string
user*
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/sign-in/email' \  -H 'Content-Type: application/json' \  -d '{  "email": "string",  "password": "string"}'
{  "redirect": false,  "token": "string",  "url": "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  }}

Reset Password

POST
/reset-password

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
newPassword*string

The new password to set

token?string

The token to reset the password

Response Body

Success

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

Verify Password

POST
/verify-password

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
password*string

The password to verify

Response Body

Success

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

/verify-email

GET
/verify-email

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Query Parameters

token*string

The token to verify the email

callbackURL?string

The URL to redirect to after email verification

Response Body

Success

application/json
  1. response
user*
status*boolean

Indicates if the email was verified successfully

curl -X GET 'https://dev.auth.graphxserver.io/api/auth/verify-email?token=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  },  "status": true}

Send Verification Email

POST
/send-verification-email

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
email*string

The email to send the verification email to

callbackURL?string

The URL to use for email verification callback

Response Body

Success

application/json
  1. response
status?boolean

Indicates if the email was sent successfully

curl -X POST 'https://dev.auth.graphxserver.io/api/auth/send-verification-email' \  -H 'Content-Type: application/json' \  -d '{  "email": "string"}'
{  "status": true}

Change Email

POST
/change-email

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
newEmail*string

The new email address to set must be a valid email address

callbackURL?string

The URL to redirect to after email verification

Response Body

Email change request processed successfully

application/json
  1. response
user?
status*boolean

Indicates if the request was successful

message?string

Status message of the email change process

Value in"Email updated""Verification email sent"
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/change-email' \  -H 'Content-Type: application/json' \  -d '{  "newEmail": "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  },  "status": true,  "message": "Email updated"}

Change Password

POST
/change-password

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
newPassword*string

The new password to set

currentPassword*string

The current password is required

revokeOtherSessions?boolean

Must be a boolean value

Response Body

Password successfully changed

application/json
  1. response
token?string

New session token if other sessions were revoked

user*
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/change-password' \  -H 'Content-Type: application/json' \  -d '{  "newPassword": "string",  "currentPassword": "string"}'
{  "token": "string",  "user": {    "id": "string",    "email": "user@example.com",    "name": "string",    "image": "http://example.com",    "emailVerified": true,    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  }}

Update Session

POST
/update-session

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
[key: string]?unknown

Response Body

Success

application/json
  1. response
session?
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/update-session' \  -H 'Content-Type: application/json' \  -d '{  "property1": null,  "property2": null}'
{  "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"  }}

Update User

POST
/update-user

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
name?string

The name of the user

image?string

The image of the user

phoneNumber?string
metadata?unknown
username?string
displayUsername?string

Response Body

Success

application/json
  1. response
user?
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/update-user' \  -H 'Content-Type: application/json' \  -d '{}'
{  "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  }}

Delete User

POST
/delete-user

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
callbackURL?string

The callback URL to redirect to after the user is deleted

password?string

The user's password. Required if session is not fresh

token?string

The deletion verification token

Response Body

User deletion processed successfully

application/json
  1. response
success*boolean

Indicates if the operation was successful

message*string

Status message of the deletion process

Value in"User deleted""Verification email sent"
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/delete-user' \  -H 'Content-Type: application/json' \  -d '{}'
{  "success": true,  "message": "User deleted"}

Request Password Reset

POST
/request-password-reset

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
email*string

The email address of the user to send a password reset email to

redirectTo?string

The URL to redirect the user to reset their password. 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

Response Body

Success

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

Reset Password Callback

GET
/reset-password/{token}

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Path Parameters

token*string

The token to reset the password

Query Parameters

callbackURL*string

The URL to redirect the user to reset their password

Response Body

Success

application/json
  1. response
token?string
curl -X GET 'https://dev.auth.graphxserver.io/api/auth/reset-password/string?callbackURL=string'
{  "token": "string"}

List User Sessions

GET
/list-sessions

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Response Body

Success

application/json
  1. response
[index: integer]?
curl -X GET 'https://dev.auth.graphxserver.io/api/auth/list-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"  }]

/revoke-session

POST
/revoke-session

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
token*string

The token to revoke

Response Body

Success

application/json
  1. response
status*boolean

Indicates if the session was revoked successfully

curl -X POST 'https://dev.auth.graphxserver.io/api/auth/revoke-session' \  -H 'Content-Type: application/json' \  -d '{  "token": "string"}'
{  "status": true}

/revoke-sessions

POST
/revoke-sessions

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body

Response Body

Success

application/json
  1. response
status*boolean

Indicates if all sessions were revoked successfully

curl -X POST 'https://dev.auth.graphxserver.io/api/auth/revoke-sessions' \  -H 'Content-Type: application/json' \  -d '{}'
{  "status": true}

/revoke-other-sessions

POST
/revoke-other-sessions

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body

Response Body

Success

application/json
  1. response
status*boolean

Indicates if all other sessions were revoked successfully

curl -X POST 'https://dev.auth.graphxserver.io/api/auth/revoke-other-sessions' \  -H 'Content-Type: application/json' \  -d '{}'
{  "status": true}
POST
/link-social

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
callbackURL?string

The URL to redirect to after the user has signed in

provider*|string
idToken?
requestSignUp?boolean
scopes?array<string>

Additional scopes to request from the provider

errorCallbackURL?string

The URL to redirect to if there is an error during the link process

disableRedirect?boolean

Disable automatic redirection to the provider. Useful for handling the redirection yourself

loginHint?string

The login hint to use for the authorization code request

additionalParams?

Extra query parameters to append to the provider authorization URL (e.g. Cognito identity_provider, Google hd).

additionalData?

Response Body

Success

application/json
  1. response
url?string

The authorization URL to redirect the user to

redirect*boolean

Indicates if the user should be redirected to the authorization URL

status?boolean
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/link-social' \  -H 'Content-Type: application/json' \  -d '{  "provider": "apple"}'
{  "url": "string",  "redirect": true,  "status": true}

List User Accounts

GET
/list-accounts

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Response Body

Success

application/json
  1. response
[index: integer]?
curl -X GET 'https://dev.auth.graphxserver.io/api/auth/list-accounts'
[  {    "id": "string",    "providerId": "string",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "accountId": "string",    "userId": "string",    "scopes": [      "string"    ]  }]

/delete-user/callback

GET
/delete-user/callback

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Query Parameters

token?string

The token to verify the deletion request

callbackURL?string

The URL to redirect to after deletion

Response Body

User successfully deleted

application/json
  1. response
success*boolean

Indicates if the deletion was successful

message*"User deleted"

Confirmation message

Value in"User deleted"
curl -X GET 'https://dev.auth.graphxserver.io/api/auth/delete-user/callback'
{  "success": true,  "message": "User deleted"}
POST
/unlink-account

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
accountId*string

The Better Auth account ID to unlink

Response Body

Success

application/json
  1. response
status?boolean
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/unlink-account' \  -H 'Content-Type: application/json' \  -d '{  "accountId": "string"}'
{  "status": true}

/refresh-token

POST
/refresh-token

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
accountId*string

The Better Auth account ID

userId?string

The user ID associated with the account

Response Body

Access token refreshed successfully

application/json
  1. response
tokenType?string
idToken?string
accessToken?string
refreshToken?string
accessTokenExpiresAt?string
Formatdate-time
refreshTokenExpiresAt?string
Formatdate-time
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/refresh-token' \  -H 'Content-Type: application/json' \  -d '{  "accountId": "string"}'
{  "tokenType": "string",  "idToken": "string",  "accessToken": "string",  "refreshToken": "string",  "accessTokenExpiresAt": "2019-08-24T14:15:22Z",  "refreshTokenExpiresAt": "2019-08-24T14:15:22Z"}

/get-access-token

POST
/get-access-token

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Request Body

application/json
  1. body
accountId*string

The Better Auth account ID

userId?string

The user ID associated with the account

Response Body

A Valid access token

application/json
  1. response
tokenType?string
idToken?string
accessToken?string
accessTokenExpiresAt?string
Formatdate-time
curl -X POST 'https://dev.auth.graphxserver.io/api/auth/get-access-token' \  -H 'Content-Type: application/json' \  -d '{  "accountId": "string"}'
{  "tokenType": "string",  "idToken": "string",  "accessToken": "string",  "accessTokenExpiresAt": "2019-08-24T14:15:22Z"}

/account-info

GET
/account-info

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Response Body

Success

application/json
  1. response
user*
account*
data*
curl -X GET 'https://dev.auth.graphxserver.io/api/auth/account-info'
{  "user": {    "name": "string",    "email": "string",    "image": "string",    "emailVerified": true  },  "account": {    "id": "string",    "providerId": "string",    "accountId": "string"  },  "data": {}}

/ok

GET
/ok

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Response Body

API is working

application/json
  1. response
ok*boolean

Indicates if the API is working

curl -X GET 'https://dev.auth.graphxserver.io/api/auth/ok'
{  "ok": true}

/error

GET
/error

Authorization

bearerAuth
headerAuthorizationBearer <token>

Bearer token authentication

Response Body

Success

response?stringtext/html

The HTML content of the error page

curl -X GET 'https://dev.auth.graphxserver.io/api/auth/error'
"string"