Admin APIs
How to use the PAAL AI API docs
Last updated
How to use the PAAL AI API docs
Last updated
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.
The base URL for all endpoints is:
Authentication
Some endpoints require authentication using a bearer token in the request header.
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):
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 an authenticated admin.
URL: /admin/logout
Method: POST
Authentication: Required (Bearer Token)
Example Response (Success):
Request an email verification code for admin verification.
URL: /admin/verify
Method: POST
Authentication: Required (Bearer Token)
Example Response (Success):
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):
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
displayName
Example Request:
Example Response (Success):
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 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):
In case of errors, the API returns JSON responses with appropriate error messages.
Example Error Response:
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):
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.