Organization Management Service API (1.0.0)

Perform CRUD actions for organizations.

Organization

Create an organization

  • Only Versafleet's SysAdmin is authorized.

  • Business name must be unique

  • Do not use root, sysadmin, admin, sys, system, FreelanceDriver, and their uppercase and lowercase variations as the business name.

  • Do not include versafleet and gotsurge and their uppercase and lowercase variations in the business name.

  • Business name cannot contains special characters, allowed characters are alphanumeric, space, dash, and underscore.

Authorizations:
bearerAuth
Request Body schema: application/json
business_name
required
string
fleet_types
Array of strings (fleet-types)
platform_id
string

Responses

Request samples

Content type
application/json
{
  • "business_name": "string",
  • "fleet_types": "motorcycle",
  • "platform_id": "string"
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "business_name": "string",
  • "squad_price": 0,
  • "min_price": 0,
  • "max_price": 0,
  • "price_table": [
    ],
  • "squad_code": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "version_seq": 0,
  • "version_rev": "0-xxxxxxxx",
  • "is_qa": true,
  • "fleet_types": "motorcycle"
}

List existing organizations

Only Versafleet's SysAdmin is authorized.

Authorizations:
bearerAuth
query Parameters
page
integer <int64> >= 1
Default: 1
per_page
integer <int64> >= 1
Default: 200
org_id
Array of strings

Organization IDs

org_name
string
is_show_role
boolean
Default: false

Responses

Response samples

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

Read an organization using its ID

The ID will be used as case sensitive and exact match filter of organization ID e.g. If the organization ID is VersaFleet, use VersaFleet as parameter and nothing else

Authorizations:
bearerAuth
path Parameters
org_id
required
string

ID of the organization to be read

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "business_name": "string",
  • "squad_price": 0,
  • "min_price": 0,
  • "max_price": 0,
  • "price_table": [
    ],
  • "squad_code": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "version_seq": 0,
  • "version_rev": "0-xxxxxxxx",
  • "is_qa": true,
  • "fleet_types": "motorcycle"
}

Update details of an organization

  • Only SysAdmin is authorized

  • Business name must be unique

  • Business name Cannot be root, sysadmin, admin, sys, system, FreelanceDriver, and their uppercase/lowercase variations.

  • Business name cannot contains versafleet, gotsurge and their uppercase/lowercase variations.

  • Business name cannot contains special characters, allowed characters are alphanumeric, space, dash, and underscore.

Authorizations:
bearerAuth
path Parameters
org_id
required
string

ID of the organization to be updated

Request Body schema: application/json
business_name
required
string
version_rev
required
string
fleet_types
Array of strings (fleet-types) [ items ]

Responses

Request samples

Content type
application/json
{
  • "business_name": "string",
  • "version_rev": "string",
  • "fleet_types": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "Successfully updated organization"
}

Update default price of any organization

Only SysAdmin is authorized

Authorizations:
bearerAuth
path Parameters
org_id
required
string

ID of the organization to be updated

Request Body schema: application/json
squad_price
number
min_price
number
max_price
number
increment
number
version_rev
required
string

Responses

Request samples

Content type
application/json
{
  • "squad_price": 0,
  • "min_price": 0,
  • "max_price": 0,
  • "increment": 0,
  • "version_rev": "string"
}

Response samples

Content type
application/json
{
  • "message": "Successfully updated organization's default price"
}

Read an organization using its exact name

The name will be used as case insensitive and exact match filter of business name e.g. using Versa in the parameter will not return VersaFleet, but versafleet and VersaFleet will

Authorizations:
bearerAuth
path Parameters
name
required
string

Business name of organization to be searched

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "business_name": "string",
  • "squad_price": 0,
  • "min_price": 0,
  • "max_price": 0,
  • "price_table": [
    ],
  • "squad_code": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "version_seq": 0,
  • "version_rev": "0-xxxxxxxx",
  • "is_qa": true,
  • "fleet_types": "motorcycle"
}

Read own's organization

Only OrgAdmin & OrgTansporter is authorized

Return an owned organization by claims

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "message": "Successfully returned organization"
}

Update details of own's organization

  • OrgAdmin and OrgTransporter is authorized

  • Business name must be unique

  • Business name Cannot be root, sysadmin, admin, sys, system, FreelanceDriver, and their uppercase/lowercase variations.

  • Business name cannot contains versafleet, gotsurge and their uppercase/lowercase variations.

  • Business name cannot contains special characters, allowed characters are alphanumeric, space, dash, and underscore.

Authorizations:
bearerAuth
Request Body schema: application/json
business_name
required
string
version_rev
required
string
fleet_types
Array of strings (fleet-types) [ items ]

Responses

Request samples

Content type
application/json
{
  • "business_name": "string",
  • "version_rev": "string",
  • "fleet_types": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "Successfully updated organization"
}

Update default price of own's organization

Only OrgAdmin is authorized

Authorizations:
bearerAuth
Request Body schema: application/json
squad_price
number
min_price
number
max_price
number
increment
number
version_rev
required
string

Responses

Request samples

Content type
application/json
{
  • "squad_price": 0,
  • "min_price": 0,
  • "max_price": 0,
  • "increment": 0,
  • "version_rev": "string"
}

Response samples

Content type
application/json
{
  • "message": "Successfully updated organization's default price"
}

Read an organization of a user

Authorizations:
bearerAuth
path Parameters
user_id
required
string <uuid>

ID of user whose organization needs to be searched

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "business_name": "string",
  • "squad_price": 0,
  • "min_price": 0,
  • "max_price": 0,
  • "price_table": [
    ],
  • "squad_code": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "version_seq": 0,
  • "version_rev": "0-xxxxxxxx",
  • "is_qa": true,
  • "fleet_types": "motorcycle"
}

Add a specific user to an existing organization by SysAdmin or Platform Partners

Versafleet's SysAdmin and Platform Partners can add anyone to any organization.

Authorizations:
bearerAuth
path Parameters
org_id
required
string

ID of the organization to be modified

Request Body schema: application/json
user_id
required
string <uuid>

Responses

Request samples

Content type
application/json
{
  • "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5"
}

Response samples

Content type
application/json
{
  • "message": "Successfully added user to the organization."
}

Removing a specific user from the organization by SysAdmin

Versafleet's SysAdmin can remove anyone from any organization.

Authorizations:
bearerAuth
path Parameters
org_id
required
string

ID of the organization

Request Body schema: application/json
user_id
required
string <uuid>

ID of the user

Responses

Request samples

Content type
application/json
{
  • "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5"
}

Response samples

Content type
application/json
{
  • "message": "Successfully removed user from the organization"
}

Add a specific user to an existing organization by OrgAdmin

OrgAdmin and OrgTransporter can add a user to its own organization only.

Authorizations:
bearerAuth
Request Body schema: application/json
user_id
required
string <uuid>

Responses

Request samples

Content type
application/json
{
  • "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5"
}

Response samples

Content type
application/json
{
  • "message": "Successfully added user to the organization."
}

Add a specific user as a freelance driver.

For users without an organization, they are added as freelance drivers.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "message": "Successfully added the user as a freelance driver."
}

Get transporters with fleet types

Get transporters with based on fleet types

Authorizations:
bearerAuth
query Parameters
fleet_types
required
Array of strings
Items Enum: "motorcycle" "car" "mpv" "van_1.7m" "van_2.4m" "lorry_10ft" "lorry_14ft" "lorry_24ft" "lorry_40ft" "boat"
Example: fleet_types=motorcycle,car

Comma-separated list of fleet types to filter transporters. Each value must be one of the predefined fleet types.

is_qa
boolean
Example: is_qa=true

Filter transporters by QA status. If not provided, returns non-QA transporters.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List partners organizations created by platform partners

Only Platform Partners Merchant is authorized.

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

Responses

Response samples

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

Get detail of organization managed by platform

The ID will be used as case sensitive and exact match filter of organization ID Platform Partners can't get organization detail outside their managed organization

Authorizations:
bearerAuth
path Parameters
org_id
required
string

ID of the organization to be read

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "business_name": "string",
  • "squad_price": 0,
  • "min_price": 0,
  • "max_price": 0,
  • "price_table": [
    ],
  • "squad_code": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "version_seq": 0,
  • "version_rev": "0-xxxxxxxx",
  • "is_qa": true,
  • "fleet_types": "motorcycle"
}

Get detail of an organization managed by the platform partner user

  • Only Platform Partners User is authorized.
  • Retrieves the details of a specific organization identified by its platform-specific ID (platformOrgID), ensuring the organization is managed by the requesting platform partner (identified via JWT claims).
Authorizations:
bearerAuth
path Parameters
platformOrgID
required
string

Platform-specific ID of the organization to retrieve.

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "business_name": "string",
  • "squad_price": 0,
  • "min_price": 0,
  • "max_price": 0,
  • "price_table": [
    ],
  • "squad_code": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "version_seq": 0,
  • "version_rev": "0-xxxxxxxx",
  • "is_qa": true,
  • "fleet_types": "motorcycle"
}

Create a partner organization from a platform partner user

  • Only Platform Partners User is authorized.
  • Creates a new organization associated with the platform partner identified by the JWT claims.
  • Business name validation rules:
    • Must be alphanumeric.
    • Cannot contain: versafleet, gotsurge, marinedigitalplatform (case-insensitive).
    • Cannot be: root, sysadmin, admin, sys, system, freelancedriver (case-insensitive).
Authorizations:
bearerAuth
Request Body schema: application/json
business_name
required
string

The desired business name for the new organization. Must adhere to validation rules.

platform_org_id
required
string

The organization's unique identifier within the partner's platform.

Responses

Request samples

Content type
application/json
{
  • "business_name": "Partner Transport Inc.",
  • "platform_org_id": "partner-org-12345"
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "business_name": "string",
  • "squad_price": 0,
  • "min_price": 0,
  • "max_price": 0,
  • "price_table": [
    ],
  • "squad_code": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "version_seq": 0,
  • "version_rev": "0-xxxxxxxx",
  • "is_qa": true,
  • "fleet_types": "motorcycle"
}

List existing organizations

Only Platform Partners Admin is authorized.

Authorizations:
bearerAuth
query Parameters
page
integer <int64> >= 1
Default: 1
per_page
integer <int64> >= 1
Default: 200
org_id
Array of strings

Organization IDs

org_name
string
is_show_role
boolean
Default: false

Responses

Response samples

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

Squad

Add squad record between driver and organization

Only Versafleet's SysAdmin is authorized.

Authorizations:
bearerAuth
Request Body schema: application/json
driver_id
required
string
org_id
required
string

Responses

Request samples

Content type
application/json
{
  • "driver_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  • "org_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Response samples

Content type
application/json
{
  • "code": "success",
  • "message": "Successfully created squad record",
  • "server_time": "2021-09-23T15:47:26.699327+08:00"
}

Remove squad record between driver and organization

Only Versafleet's SysAdmin is authorized.

Authorizations:
bearerAuth
path Parameters
squad_id
required
string

ID of the squad to be removed

Responses

Response samples

Content type
application/json
{
  • "code": "success",
  • "message": "Successfully remove squad driver",
  • "server_time": "2021-09-23T15:47:26.699327+08:00"
}

Add squad record between driver and organization with organization's squad code

Only driver is allowed to call this API

Authorizations:
bearerAuth
Request Body schema: application/json
squad_code
required
string
driver_name
required
string

Responses

Request samples

Content type
application/json
{
  • "squad_code": "p2to1q",
  • "driver_name": "John Doe"
}

Response samples

Content type
application/json
{
  • "code": "success",
  • "message": "Successfully created squad record",
  • "server_time": "2021-09-23T15:47:26.699327+08:00"
}

Get all squad drivers belong to the organization

Only OrgAdmin is allowed to call this API

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
Example
{
  • "code": "success",
  • "squads": [ ],
  • "server_time": "2021-09-23T15:47:26.699327+08:00"
}

Remove squads that driver joined with (delete account)

Only Driver is allowed to call this API

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "code": "success",
  • "message": "Successfully remove all squads for the driver",
  • "server_time": "2021-09-23T15:47:26.699327+08:00"
}

Remove unwanted squad driver

Only OrgAdmin is allowed to call this API

Authorizations:
bearerAuth
path Parameters
squad_id
required
string

ID of the squad to be removed

Responses

Response samples

Content type
application/json
{
  • "code": "success",
  • "message": "Successfully remove squad driver",
  • "server_time": "2021-09-23T15:47:26.699327+08:00"
}

Get all organizations which the driver joined with squad

Only Driver is allowed to call this API

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
Example
{
  • "code": "success",
  • "organizations": [ ],
  • "server_time": "2021-09-23T15:47:26.699327+08:00"
}

Get all organizations which the driver joined with squad

Only SysAdmin is allowed to call this API

Authorizations:
bearerAuth
path Parameters
driver_id
required
string

ID of the driver

Responses

Response samples

Content type
application/json
Example
{
  • "code": "success",
  • "squads": [ ],
  • "server_time": "2021-09-23T15:47:26.699327+08:00"
}

Get specific organizations with the driver that joined with the squad

Only SysAdmin is allowed to call this API

Authorizations:
bearerAuth
path Parameters
org_id
required
string

ID of the organization

Responses

Response samples

Content type
application/json
Example
{
  • "code": "success",
  • "squads": [ ],
  • "server_time": "2021-09-23T15:47:26.699327+08:00"
}

Get drivers with the organizations details which the driver joined to their squad.

Only SysAdmin is allowed to call this API

Authorizations:
bearerAuth
Request Body schema: application/json
driver_ids
required
Array of strings <uuid>

Responses

Request samples

Content type
application/json
{
  • "driver_ids": [
    ]
}

Response samples

Content type
application/json
Example
{
  • "code": "success",
  • "drivers": [ ],
  • "server_time": "2021-09-23T15:47:26.699327+08:00"
}

Org Driver

Update organization driver

Only SysAdmin is authorized

Authorizations:
bearerAuth
path Parameters
driver_id
required
string

ID of the driver to be updated

Request Body schema: application/json
name
required
string
email
string
full_name
string
partial_id_chars
string
phone_number
string

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "email": "string",
  • "full_name": "string",
  • "partial_id_chars": "string",
  • "phone_number": "string"
}

Response samples

Content type
application/json
{
  • "message": "Successfully updated org driver"
}

Read an organization driver using driver ID

The ID will be used as case sensitive and exact match filter of organization ID e.g. If the organization ID is VersaFleet, use VersaFleet as parameter and nothing else

Authorizations:
bearerAuth
path Parameters
driver_id
required
string

ID of the driver to be read

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "name": "John",
  • "email": "john@doe.com",
  • "full_name": "John Doe",
  • "org_id": "GotSurge",
  • "partial_id_chars": "123C",
  • "phone_number": 2345678,
  • "driver_id": "789152d6-623a-4125-ba18-8585eee67329"
}

Create an organization driver

  • Only Versafleet's SysAdmin is authorized.

  • org driver name must be unique for each organization

  • Business name cannot contains special characters, allowed characters are alphanumeric, space, dash, and underscore.

Authorizations:
bearerAuth
Request Body schema: application/json
name
required
string

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "name": "John",
  • "email": "john@doe.com",
  • "full_name": "John Doe",
  • "org_id": "GotSurge",
  • "partial_id_chars": "123C",
  • "phone_number": 2345678,
  • "driver_id": "789152d6-623a-4125-ba18-8585eee67329"
}

List existing organization drivers

Only Versafleet's SysAdmin is authorized.

Authorizations:
bearerAuth
query Parameters
page
integer <int64> >= 1
Default: 1
per_page
integer <int64> >= 1
Default: 200
order
string
Default: "asc"
Example: order=desc
org_id
Array of strings

Organization IDs

Responses

Response samples

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

Read an organization driver using driver ID

  • Only Transporter is authorized.

The ID will be used as case sensitive and exact match filter of organization ID e.g. If the organization ID is VersaFleet, use VersaFleet as parameter and nothing else

Authorizations:
bearerAuth
path Parameters
driver_id
required
string

ID of the driver to be read

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "name": "John",
  • "email": "john@doe.com",
  • "full_name": "John Doe",
  • "org_id": "GotSurge",
  • "partial_id_chars": "123C",
  • "phone_number": 2345678,
  • "driver_id": "789152d6-623a-4125-ba18-8585eee67329"
}

Create an organization driver

  • Only Transporter is authorized.

  • org driver name must be unique for each organization

  • Business name cannot contains special characters, allowed characters are alphanumeric, space, dash, and underscore.

Authorizations:
bearerAuth
Request Body schema: application/json
name
required
string

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "name": "John",
  • "email": "john@doe.com",
  • "full_name": "John Doe",
  • "org_id": "GotSurge",
  • "partial_id_chars": "123C",
  • "phone_number": 2345678,
  • "driver_id": "789152d6-623a-4125-ba18-8585eee67329"
}

List existing organization drivers

Only Transporter is authorized.

Authorizations:
bearerAuth
query Parameters
page
integer <int64> >= 1
Default: 1
per_page
integer <int64> >= 1
Default: 200
order
string
Default: "asc"
Example: order=desc

Responses

Response samples

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

Platform Partners

Create a partner organization from a platform partners

  • Only Platform Partners Merchant is authorized.
Authorizations:
bearerAuth
Request Body schema: application/json
business_name
required
string
platform_org_id
required
string

Responses

Request samples

Content type
application/json
{
  • "business_name": "string",
  • "platform_org_id": "string"
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "business_name": "string",
  • "squad_price": 0,
  • "min_price": 0,
  • "max_price": 0,
  • "price_table": [
    ],
  • "squad_code": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "version_seq": 0,
  • "version_rev": "0-xxxxxxxx",
  • "is_qa": true,
  • "fleet_types": "motorcycle"
}

Sync Driver Profile

Sync driver profile with organization driver

Authorizations:
bearerAuth
path Parameters
driver_id
required
string

ID of the driver to be updated

Request Body schema: application/json
name
required
string
email
string
full_name
string
partial_id_chars
string
phone_number
string
vehicle_plate_number
string

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "email": "string",
  • "full_name": "string",
  • "partial_id_chars": "string",
  • "phone_number": "string",
  • "vehicle_plate_number": "string"
}

Response samples

Content type
application/json
{
  • "message": "Successfully updated org driver"
}