Skip to content

Category

The category module provides CRUD for the internal category taxonomy used to group ACL permissions (see the Categories entity). All endpoints require Bearer JWT plus a specific ACL permission. The DTO body is currently empty in code — FE should not send free-form fields because forbidNonWhitelisted: true will reject them.

PropertyValue
Base URL{HOST}/v1
AuthBearer JWT (header Authorization) or access_token cookie
Content-Typeapplication/json
Error envelope{ "message": string | string[], "statusCode": number, "error": string }
ValidationGlobal ValidationPipe · whitelist: true, forbidNonWhitelisted: true · unknown fields → 400
Related modulesacl (permission groupings), authentication
Document versionv1 · 2026-05-20
AudienceInternal FE devs (mobile + web)

Five standard REST endpoints to manage the Categories entity. The DTOs CreateCategoryDto and UpdateCategoryDto are currently empty — the service is still a stub. FE may assume a minimal shape until the backend fills in the fields. Each endpoint is guarded by a separate ACL permission (create-category, read-category, update-category, delete-category).

MethodPathAuthSummary
POST/v1/categoriesbearerCreate a new category (permission create-category)
GET/v1/categoriesbearerList all categories (permission read-category)
GET/v1/categories/:idbearerDetail of one category (permission read-category)
PATCH/v1/categories/:idbearerUpdate a category (permission update-category)
DELETE/v1/categories/:idbearerSoft delete a category (permission delete-category)

Create a new category. The DTO is currently empty so the server rejects any extra field (forbidNonWhitelisted). The endpoint is set up for admins managing the permission taxonomy.

bearer create-category
FieldTypeRequiredNotes
(empty)The DTO does not define any field yet; send body {}. Unknown fields will cause a 400.
{}
{
"status": "success",
"statusCode": 201,
"message": "Success",
"data": "This action adds a new category"
}

The data body is a stub until the final service is implemented. Make sure FE treats the response as opaque until the backend ships.

StatusWhen it occurs
400 Bad RequestBody contains non-whitelisted fields
401 UnauthorizedBearer/cookie is invalid
403 ForbiddenCaller does not have the create-category permission

Retrieve all categories. No pagination/filter yet; the service is still a stub.

bearer read-category
{
"status": "success",
"statusCode": 200,
"message": "Success",
"data": "This action returns all category"
}
StatusWhen it occurs
401 UnauthorizedBearer/cookie is invalid
403 ForbiddenMissing the read-category permission

Detail of one category by id. The service does a numeric cast (+id).

bearer read-category
ParamTypeNotes
idstringCurrently read as a numeric string by the service (+id). No ParseUUIDPipe.
{
"status": "success",
"statusCode": 200,
"message": "Success",
"data": "This action returns a #1 category"
}
StatusWhen it occurs
401 UnauthorizedBearer/cookie is invalid
403 ForbiddenMissing the read-category permission

PATCH /v1/categories/:id bearer

Section titled “PATCH /v1/categories/:id ”

Update a category. The DTO is still PartialType(CreateCategoryDto) which is empty — body must be {}.

bearer update-category
ParamTypeNotes
idstringSee notes on the detail endpoint
FieldTypeRequiredNotes
(empty)DTO PartialType(CreateCategoryDto) — no fields exposed
{
"status": "success",
"statusCode": 200,
"message": "Success",
"data": "This action updates a #1 category"
}
StatusWhen it occurs
400 Bad RequestUnknown field in body
401 UnauthorizedBearer/cookie is invalid
403 ForbiddenMissing the update-category permission

DELETE /v1/categories/:id bearer

Section titled “DELETE /v1/categories/:id ”

Delete a category. The service is still a stub — the final implementation is expected to be a soft delete (the entity inherits from AuditableEntity, so deleted_at/deleted_by are present).

bearer delete-category
ParamTypeNotes
idstringSee notes on the detail endpoint
{
"status": "success",
"statusCode": 200,
"message": "Success",
"data": "This action removes a #1 category"
}
StatusWhen it occurs
401 UnauthorizedBearer/cookie is invalid
403 ForbiddenMissing the delete-category permission

  • create-category — POST
  • read-category — GET (list + detail)
  • update-category — PATCH
  • delete-category — DELETE
  • name (string, unique)
  • display_name (string)
  • description (text, optional)
  • permissions[] (relation to ACL Permissions)
    • audit fields from AuditableEntity
{
"message": "property foo should not exist",
"statusCode": 400,
"error": "Bad Request"
}
  • 400 body validation / non-whitelisted field
  • 401 missing / expired token
  • 403 permission mismatch
  • 500 internal — the service stub can throw a raw error