Admin Management

Retrieve a List of Admins

get

Retrieve a List of Admins

This endpoint allows administrators to retrieve a list of all admins associated with their account. The response includes user details.

Usage Example: Send a GET request to admin-management/admins-list/.

Response Structure: Upon a successful request, the endpoint returns a JSON array, where each element is an admin object containing:

  • uid (string): Unique identifier of the admin.

  • email (string): Email address of the admin.

  • display_name (string): Display name of the admin.

  • status (string): Status of the admin account. Possible values: 'Active'.

Notes:

  • Proper authorization is required; only users with admin privileges can access this endpoint.

Authorizations
AuthorizationstringRequired

Enter your bearer token (Firebase auth) in the format: Bearer

Responses
chevron-right
200

Successfully retrieved the list of admins.

application/json
get
/admin-management/admins-list/

List User Invitations

get

List User Invitations

This endpoint allows a user to retrieve a list of their pending invitations to become a sub-admin. Each invitation includes details such as the inviter's information and the invitation status.

Usage Example: Send a GET request to admin-management/invitations/.

Response Structure: Upon a successful request, the endpoint returns a JSON object containing a list of invitations.

Notes:

  • Proper authentication is required; only authenticated users can access their invitations.

Authorizations
AuthorizationstringRequired

Enter your bearer token (Firebase auth) in the format: Bearer

Responses
chevron-right
200

Successfully retrieved a list of user invitations.

application/json
get
/admin-management/invitation/

Create a User Invitation

post

Create a User Invitation

This endpoint allows a super administrator to create an invitation for a user to become a sub-admin. Provide the user_email of the user you wish to invite. Optionally, you can include a platform_link to direct the user to your platform upon accepting the invitation.

Usage Example: Send a POST request to admin-management/invitation/ with a JSON body containing the user_email and optionally the platform_link.

Request Body:

  • user_email (string, required): The email address of the user to be invited as a sub-admin.

  • platform_link (string, optional): A URL to direct the invited user to your platform.

Response Structure: Upon a successful request, the endpoint returns a JSON object containing the invitation details.

Notes:

  • The user_email must correspond to an existing user or a new user to be invited.

  • Only users with super admin privileges can access this endpoint.

Authorizations
AuthorizationstringRequired

Enter your bearer token (Firebase auth) in the format: Bearer

Body
user_emailstring Β· emailRequired

Email address of the user to be invited as a sub-admin.

platform_linkstring Β· uriOptional

Optional URL to direct the invited user upon accepting the invitation.

Responses
post
/admin-management/invitation/

Remove a User Invitation

delete

Remove a User Invitation

This endpoint allows a super administrator to remove an existing invitation identified by the invite_token. Providing a valid invite_token will delete the corresponding invitation.

Usage Example: Send a DELETE request to admin-management/invitations/ with a JSON body containing the invite_token.

Request Body:

  • invite_token (string, required): The unique token of the invitation to be removed.

Response Structure: Upon a successful request, the endpoint returns a confirmation message.

Notes:

  • The invite_token must correspond to an existing invitation.

  • Only users with super admin privileges can access this endpoint.

Authorizations
AuthorizationstringRequired

Enter your bearer token (Firebase auth) in the format: Bearer

Body
invite_tokenstringRequired

Unique token identifying the invitation to be removed.

Responses
chevron-right
200

Invitation successfully removed.

application/json
delete
/admin-management/invitation/

Respond to an Invitation

post

Respond to an Invitation

This endpoint allows a user to respond to a specific invitation identified by the invite_token. Provide the user_response parameter with either 'accept' or 'decline' to respond to the invitation.

Usage Example: Send a POST request to admin-management/invitations/respond/ with a JSON body containing the invite_token and user_response.

Request Body:

  • invite_token (string, required): Unique token identifying the invitation to respond to.

  • user_response (string, required): The user's response to the invitation. Must be either 'accept' or 'decline'.

Response Structure: Upon a successful request, the endpoint returns a confirmation message.

Notes:

  • The invite_token must correspond to an existing invitation.

  • Only authenticated users can access this endpoint.

Authorizations
AuthorizationstringRequired

Enter your bearer token (Firebase auth) in the format: Bearer

Body
invite_tokenstringRequired

Unique token identifying the invitation to respond to.

user_responsestring Β· enumRequired

The user's response to the invitation. Must be either 'accept' or 'decline'.

Possible values:
Responses
chevron-right
200

Invitation successfully responded to.

application/json
post
/admin-management/invitation/respond/

Retrieve a Paginated List of Sub-Admins

get

Retrieve a List of Sub-Admins

This endpoint allows administrators to retrieve a list of sub-admins associated with their account. The response includes key user details such as unique ID, email, display name, assigned role, and account status.

Usage Example: Send a GET request to admin-management/sub-admins/ to retrieve all sub-admins under the current super admin.

Response Structure: Upon a successful request, the endpoint returns a JSON object containing the following fields:

  1. query_count: Total number of sub-admins available.

  2. users: An array of sub-admin objects.

Detailed Description of Response Fields:

  • query_count (integer): Represents the total number of sub-admins associated with the requesting super admin.

  • users (array of objects): Each object within the array represents a sub-admin with the following properties:

    • uid (string): Unique identifier of the sub-admin.

    • email (string): Email address of the sub-admin.

    • display_name (string): Display name of the sub-admin.

    • role (string): Role of the sub-admin. Possible values: 'Admin' or 'Owner'.

    • status (string): Status of the sub-admin account. Possible values: 'Active', 'Invited'.

Notes:

  • Proper authorization is required; only users with admin privileges can access this endpoint.

Authorizations
AuthorizationstringRequired

Enter your bearer token (Firebase auth) in the format: Bearer

Responses
chevron-right
200

Successfully retrieved a paginated list of sub-admins.

application/json
get
/admin-management/sub-admins/

Add a Sub-Admin

post

Add a Sub-Admin

This endpoint allows a super administrator to add a new sub-admin to their account. Provide the user_uid of the user you wish to promote to sub-admin status.

Usage Example: Send a POST request to admin-management/sub-admins/ with a JSON body containing the user_uid.

Request Body:

  • user_uid (string, required): The UID of the user to be added as a sub-admin.

Response Structure: Upon a successful request, the endpoint returns a confirmation message.

Notes:

  • The user_uid must correspond to an existing user.

  • Only users with super admin privileges can access this endpoint.

Authorizations
AuthorizationstringRequired

Enter your bearer token (Firebase auth) in the format: Bearer

Body
user_uidstringRequired

UID of the user to be set as sub-admin.

Responses
post
/admin-management/sub-admins/

Remove a Sub-Admin

delete

Remove a Sub-Admin

This endpoint allows a super administrator to remove an existing sub-admin from their account. Provide the user_uid of the sub-admin you wish to remove.

Usage Example: Send a DELETE request to admin-management/sub-admins/ with a JSON body containing the user_uid.

Request Body:

  • user_uid (string, required): The UID of the sub-admin to be removed.

Response Structure: Upon a successful request, the endpoint returns a confirmation message.

Notes:

  • The user_uid must correspond to an existing sub-admin.

  • Only users with super admin privileges can access this endpoint.

Authorizations
AuthorizationstringRequired

Enter your bearer token (Firebase auth) in the format: Bearer

Body
user_uidstringRequired

UID of the sub-admin to be removed.

Responses
chevron-right
200

Sub-admin successfully removed.

application/json
delete
/admin-management/sub-admins/

Last updated

Was this helpful?