Skip to main content
GET
/
categories
/
:id
Get Category
curl --request GET \
  --url https://api.example.com/categories/:id
{
  "error": true,
  "msg": "<string>",
  "categorie": {
    "id": 123,
    "name": "<string>",
    "created_at": "<string>"
  }
}

Endpoint

GET /categories/:id
Retrieves detailed information about a specific category by its unique identifier.

Path Parameters

id
integer
required
The unique identifier of the category to retrieve.Validation Rules:
  • Must be an integer
  • Must be greater than or equal to 1

Response

error
boolean
Indicates whether an error occurred during the request.
msg
string
A message describing the result of the operation.
categorie
object
The category object containing detailed information.

Response Example

Success Response (200)

{
  "error": false,
  "msg": "Categorie got sucessfully",
  "categorie": {
    "id": 1,
    "name": "bebidas",
    "created_at": "2026-02-28T14:50:19.000Z"
  }
}

Error Responses

Invalid ID (400)

Returned when the provided ID doesn’t meet validation requirements (not an integer or less than 1).
{
  "error": true,
  "msg": "id is invalid"
}

Category Not Found (400)

Returned when no category exists with the specified ID.
{
  "error": true,
  "msg": "categorie not found"
}

Build docs developers (and LLMs) love