-
Notifications
You must be signed in to change notification settings - Fork 1
Admin API
M♢NTΛSIM edited this page Aug 17, 2024
·
1 revision
-
POST
/
- Summary: Creates a new administrator account. This endpoint is accessible only to users with admin permissions.
- Security: Requires bearer token authentication.
-
Request Body:
-
Content-Type:
application/json
-
Schema:
{ "type": "object", "properties": { "email": { "type": "string", "description": "Email address for the new admin." }, "password": { "type": "string", "description": "Password for the new admin account." } } }
-
Content-Type:
-
Responses:
- 201 Created: Admin created successfully.
- 409 Conflict: Email already registered.
- 403 Forbidden: Email already registered as a user.
- 400 Bad Request: Invalid email provided.
-
All Other Methods on
/
- Summary: Handles unsupported methods.
-
Responses:
- 405 Method Not Allowed: Method not supported.
-
GET
/verify/{token}
- Summary: Verifies the admin's email using the provided token.
-
Parameters:
-
Path Parameter:
token
-
Type:
string
- Description: Verification token sent to the admin's email.
-
Type:
-
Path Parameter:
-
Responses:
- 200 OK: Email verified successfully.
- 403 Forbidden: Invalid or expired token.
-
All Other Methods on
/verify/{token}
- Summary: Handles unsupported methods.
-
Responses:
- 405 Method Not Allowed: Method not supported.
-
GET
/resend-verification/{id}
- Summary: Resends the verification email to the admin using the admin ID.
-
Parameters:
-
Path Parameter:
id
-
Type:
string
- Description: Admin ID for whom to resend the verification email.
-
Type:
-
Path Parameter:
-
Responses:
- 200 OK: Verification email resent successfully.
- 404 Not Found: Admin not found.
- 403 Forbidden: Email already verified.
-
All Other Methods on
/resend-verification/{id}
- Summary: Handles unsupported methods.
-
Responses:
- 405 Method Not Allowed: Method not supported.
-
PUT
/requestBooks-new-password
- Summary: Initiates a password reset process for an admin.
-
Request Body:
-
Content-Type:
application/json
-
Schema:
{ "type": "object", "properties": { "email": { "type": "string", "description": "Email address of the admin." } } }
-
Content-Type:
-
Responses:
- 200 OK: Password reset email sent successfully.
- 404 Not Found: No account found with that email address.
- 401 Unauthorized: Email not verified.
-
All Other Methods on
/requestBooks-new-password
- Summary: Handles unsupported methods.
-
Responses:
- 405 Method Not Allowed: Method not supported.
-
PUT
/reset-password/{token}
- Summary: Resets the admin's password using a provided token.
-
Parameters:
-
Path Parameter:
token
-
Type:
string
- Description: Reset password token sent to the admin's email.
-
Type:
-
Path Parameter:
-
Request Body:
-
Content-Type:
application/json
-
Schema:
{ "type": "object", "properties": { "newPassword": { "type": "string", "description": "The new password to be set." }, "confirmNewPassword": { "type": "string", "description": "Confirmation of the new password." } } }
-
Content-Type:
-
Responses:
- 200 OK: Password reset successfully.
- 403 Forbidden: Invalid or expired token.
-
All Other Methods on
/reset-password/{token}
- Summary: Handles unsupported methods.
-
Responses:
- 405 Method Not Allowed: Method not supported.