Admin
Info about admin(s)
Get admin info
GET
https://switchapi3.azurewebsites.net/admin
This endpoint retrieves the details of the admin currently logged in.
Headers
Name | Type | Description |
---|---|---|
SWI-CID | string | Client ID |
Authorization | string | Format for Authorization is Bearer token_string |
Get admin by id
GET
https://switchapi3.azurewebsites.net/admin/:id
This endpoint retrieves the admin by searching with the id
Path Parameters
Name | Type | Description |
---|---|---|
id | integer | admin id |
Headers
Name | Type | Description |
---|---|---|
SWI-CID | string | Client ID |
Authorization | string | Format for the Authorization is Bearer token_string |
Create admin
POST
https://switchapi3.azurewebsites.net/admin/new
This endpoint creates a new admin and sends a randomly generated password to the admin's email if creation is successful.
Headers
Name | Type | Description |
---|---|---|
SWI-CS | string | Payload checksum |
SWI-CID | string | Client ID |
Authorization | string | Format for the Authorization is Bearer token_string |
Request Body
Name | Type | Description |
---|---|---|
string | admin email | |
role | string | Could be customer_success, banking_operations, admin or super_admin |
Get admin list
GET
https://switchapi3.azurewebsites.net/admin/list
This endpoint retrieves the list of admins.
Query Parameters
Name | Type | Description |
---|---|---|
search_query | string | Query used to search admin's emails |
page | string | Defaults to 1 |
per_page | string | Defaults to 20 |
Headers
Name | Type | Description |
---|---|---|
SWI-CID | string | Client ID |
Authorization | string | Format for the Authorization is Bearer token_string |
Disable admin
POST
https://switchapi3.azurewebsites.net/admin/disable/:id
This endpoint allows super-admins to disable admins.
Path Parameters
Name | Type | Description |
---|---|---|
id | string | id of the admin |
Headers
Name | Type | Description |
---|---|---|
SWI-CID | string | Client ID |
Authorization | string | Format for Authorization is Bearer token_string |
Enable a disabled admin
POST
https://switchapi3.azurewebsites.net/admin/enable/:id
This endpoint allows superadmins to enable disabled admins.
Path Parameters
Name | Type | Description |
---|---|---|
id | string | id of the admin |
Headers
Name | Type | Description |
---|---|---|
SWI-CID | string | Client ID |
Authorization | string | Format for Authorization is Bearer token_string |
Change Password
POST
https://switchapi3.azurewebsites.net/admin/update_password
Change admin password.
Headers
Name | Type | Description |
---|---|---|
SWI-CS | string | Payload checksum |
SWI-CID | string | Client ID |
Authorization | string | Format for Authorization is Bearer token_string |
Request Body
Name | Type | Description |
---|---|---|
current_password | string | The admin's current password |
password | string | The new password |
password_confirmation | string | password confirmation |
Reset Admin Password
POST
https://switchapi3.azurewebsites.net/admin/reset_password/:id
This endpoint allows a super admin to reset an admin's password. The new password (which is randomly generated) is then sent to the admin's email.
Path Parameters
Name | Type | Description |
---|---|---|
id | string | The id of the admin whose password is to be reset |
Headers
Name | Type | Description |
---|---|---|
SWI-CID | string | Client ID |
Authorization | string | Format for Authorization is Bearer token_string |
Unlock Account
POST
https://switchapi3.azurewebsites.net/admin/unlock/:id
This endpoint allows a super admin to send an unlock email to the locked admin's email address.
Path Parameters
Name | Type | Description |
---|---|---|
id | string | The id of the admin to be unlocked. |
Headers
Name | Type | Description |
---|---|---|
SWI-CID | string | Client ID |
Authorization | string | Format for Authorization is Bearer token_string |
Update Role
POST
https://switchapi3.azurewebsites.net/admin/role/:id
This endpoint allows a super admin to update the role of another admin.
Path Parameters
Name | Type | Description |
---|---|---|
id | string | The id of the admin |
Headers
Name | Type | Description |
---|---|---|
SWI-CS | string | Payload checksum |
SWI-CID | string | Client ID |
Authorization | string | Format for Authorization is Bearer token. |
Request Body
Name | Type | Description |
---|---|---|
role | string | Any of customer_success, banking_operations, admin or super_admin |
Last updated