2024-03-06 09:58:04 +00:00
|
|
|
openapi: 3.0.0
|
|
|
|
info:
|
|
|
|
title: Account Management API
|
|
|
|
version: "1.0"
|
|
|
|
description: API for managing user accounts, including login, registration, OTP operations, and password resets.
|
|
|
|
paths:
|
|
|
|
/api/auth/login:
|
|
|
|
post:
|
|
|
|
summary: Login to the system
|
|
|
|
requestBody:
|
|
|
|
required: true
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/LoginRequest'
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: Successfully logged in
|
2024-03-06 23:11:34 +00:00
|
|
|
content:
|
|
|
|
application/json:
|
2024-03-06 09:58:04 +00:00
|
|
|
schema:
|
2024-03-06 23:11:34 +00:00
|
|
|
$ref: '#/components/schemas/LoginResponse'
|
2024-03-06 09:58:04 +00:00
|
|
|
'401':
|
|
|
|
description: Unauthorized
|
2024-03-17 13:27:57 +00:00
|
|
|
/api/auth/logout:
|
|
|
|
post:
|
|
|
|
summary: Logout of account service
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: Successfully logged out
|
2024-03-06 09:58:04 +00:00
|
|
|
/api/auth/register:
|
|
|
|
post:
|
|
|
|
summary: Register a new account
|
|
|
|
requestBody:
|
|
|
|
required: true
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/RegisterRequest'
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: Successfully registered
|
|
|
|
'400':
|
|
|
|
description: Bad Request
|
|
|
|
/api/auth/verify-email:
|
|
|
|
post:
|
|
|
|
summary: Verify email address
|
|
|
|
requestBody:
|
|
|
|
required: true
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/VerifyEmailRequest'
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: Email verified successfully
|
|
|
|
/api/auth/otp/generate:
|
|
|
|
get:
|
|
|
|
summary: Generate OTP for two-factor authentication
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: OTP generated successfully
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/OTPGenerateResponse'
|
|
|
|
/api/auth/otp/verify:
|
|
|
|
post:
|
|
|
|
summary: Verify OTP for enabling two-factor authentication
|
|
|
|
requestBody:
|
|
|
|
required: true
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/OTPVerifyRequest'
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: OTP verified successfully
|
|
|
|
/api/auth/otp/validate:
|
|
|
|
post:
|
|
|
|
summary: Validate OTP for two-factor authentication login
|
|
|
|
requestBody:
|
|
|
|
required: true
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/OTPValidateRequest'
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: OTP validated successfully
|
|
|
|
/api/auth/otp/disable:
|
|
|
|
post:
|
|
|
|
summary: Disable OTP for two-factor authentication
|
|
|
|
requestBody:
|
|
|
|
required: true
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/OTPDisableRequest'
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: OTP disabled successfully
|
|
|
|
/api/auth/password-reset/request:
|
|
|
|
post:
|
|
|
|
summary: Request a password reset
|
|
|
|
requestBody:
|
|
|
|
required: true
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/PasswordResetRequest'
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: Password reset requested successfully
|
|
|
|
/api/auth/password-reset/confirm:
|
|
|
|
post:
|
|
|
|
summary: Confirm a password reset
|
|
|
|
requestBody:
|
|
|
|
required: true
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/PasswordResetVerifyRequest'
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: Password reset successfully
|
2024-03-13 16:30:31 +00:00
|
|
|
/api/auth/ping:
|
|
|
|
post:
|
2024-03-13 16:26:38 +00:00
|
|
|
summary: Auth check endpoint
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: Pong
|
2024-03-13 21:26:25 +00:00
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/PingResponse'
|
2024-03-13 16:26:38 +00:00
|
|
|
'401':
|
|
|
|
description: Unauthorized
|
2024-03-14 10:42:38 +00:00
|
|
|
/api/account:
|
|
|
|
get:
|
|
|
|
summary: Get account information
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: Account information retrieved successfully
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/AccountInfoResponse'
|
|
|
|
'401':
|
|
|
|
description: Unauthorized
|
2024-03-17 15:10:12 +00:00
|
|
|
/api/upload-limit:
|
|
|
|
get:
|
|
|
|
summary: Get the basic file upload (POST) upload limit set by the portal
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: Upload limit retrieved successfully
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/UploadLimitResponse'
|
2024-03-06 09:58:04 +00:00
|
|
|
|
|
|
|
components:
|
|
|
|
schemas:
|
|
|
|
LoginRequest:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- email
|
|
|
|
- password
|
|
|
|
properties:
|
|
|
|
email:
|
|
|
|
type: string
|
|
|
|
password:
|
|
|
|
type: string
|
2024-03-06 23:11:34 +00:00
|
|
|
LoginResponse:
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
token:
|
|
|
|
type: string
|
2024-03-06 09:58:04 +00:00
|
|
|
RegisterRequest:
|
|
|
|
type: object
|
|
|
|
required:
|
2024-03-13 17:54:30 +00:00
|
|
|
- first_name
|
|
|
|
- last_name
|
2024-03-06 09:58:04 +00:00
|
|
|
- email
|
|
|
|
- password
|
|
|
|
properties:
|
2024-03-13 17:54:30 +00:00
|
|
|
first_name:
|
2024-03-06 09:58:04 +00:00
|
|
|
type: string
|
2024-03-13 17:54:30 +00:00
|
|
|
last_name:
|
2024-03-06 09:58:04 +00:00
|
|
|
type: string
|
|
|
|
email:
|
|
|
|
type: string
|
|
|
|
password:
|
|
|
|
type: string
|
|
|
|
VerifyEmailRequest:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- email
|
|
|
|
- token
|
|
|
|
properties:
|
|
|
|
email:
|
|
|
|
type: string
|
|
|
|
token:
|
|
|
|
type: string
|
|
|
|
OTPGenerateResponse:
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
OTP:
|
|
|
|
type: string
|
|
|
|
OTPVerifyRequest:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- OTP
|
|
|
|
properties:
|
|
|
|
OTP:
|
|
|
|
type: string
|
|
|
|
OTPValidateRequest:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- OTP
|
|
|
|
properties:
|
|
|
|
OTP:
|
|
|
|
type: string
|
|
|
|
OTPDisableRequest:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- password
|
|
|
|
properties:
|
|
|
|
password:
|
|
|
|
type: string
|
|
|
|
PasswordResetRequest:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- email
|
|
|
|
properties:
|
|
|
|
email:
|
|
|
|
type: string
|
|
|
|
PasswordResetVerifyRequest:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- email
|
|
|
|
- token
|
|
|
|
- password
|
|
|
|
properties:
|
|
|
|
email:
|
|
|
|
type: string
|
|
|
|
token:
|
|
|
|
type: string
|
|
|
|
password:
|
|
|
|
type: string
|
2024-03-13 21:26:25 +00:00
|
|
|
PingResponse:
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
ping:
|
|
|
|
type: string
|
2024-03-18 21:19:52 +00:00
|
|
|
token:
|
|
|
|
type: string
|
2024-03-14 10:42:38 +00:00
|
|
|
AccountInfoResponse:
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
id:
|
|
|
|
type: number
|
|
|
|
first_name:
|
|
|
|
type: string
|
|
|
|
last_name:
|
|
|
|
type: string
|
|
|
|
email:
|
|
|
|
type: string
|
2024-03-17 15:10:12 +00:00
|
|
|
UploadLimitResponse:
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
limit:
|
|
|
|
type: number
|
|
|
|
required:
|
|
|
|
- limit
|