Skip to main content

Base URL

http://localhost:8080/api/tour-categories

Get All Categories

GET /api/tour-categories
endpoint
Retrieve a list of all tour categories in the platform.

Response

categories
array
Array of tour category objects

Example

curl -X GET http://localhost:8080/api/tour-categories

Get Category by ID

GET /api/tour-categories/{categoryId}
endpoint
Retrieve details of a specific tour category by its ID.

Path Parameters

categoryId
long
required
The unique identifier of the category

Response

Returns a single category object with the same structure as described in Get All Categories.

Example

curl -X GET http://localhost:8080/api/tour-categories/1

Create Category

POST /api/tour-categories
endpoint
Create a new tour category in the system.

Request Body

name
string
required
Category name

Response

Returns the created category object including the generated categoryId.

Example

curl -X POST http://localhost:8080/api/tour-categories \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Eco Tourism"
  }'

Update Category

PUT /api/tour-categories/{categoryId}
endpoint
Update an existing tour category by its ID.

Path Parameters

categoryId
long
required
The unique identifier of the category to update

Request Body

name
string
required
Updated category name

Response

Returns the updated category object.

Example

curl -X PUT http://localhost:8080/api/tour-categories/1 \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Cultural & Heritage Tours"
  }'

Delete Category

DELETE /api/tour-categories/{categoryId}
endpoint
Delete a tour category by its ID.

Path Parameters

categoryId
long
required
The unique identifier of the category to delete

Response

Returns the deleted category object.

Example

curl -X DELETE http://localhost:8080/api/tour-categories/5

Build docs developers (and LLMs) love