Delete Project
Method
REST method is adopted.
HTTP Method
DELETE: Delete project (soft delete)
Naming Convention
To unify the naming of query parameters and nodes and improve readability, snake_case is used for URIs and JSON nodes in requests.
Request and Response
Headers
Meta information is set in HTTP headers, not in the response body.
Request Headers
AuthorizationContent-TypeAcceptAccept-language
Response Headers
Content-Type
Delete Project
URI
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| organization_id | string | Required | Organization UUID |
| project_id | string | Required | Project UUID |
Response
The response is JSON.
{
"id": "project-uuid",
"name": "Deleted Project",
"organizationId": "org-uuid",
"codeCount": 15,
"designCount": 8,
"createdAt": 1234567890000,
"updatedAt": 1234567899999,
"deletedAt": 1234567899999,
"createdBy": "user-id",
"updatedBy": "updater-id",
"deletedBy": "deleter-id"
}
Response Fields
| Name | Type | Description |
|---|---|---|
| id | string | Project UUID |
| name | string | Project name |
| organizationId | string | Parent organization UUID |
| codeCount | number | Number of code entries |
| designCount | number | Number of designs |
| createdAt | number | Creation timestamp (epoch milliseconds) |
| updatedAt | number | Update timestamp (epoch milliseconds) |
| deletedAt | number | Deletion timestamp (epoch milliseconds) |
| deletedBy | string | Deleter user ID |
Authentication
Authentication is performed using JSON Web Tokens (JWT) issued by Amazon Cognito.
Admins use their role permissions. A regular user needs an active user_project assignment with read/write access.
Error Handling
The status codes for error handling are as follows.
| Description | Status Code | Status Name |
|---|---|---|
| Missing credentials | 401 | Unauthorized |
| Insufficient permissions | 403 | Forbidden |
| Project or organization not found | 404 | Not Found |
| Internal server error | 500 | Internal Server Error |
Processing Flow
- Extract organization ID and project ID from path parameters
- Verify the user belongs to the organization
- Verify the project belongs to the specified organization
- For a regular user, verify an active project assignment with read/write access
- Perform soft delete (set
deletedAtanddeletedBy) - Return deleted project information
Detailed Flowchart
flowchart TD
Start([DELETE Request]) --> Route[Route Handler]
Route --> Auth[Auth & Parameter Extraction]
Auth --> Service[Service Layer]
Service --> AccessCheck[Access Check]
AccessCheck --> HasAccess{Write permission?}
HasAccess -->|No| Err404[404 Not Found]
HasAccess -->|Yes| Transaction
Transaction[Begin Transaction] --> CheckExist[Check existing<br/>WHERE deletedAt IS NULL]
CheckExist --> Exists{Exists?}
Exists -->|No| Rollback[Rollback]
Exists -->|Yes| SoftDelete
Rollback --> Err404
SoftDelete[UPDATE SET<br/>deletedAt = NOW<br/>deletedBy = user<br/>updatedAt = NOW<br/>updatedBy = user] --> Refetch[Fetch updated record]
Refetch --> Commit[Commit]
Commit --> Success[200 OK]
Notes
This endpoint performs a soft delete. The record is not physically deleted from the database; the deletedAt and deletedBy fields are set instead.