Skip to main content
ADMIN ACCESS REQUIRED - This endpoint requires authentication with an ADMIN role.

Overview

Retrieves detailed information about a specific category by its name.

Authentication

This endpoint requires:
  • Valid JWT token in the Authorization header
  • User must have ADMIN role

Request

name
string
required
The name of the category to retrieve. This is used as the route parameter.

Response

success
boolean
required
Indicates if the request was successful
message
string
required
Success message indicating the category was retrieved
data
object
required
category
object
required
The category object
id
integer
required
Unique identifier for the category
name
string
required
Category name (max 255 characters)
description
string
Optional category description (max 255 characters)
created_at
string
required
Timestamp when the category was created
updated_at
string
required
Timestamp when the category was last updated
deleted_at
string
Timestamp when the category was soft deleted (null if active)

Code Examples

curl -X GET "https://api.example.com/category/Hardware" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Accept: application/json" \
  -H "Accept-Language: en"

Response Examples

Success Response (200 OK)

{
  "success": true,
  "message": "Category retrieved successfully",
  "data": {
    "category": {
      "id": 1,
      "name": "Hardware",
      "description": "Hardware related issues and repairs",
      "created_at": "2026-03-08T10:30:00.000000Z",
      "updated_at": "2026-03-08T10:30:00.000000Z",
      "deleted_at": null
    }
  }
}

Not Found Response (404 Not Found)

Returned when the category with the specified name does not exist:
{
  "success": false,
  "message": "Category not found"
}

Unauthorized Response (401 Unauthorized)

{
  "success": false,
  "message": "Unauthenticated"
}

Forbidden Response (403 Forbidden)

Returned when the authenticated user does not have ADMIN role:
{
  "success": false,
  "message": "Unauthorized. Admin access required."
}

Error Codes

Status CodeDescription
200Success - Category retrieved
401Unauthorized - Invalid or missing JWT token
403Forbidden - User does not have ADMIN role
404Not Found - Category does not exist
500Internal Server Error

Build docs developers (and LLMs) love