Authentication Service API (1)

Perform authentication

Sign In with Email and Password

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "user": {
    }
}

Response samples

Content type
application/json
{
  • "bearer_token": "string",
  • "refresh_token": "string",
  • "user": {
    }
}

Driver Sign Up

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "user": {
    }
}

Response samples

Content type
application/json
{
  • "message": "Successfully register freelance driver account"
}

Merchant signs up by requesting security code to the email provided

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "user": {
    }
}

Response samples

Content type
application/json
{
  • "message": "Successfully sent security code to the email"
}

Merchant verifies security code

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "user": {
    }
}

Response samples

Content type
application/json
{
  • "message": "Successfully verified security code"
}

Accept the invitation

Accept the invitation

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "user": {
    }
}

Response samples

Content type
application/json
{
  • "status": "Invitation Accepted!"
}

Invite user by OrgAdmin

The invited user will automatically been assigned to OrgAdmin's organisation

Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "user": {
    }
}

Response samples

Content type
application/json
{
  • "status": "Invitation sent!"
}

Invite user by OrgTransporter

The invited user will automatically been assigned to OrgTransporter's organisation

Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "user": {
    }
}

Response samples

Content type
application/json
{
  • "status": "Invitation sent!"
}

OrgAdmin Generate invitation URL with token

OrgAdmin Generate invitation URL with token

Authorizations:
bearerAuth
query Parameters
email
required
string <email>

Email of the user to be invited

Responses

Response samples

Content type
application/json

SysAdmin Generate invitation URL with token

SysAdmin Generate invitation URL with token

Authorizations:
bearerAuth
query Parameters
email
required
string <email>

Email of the user to be invited

Responses

Response samples

Content type
application/json

Invite user by SysAdmin

Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "user": {
    }
}

Response samples

Content type
application/json
{
  • "status": "Invitation sent!"
}

Request new password

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "user": {
    }
}

Response samples

Content type
application/json
{
  • "message": "You will receive an email with instructions on how to reset your password in a few minutes."
}

Reset Password

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "user": {
    }
}

Response samples

Content type
application/json
{
  • "message": "Your password has been changed successfully."
}

Update profile information.

Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "user": {
    }
}

Response samples

Content type
application/json
{
  • "message": "Your account has been updated successfully."
}

Update member profile information.

Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "user": {
    }
}

Response samples

Content type
application/json
{
  • "message": "Your account has been updated successfully."
}

List all of Users

Only SysAdmin can access it, Users can be filtered by org_id query string

Authorizations:
bearerAuth
query Parameters
org_id
string

Filter users by org id (Only available for SysAdmin)

search
string

Filter users by name or email (Only available for SysAdmin)

page
integer <int64> >= 1
Default: 1
per_page
integer <int64> >= 1
Default: 20

Responses

Response samples

Content type
application/json
Example
{
  • "users": [
    ],
  • "meta": {
    }
}

Get User Details by ID

Only SysAdmin can access it

Authorizations:
bearerAuth
path Parameters
userID
required
string

ID of the user to be read

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "email": "user@example.com",
  • "name": "John Doe",
  • "org_id": "VersaFleet",
  • "roles": [
    ],
  • "confirmed_at": "2019-08-24T14:15:22Z"
}

Delete User

Only SysAdmin can access it, update the user email, adding deleted prefix

Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "user": {
    }
}

Response samples

Content type
application/json
{
  • "code": "success",
  • "message": "Your user has been successfully deleted."
}

Get User Details by Email

Only SysAdmin can access it

Authorizations:
bearerAuth
query Parameters
email
string

user email

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "email": "user@example.com",
  • "name": "John Doe",
  • "org_id": "VersaFleet",
  • "roles": [
    ],
  • "confirmed_at": "2019-08-24T14:15:22Z"
}

List of Users

Only OrgAdmin can access it, Users are filtered by org id (same as user logged in)

Authorizations:
bearerAuth
query Parameters
page
integer <int64> >= 1
Default: 1
per_page
integer <int64> >= 1
Default: 20

Responses

Response samples

Content type
application/json
Example
{
  • "users": [
    ],
  • "meta": {
    }
}

Update User details

OrgAdmin and OrgTransporter can access it, update the currently logged in user

Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "user": {
    }
}

Response samples

Content type
application/json
{
  • "code": "success",
  • "message": "Your user has been successfully updated."
}

Delete User details

Only Driver can access it, update the currently logged in user's email

Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "user": {
    }
}

Response samples

Content type
application/json
{
  • "code": "success",
  • "message": "Your user has been successfully deleted."
}

Delete the Transporter user

Only Transporter can access it

Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "user": {
    }
}

Response samples

Content type
application/json
{
  • "code": "success",
  • "message": "Your user has been successfully deleted."
}

Get User Details by ID

OrgAdmin and OrgTransporter can access it

Authorizations:
bearerAuth
path Parameters
userID
required
string

ID of the user to be read

Responses

Response samples

Content type
application/json
{
  • "user": {
    }
}

Set name and password

Only users who registered through merchant self registration are allowed to use this API

Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "user": {
    }
}

Response samples

Content type
application/json
{
  • "code": "success",
  • "message": "Successfully set name and password"
}

Assign organization to user

Only SysAdmin is allowed and the user should not have an org_id before

Authorizations:
bearerAuth
Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "user": {
    }
}

Response samples

Content type
application/json
{
  • "code": "success",
  • "message": "Successfully assign org to user"
}

SysAdmin confirm user

Only SysAdmin is allowed and the user must not be confirmed before

Authorizations:
bearerAuth
path Parameters
userID
required
string

ID of the user to be confirmed

Responses

Response samples

Content type
application/json
{
  • "code": "success",
  • "message": "User successfully confirmed"
}

Endpoint to retrieve bearer_token by the refresh_token

For internal fill client_key with 'gotsurge'

Request Body schema: application/json
refresh_token
string
client_key
string

Responses

Request samples

Content type
application/json
{
  • "refresh_token": "string",
  • "client_key": "string"
}

Response samples

Content type
application/json
{
  • "bearer_token": "string"
}

Endpoint for Platform Partners to invite user to their partner organizations

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "user": {
    }
}

Response samples

Content type
application/json
{
  • "status": "Invitation sent!"
}

Exchange MDP Token for GotSurge Bearer Token

Receives an MDP Bearer token via the Authorization header and attempts to verify it with the MDP service. If successful, it generates and returns a GotSurge Bearer token for the corresponding user (or a default payload if the user doesn't exist in GotSurge yet).

header Parameters
Authorization
required
string
Example: Bearer mdp_token_value_here

The Bearer token provided by MDP.

Responses

Response samples

Content type
application/json
{
  • "message": "Token exchanged successfully",
  • "bearer_token": "eyJhbGciOiJIUzI1NiJ9...",
  • "bearer_token_expired_at": 1678886400
}