| Server IP : 139.59.63.204 / Your IP : 216.73.217.62 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ubuntu-s-1vcpu-1gb-blr1-01 6.8.0-110-generic #110-Ubuntu SMP PREEMPT_DYNAMIC Thu Mar 19 15:09:20 UTC 2026 x86_64 User : root ( 0) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/demo/html/pragati/public/ |
Upload File : |
{
"openapi": "3.0.3",
"info": {
"title": "Pragati Admin API",
"description": "Versioned JWT authentication APIs for Pragati Admin.",
"version": "1.0.0"
},
"servers": [
{
"url": "/api",
"description": "Current application"
}
],
"tags": [
{
"name": "Authentication",
"description": "JWT authentication endpoints"
}
],
"paths": {
"/v1/auth/login": {
"post": {
"tags": ["Authentication"],
"summary": "Login user",
"description": "Authenticates a user and returns a JWT access token.",
"operationId": "loginUser",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/LoginRequest"
},
"example": {
"email": "admin@example.com",
"password": "password"
}
}
}
},
"responses": {
"200": {
"description": "Login successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AuthSuccessResponse"
}
}
}
},
"422": {
"$ref": "#/components/responses/ValidationError"
}
}
}
},
"/v1/auth/me": {
"get": {
"tags": ["Authentication"],
"summary": "Get profile",
"description": "Returns the authenticated user's profile.",
"operationId": "getProfile",
"security": [
{
"bearerAuth": []
}
],
"responses": {
"200": {
"description": "Profile fetched successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProfileSuccessResponse"
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthenticated"
}
}
}
},
"/v1/auth/refresh": {
"post": {
"tags": ["Authentication"],
"summary": "Refresh token",
"description": "Refreshes the current JWT token and returns a new token.",
"operationId": "refreshToken",
"security": [
{
"bearerAuth": []
}
],
"responses": {
"200": {
"description": "Token refreshed successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AuthSuccessResponse"
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthenticated"
}
}
}
},
"/v1/auth/logout": {
"post": {
"tags": ["Authentication"],
"summary": "Logout user",
"description": "Invalidates the current JWT token.",
"operationId": "logoutUser",
"security": [
{
"bearerAuth": []
}
],
"responses": {
"200": {
"description": "Logout successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SuccessResponse"
}
}
}
},
"401": {
"$ref": "#/components/responses/Unauthenticated"
}
}
}
}
},
"components": {
"securitySchemes": {
"bearerAuth": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "JWT"
}
},
"responses": {
"Unauthenticated": {
"description": "Unauthenticated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
},
"example": {
"success": false,
"message": "Token is not found."
}
}
}
},
"InvalidToken": {
"description": "Invalid or expired token",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
},
"examples": {
"invalid": {
"summary": "Invalid token",
"value": {
"success": false,
"message": "Token is invalid."
}
},
"expired": {
"summary": "Expired token",
"value": {
"success": false,
"message": "Token is expired."
}
}
}
}
}
},
"ValidationError": {
"description": "Validation failed",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidationErrorResponse"
},
"example": {
"success": false,
"message": "Validation failed.",
"errors": {
"email": ["The email field is required."]
}
}
}
}
}
},
"schemas": {
"LoginRequest": {
"type": "object",
"required": ["email", "password"],
"properties": {
"email": {
"type": "string",
"format": "email",
"example": "admin@example.com"
},
"password": {
"type": "string",
"format": "password",
"example": "password"
}
}
},
"User": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"example": 1
},
"name": {
"type": "string",
"example": "Admin User"
},
"email": {
"type": "string",
"format": "email",
"example": "admin@example.com"
},
"email_verified_at": {
"type": "string",
"format": "date-time",
"nullable": true
},
"created_at": {
"type": "string",
"format": "date-time",
"nullable": true
},
"updated_at": {
"type": "string",
"format": "date-time",
"nullable": true
}
}
},
"TokenData": {
"type": "object",
"properties": {
"access_token": {
"type": "string",
"example": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..."
},
"token_type": {
"type": "string",
"example": "bearer"
},
"expires_in": {
"type": "integer",
"example": 3600
},
"user": {
"$ref": "#/components/schemas/User"
}
}
},
"SuccessResponse": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"example": true
},
"message": {
"type": "string",
"example": "Success"
}
}
},
"AuthSuccessResponse": {
"allOf": [
{
"$ref": "#/components/schemas/SuccessResponse"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/TokenData"
}
}
}
]
},
"ProfileSuccessResponse": {
"allOf": [
{
"$ref": "#/components/schemas/SuccessResponse"
},
{
"type": "object",
"properties": {
"data": {
"type": "object",
"properties": {
"user": {
"$ref": "#/components/schemas/User"
}
}
}
}
}
]
},
"ErrorResponse": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string",
"example": "Unauthenticated."
}
}
},
"ValidationErrorResponse": {
"allOf": [
{
"$ref": "#/components/schemas/ErrorResponse"
},
{
"type": "object",
"properties": {
"errors": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
]
}
}
}
}