Admin APIs
How to use the PAAL AI API docs
PAAL AI User Controller API Documentation
Introduction
This API documentation outlines the endpoints available for admin management in the PAAL AI application. These endpoints allow for the creation of new admin , user authentication, user data manipulation, password management, and email verification.
Base URL
The base URL for all endpoints is: https://paal-ecosystem-backend.onrender.com
Authentication
Some endpoints require authentication using a bearer token in the request header.
Create New Admin
Create a new admin account.
URL:
/admin/new
Method:
POST
Authentication: Not required
Request Body:
email
(string, required with password): User's email address.password
(string, optional): if using user's password.auth (String, optional) If using Google 0auth
Example Request:
Example Response (Success):
Example Response (Error):
Admin Login
Authenticate an existing user.
URL:
/admin/login
Method:
POST
Authentication: Not required
Request Body:
email
(string, required with password): User's email address.password
(string, optional): if using user's password.auth (String, optional) If using Google 0auth
Example Request:
Example Response (Success):
Example Response (Error):
Logout
Logout an authenticated admin.
URL:
/admin/logout
Method:
POST
Authentication: Required (Bearer Token)
Example Response (Success):
Request Email Verification Code
Request an email verification code for admin verification.
URL:
/admin/verify
Method:
POST
Authentication: Required (Bearer Token)
Example Response (Success):
Verify Email Verification Code
Verify the email verification code sent to the admin.
URL:
/admin/verifycode
Method:
POST
Authentication: Required (Bearer Token)
Request Body:
code
(string, required): Verification code received via email.
Example Request:
Example Response (Success):
Modify Admin profile data
Save user data such as email or password.
URL:
/admin/save
Method:
POST
Authentication: Required (Bearer Token)
Request Body: Admin data fields to be updated.
Modifiable fields present
fullName
password (required with oldPassword)
oldPassword
email
displayName
Example Request:
Example Response (Success):
Generate Reset Password Code
Generate a code for resetting the admin's password.
URL:
/admin/resetpasswordcode
Method:
POST
Authentication: Not required
Request Body:
email
(string, required): User's email address.
Example Request:
Example Response (Success):
Reset Password
Reset the admin's password using the reset code.
URL:
/admin/resetpassword
Method:
POST
Authentication: Not required
Request Body:
email
(string, required): User's email address.code
(string, required): Reset code received via email.password
(string, required): New password.
Example Request:
Example Response (Success):
Error Responses
In case of errors, the API returns JSON responses with appropriate error messages.
Example Error Response:
Retrieve Admin Info
Retrieve information about an admin user.
URL:
/admin
Method:
GET
Authentication: Required (Email query parameter or Bearer Token)
Query Parameters:
email
(string, optional): Admin's email address.
Request Headers:
Authorization: Bearer <TOKEN>
(string, optional): Bearer token for authentication.
Example Request (Using Email):
Example Request (Using Bearer Token):
Example Response (Success):
Example Response (Error):
Error Responses
In case of errors, the API returns JSON responses with appropriate error messages.
Example Error Response:
This documentation provides details on how to interact with the PAAL AI admin management APIs. For any further assistance or clarification, please refer to the API documentation or contact support.
Last updated