Release Management API Documentation

Comprehensive guide to the Release Management REST API

Overview

The Release Management API provides a complete set of endpoints for managing users, projects, and release notes in a software release management system. The API follows REST principles and uses JSON for data exchange.

Authentication

Most endpoints require authentication using JWT tokens. Tokens are obtained through the login endpoint and should be included in the Authorization header:

Authorization Header
Authorization: Bearer <your-jwt-token>

Base URL

http://localhost:9000/api

Roles

Different endpoints require different user roles:

Account Management

POST /api/account/register

Register a new user account. New users are inactive by default and require admin approval.

Public

Request Body

Field Type Required Description
username string Yes Unique username (max 50 characters)
email string Yes User's email address
password string Yes Password (min 6 characters)
confirmPassword string Yes Must match password
firstName string No User's first name (max 50 characters)
lastName string No User's last name (max 50 characters)
Example Request
{
  "username": "johndoe",
  "email": "john.doe@example.com",
  "password": "securePassword123",
  "confirmPassword": "securePassword123",
  "firstName": "John",
  "lastName": "Doe"
}

Response

Returns a UserDto object with the created user's information.

POST /api/account/login

Authenticate a user and receive a JWT token for subsequent requests.

Public

Request Body

Field Type Required Description
username string Yes User's username
password string Yes User's password
Example Request
{
  "username": "johndoe",
  "password": "securePassword123"
}

Response

Returns a UserLoginResponseDto containing the user information and JWT token.

User Management (Admin)

GET /api/admin/pending-users

Retrieve a list of all pending users who require admin approval.

Admin

Response

Returns an array of UserDto objects representing pending users.

GET /api/admin/users

Retrieve a list of all users in the system.

Admin

Response

Returns an array of UserDto objects representing all users.

PUT /api/admin/approve-user/{id}

Approve a pending user, making their account active.

Admin

Path Parameters

Parameter Type Required Description
id integer Yes ID of the user to approve

Response

Returns a success message upon successful approval.

Project Management (Admin)

GET /api/admin/projects

Retrieve a list of all projects in the system.

Admin

Response

Returns an array of ProjectDto objects representing all projects.

POST /api/admin/projects

Create a new project.

Admin

Request Body

Field Type Required Description
name string Yes Project name (max 100 characters)
description string No Project description (max 500 characters)
Example Request
{
  "name": "Mobile App Development",
  "description": "Development of the company's new mobile application"
}

Response

Returns the created ProjectDto object.

POST /api/admin/allocate-project

Allocate a project to a user.

Admin

Request Body

Field Type Required Description
userId integer Yes ID of the user to allocate the project to
projectId integer Yes ID of the project to allocate
Example Request
{
  "userId": 123,
  "projectId": 456
}

Response

Returns a success message upon successful allocation.

User Functions

GET /api/user/projects

Retrieve a list of projects allocated to the authenticated user.

User

Response

Returns an array of ProjectDto objects representing the user's projects.

GET /api/user/projects/{projectId}/releasenotes

Retrieve release notes for a specific project allocated to the authenticated user.

User

Path Parameters

Parameter Type Required Description
projectId integer Yes ID of the project to retrieve release notes for

Response

Returns an array of ReleaseNoteDto objects for the specified project.

Release Note Management (Admin)

POST /api/releasenote

Create a new release note for a project.

Admin

Request Body

Field Type Required Description
title string Yes Release note title (max 200 characters)
content string Yes Release note content
version string No Version identifier (max 50 characters)
projectId integer Yes ID of the project this release note belongs to
Example Request
{
  "title": "Version 2.1.0 Release",
  "content": "This release includes bug fixes and performance improvements.",
  "version": "2.1.0",
  "projectId": 456
}

Response

Returns the created ReleaseNoteDto object.

GET /api/releasenote/{id}

Retrieve a specific release note by ID.

Admin

Path Parameters

Parameter Type Required Description
id integer Yes ID of the release note to retrieve

Response

Returns the ReleaseNoteDto object for the specified release note.

GET /api/releasenote/project/{projectId}

Retrieve all release notes for a specific project.

Admin

Path Parameters

Parameter Type Required Description
projectId integer Yes ID of the project to retrieve release notes for

Response

Returns an array of ReleaseNoteDto objects for the specified project.

PUT /api/releasenote/{id}

Update an existing release note.

Admin

Path Parameters

Parameter Type Required Description
id integer Yes ID of the release note to update

Request Body

Same as the POST request body for creating a release note.

Response

Returns a 204 No Content response upon successful update.

DELETE /api/releasenote/{id}

Delete a release note.

Admin

Path Parameters

Parameter Type Required Description
id integer Yes ID of the release note to delete

Response

Returns a 204 No Content response upon successful deletion.

User Management (SuperAdmin)

GET /api/superadmin/users

Retrieve a list of all users in the system.

SuperAdmin

Response

Returns an array of UserDto objects representing all users.

POST /api/superadmin/users

Create a new user account directly (bypassing registration).

SuperAdmin

Request Body

Field Type Required Description
username string Yes Username (max 50 characters)
email string Yes Email address
password string Yes Password (min 6 characters)
firstName string No First name (max 50 characters)
lastName string No Last name (max 50 characters)
isActive boolean No Whether the account is active (default: false)
roleId integer Yes Role ID (1=User, 2=Admin, 3=SuperAdmin)

Response

Returns the created UserDto object.

PUT /api/superadmin/users/{id}

Update an existing user's information.

SuperAdmin

Path Parameters

Parameter Type Required Description
id integer Yes ID of the user to update

Request Body

Same fields as the POST request for creating a user, except password.

Response

Returns the updated UserDto object.

PUT /api/superadmin/users/{id}/role

Change a user's role.

SuperAdmin

Path Parameters

Parameter Type Required Description
id integer Yes ID of the user whose role to change

Request Body

Field Type Required Description
roleId integer Yes New role ID (1=User, 2=Admin, 3=SuperAdmin)

Response

Returns a success message upon successful role change.

PUT /api/superadmin/users/{id}/reset-password

Reset a user's password.

SuperAdmin

Path Parameters

Parameter Type Required Description
id integer Yes ID of the user whose password to reset

Request Body

Field Type Required Description
newPassword string Yes New password (min 6 characters)

Response

Returns a success message upon successful password reset.

DELETE /api/superadmin/users/{id}

Delete a user account.

SuperAdmin

Path Parameters

Parameter Type Required Description
id integer Yes ID of the user to delete

Response

Returns a success message upon successful deletion.