693 lines
31 KiB
JSON
693 lines
31 KiB
JSON
{
|
||
"openapi": "3.0.0",
|
||
"info": {
|
||
"title": "API Documentation",
|
||
"version": "1.0.0"
|
||
},
|
||
"paths": {
|
||
"/api/deleteAccount": {
|
||
"delete": {
|
||
"tags": [
|
||
"Auth"
|
||
],
|
||
"summary": "Delete user account",
|
||
"operationId": "dab9c1b923636bca3b073db3bdf87db0",
|
||
"responses": {
|
||
"200": {
|
||
"description": "Account successfully deleted",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"properties": {
|
||
"status": {
|
||
"type": "integer",
|
||
"example": 1
|
||
},
|
||
"message": {
|
||
"type": "string",
|
||
"example": "Your account has been deleted successfully. We’re sorry to see you go."
|
||
}
|
||
},
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Account deletion failed",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"properties": {
|
||
"status": {
|
||
"type": "integer",
|
||
"example": 0
|
||
},
|
||
"error": {
|
||
"type": "string",
|
||
"example": "We couldn’t delete your account at this moment. Please try again later."
|
||
},
|
||
"message": {
|
||
"type": "string",
|
||
"example": "Exception details here"
|
||
}
|
||
},
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"security": [
|
||
{
|
||
"passport": []
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"/api/login": {
|
||
"post": {
|
||
"tags": [
|
||
"Auth"
|
||
],
|
||
"summary": "Login user and get access token",
|
||
"operationId": "e3ce052cc00fd9dd647e77abd7807e14",
|
||
"requestBody": {
|
||
"required": true,
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"required": [
|
||
"email",
|
||
"password"
|
||
],
|
||
"properties": {
|
||
"email": {
|
||
"type": "string",
|
||
"format": "email",
|
||
"example": "nima@example.com"
|
||
},
|
||
"password": {
|
||
"type": "string",
|
||
"format": "password",
|
||
"example": "12345678"
|
||
}
|
||
},
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "Login successful",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"properties": {
|
||
"status": {
|
||
"type": "integer",
|
||
"example": 1
|
||
},
|
||
"message": {
|
||
"type": "string",
|
||
"example": "Login successful. Welcome back!"
|
||
},
|
||
"data": {
|
||
"properties": {
|
||
"name": {
|
||
"type": "string",
|
||
"example": "Nima Malakooti"
|
||
},
|
||
"email": {
|
||
"type": "string",
|
||
"example": "nima@example.com"
|
||
},
|
||
"token": {
|
||
"type": "string",
|
||
"example": "access_token_string"
|
||
}
|
||
},
|
||
"type": "object"
|
||
}
|
||
},
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"401": {
|
||
"description": "Unauthorized access",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"properties": {
|
||
"status": {
|
||
"type": "integer",
|
||
"example": 0
|
||
},
|
||
"message": {
|
||
"type": "string",
|
||
"example": "Unauthorized access. Please check your credentials and try again."
|
||
}
|
||
},
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Login failed",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"properties": {
|
||
"status": {
|
||
"type": "integer",
|
||
"example": 0
|
||
},
|
||
"error": {
|
||
"type": "string",
|
||
"example": "Failed to login user. Please try again later."
|
||
},
|
||
"message": {
|
||
"type": "string",
|
||
"example": "Some internal error message..."
|
||
}
|
||
},
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/logout": {
|
||
"post": {
|
||
"tags": [
|
||
"Auth"
|
||
],
|
||
"summary": "Logout the authenticated user",
|
||
"description": "Revoke the access token of the currently authenticated user using Laravel Passport.",
|
||
"operationId": "ad0ae046131d33ce33ee57a7f8a6a3f0",
|
||
"responses": {
|
||
"200": {
|
||
"description": "User logged out successfully",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"properties": {
|
||
"status": {
|
||
"type": "integer",
|
||
"example": 1
|
||
},
|
||
"message": {
|
||
"type": "string",
|
||
"example": "You have been logged out successfully. Come back soon!"
|
||
}
|
||
},
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Logout failed",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"properties": {
|
||
"status": {
|
||
"type": "integer",
|
||
"example": 0
|
||
},
|
||
"error": {
|
||
"type": "string",
|
||
"example": "Oops! Something went wrong while logging out. Please try again later."
|
||
},
|
||
"message": {
|
||
"type": "string",
|
||
"example": "Internal server error message here"
|
||
}
|
||
},
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"security": [
|
||
{
|
||
"passport": []
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"/api/email/verification-notification": {
|
||
"post": {
|
||
"tags": [
|
||
"Auth"
|
||
],
|
||
"summary": "Send email verification link",
|
||
"description": "Sends a verification email to the authenticated user.",
|
||
"operationId": "8ec40714c737be195e9d133ed44603d9",
|
||
"responses": {
|
||
"200": {
|
||
"description": "Verification email sent",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"properties": {
|
||
"status": {
|
||
"type": "integer",
|
||
"example": 1
|
||
},
|
||
"message": {
|
||
"type": "string",
|
||
"example": "Please check your email for the verification link."
|
||
}
|
||
},
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Failed to send verification email",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"properties": {
|
||
"status": {
|
||
"type": "integer",
|
||
"example": 0
|
||
},
|
||
"error": {
|
||
"type": "string",
|
||
"example": "We encountered an issue while sending the verification email. Please try again later."
|
||
},
|
||
"message": {
|
||
"type": "string",
|
||
"example": "Some internal error here..."
|
||
}
|
||
},
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"security": [
|
||
{
|
||
"passport": []
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"/api/email/verify": {
|
||
"post": {
|
||
"tags": [
|
||
"Auth"
|
||
],
|
||
"summary": "Verify user email",
|
||
"operationId": "9cc4882d8f915148bcc1fce772ebcfde",
|
||
"requestBody": {
|
||
"required": true,
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"required": [
|
||
"email",
|
||
"verification_token"
|
||
],
|
||
"properties": {
|
||
"email": {
|
||
"type": "string",
|
||
"format": "email",
|
||
"example": "nima@example.com"
|
||
},
|
||
"verification_token": {
|
||
"type": "string",
|
||
"example": "12345678"
|
||
}
|
||
},
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "Email successfully verified",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"properties": {
|
||
"status": {
|
||
"type": "integer",
|
||
"example": 1
|
||
},
|
||
"message": {
|
||
"type": "string",
|
||
"example": "Your email has been successfully verified. Thank you!"
|
||
}
|
||
},
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Verification failed",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"properties": {
|
||
"status": {
|
||
"type": "integer",
|
||
"example": 0
|
||
},
|
||
"error": {
|
||
"type": "string",
|
||
"example": "Your verification link was found, but something went wrong during the confirmation process. Please try again or request a new verification email."
|
||
},
|
||
"message": {
|
||
"type": "string",
|
||
"example": "Exception details here"
|
||
}
|
||
},
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"security": [
|
||
{
|
||
"passport": []
|
||
}
|
||
]
|
||
}
|
||
},
|
||
"/api/reset-password": {
|
||
"post": {
|
||
"tags": [
|
||
"Auth"
|
||
],
|
||
"summary": "Reset user password using token",
|
||
"operationId": "8e8229015b36555c6ad9564278a79929",
|
||
"requestBody": {
|
||
"required": true,
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"required": [
|
||
"email",
|
||
"password",
|
||
"password_confirmation",
|
||
"token"
|
||
],
|
||
"properties": {
|
||
"email": {
|
||
"type": "string",
|
||
"format": "email",
|
||
"example": "nima.8ak@gmail.com"
|
||
},
|
||
"password": {
|
||
"type": "string",
|
||
"format": "password",
|
||
"example": "new_secure_password"
|
||
},
|
||
"password_confirmation": {
|
||
"type": "string",
|
||
"format": "password",
|
||
"example": "new_secure_password"
|
||
},
|
||
"token": {
|
||
"type": "string",
|
||
"example": "abcdef123456"
|
||
}
|
||
},
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "Password reset successful or invalid token",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"properties": {
|
||
"status": {
|
||
"type": "integer",
|
||
"example": 1
|
||
},
|
||
"message": {
|
||
"type": "string",
|
||
"example": "Your password has been reset!"
|
||
}
|
||
},
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Internal Server Error",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"properties": {
|
||
"status": {
|
||
"type": "integer",
|
||
"example": 0
|
||
},
|
||
"error": {
|
||
"type": "string",
|
||
"example": "We couldn’t process the request due to an error. Please try again later."
|
||
},
|
||
"message": {
|
||
"type": "string",
|
||
"example": "Exception message here"
|
||
}
|
||
},
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/forgot-password": {
|
||
"post": {
|
||
"tags": [
|
||
"Auth"
|
||
],
|
||
"summary": "Send password reset link to user's email",
|
||
"operationId": "0cb521700d859fa50b6075f190634833",
|
||
"requestBody": {
|
||
"required": true,
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"required": [
|
||
"email"
|
||
],
|
||
"properties": {
|
||
"email": {
|
||
"type": "string",
|
||
"format": "email",
|
||
"example": "nima.8ak@gmail.com"
|
||
}
|
||
},
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "Success or user not found",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"oneOf": [
|
||
{
|
||
"properties": {
|
||
"status": {
|
||
"type": "integer",
|
||
"example": 1
|
||
},
|
||
"message": {
|
||
"type": "string",
|
||
"example": "We’ve emailed you the password reset link. Please check your inbox!"
|
||
}
|
||
},
|
||
"type": "object"
|
||
},
|
||
{
|
||
"properties": {
|
||
"status": {
|
||
"type": "integer",
|
||
"example": 0
|
||
},
|
||
"message": {
|
||
"type": "string",
|
||
"example": "We can’t find a user with that email address."
|
||
}
|
||
},
|
||
"type": "object"
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Server error",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"properties": {
|
||
"status": {
|
||
"type": "integer",
|
||
"example": 0
|
||
},
|
||
"error": {
|
||
"type": "string",
|
||
"example": "We couldn’t send the password reset email due to an error."
|
||
},
|
||
"message": {
|
||
"type": "string",
|
||
"example": "Some exception message"
|
||
}
|
||
},
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/api/register": {
|
||
"post": {
|
||
"tags": [
|
||
"Auth"
|
||
],
|
||
"summary": "Register a new user",
|
||
"operationId": "97cd8d12c6b5cf0267b29ff739a126f8",
|
||
"requestBody": {
|
||
"required": true,
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"required": [
|
||
"name",
|
||
"email",
|
||
"password",
|
||
"password_confirmation"
|
||
],
|
||
"properties": {
|
||
"name": {
|
||
"type": "string",
|
||
"example": "Nima Malakooti"
|
||
},
|
||
"email": {
|
||
"type": "string",
|
||
"format": "email",
|
||
"example": "nima@example.com"
|
||
},
|
||
"password": {
|
||
"type": "string",
|
||
"format": "password",
|
||
"example": "12345678"
|
||
},
|
||
"password_confirmation": {
|
||
"type": "string",
|
||
"format": "password",
|
||
"example": "12345678"
|
||
}
|
||
},
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"responses": {
|
||
"200": {
|
||
"description": "User registered successfully.",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"properties": {
|
||
"status": {
|
||
"type": "integer",
|
||
"example": 1
|
||
},
|
||
"message": {
|
||
"type": "string",
|
||
"example": "User registered successfully."
|
||
},
|
||
"user": {
|
||
"properties": {
|
||
"name": {
|
||
"type": "string",
|
||
"example": "Nima Malakooti"
|
||
},
|
||
"email": {
|
||
"type": "string",
|
||
"example": "nima@example.com"
|
||
},
|
||
"token": {
|
||
"type": "string",
|
||
"example": "access_token_string"
|
||
}
|
||
},
|
||
"type": "object"
|
||
}
|
||
},
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"500": {
|
||
"description": "Registration failed",
|
||
"content": {
|
||
"application/json": {
|
||
"schema": {
|
||
"properties": {
|
||
"status": {
|
||
"type": "integer",
|
||
"example": 0
|
||
},
|
||
"error": {
|
||
"type": "string",
|
||
"example": "Failed to register user. Please try again later."
|
||
},
|
||
"message": {
|
||
"type": "string",
|
||
"example": "SQLSTATE[23000]: Integrity constraint violation..."
|
||
}
|
||
},
|
||
"type": "object"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"tags": [
|
||
{
|
||
"name": "Auth",
|
||
"description": "Auth"
|
||
}
|
||
]
|
||
} |