openapi: 3.0.0 info: title: Admin API version: 1.0.0 description: > This API allows for the management of admin users. A default super admin with the following details has been seeded in the DB: - First Name: nobelium24 - Last Name: admin - Email: default@admin.com - Password: password - isSuperAdmin: true paths: /admin: post: summary: Create a new admin security: - bearerAuth: [] requestBody: required: true content: application/json: schema: type: object properties: firstName: type: string lastName: type: string email: type: string password: type: string responses: '201': description: Admin created successfully '403': description: You are not authorized to perform this action '409': description: Admin already exists /admin/login: post: summary: Login an admin requestBody: required: true content: application/json: schema: type: object properties: email: type: string password: type: string responses: '200': description: Login successful '404': description: Admin not found '400': description: Invalid password /admin/post/{postId}: delete: summary: Delete a post security: - bearerAuth: [] parameters: - in: path name: postId schema: type: string required: true responses: '200': description: Post deleted successfully /admin/user/{userId}: delete: summary: Delete a user security: - bearerAuth: [] parameters: - in: path name: userId schema: type: string required: true responses: '200': description: User deleted successfully /admin/posts: get: summary: Get all posts security: - bearerAuth: [] responses: '200': description: A list of posts with comments content: application/json: schema: type: object properties: posts: type: array items: type: object properties: id: type: string title: type: string content: type: string comments: type: array items: type: object properties: id: type: string content: type: string components: securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT