Skip to main content

Categories API Documentation

GET: Retrieve Categories

Description

This route is used to retrieve list of categories for a specific project.

Method

GET

Query Parameters

  • sort (string): The field by which to sort the categories.
  • page (number): The page number of the results.
  • limit (number): The number of items per page.
  • searchTerm (string): Optional search term to filter categories.

Response

  • Returns a JSON response with the list of categories or an error message.

Status Codes

  • 200 OK: categories retrieved successfully.
  • 500 Internal Server Error: Error listing categories.

Throws

  • An error if request validation or categories retrieval fails.

Example cURL

curl --location 'https://app.ai12z.net/api/projects/{projectId}/settings/categories' \
--header 'Authorization: Bearer <YOUR_KEY>' \


POST: Create a Categories

Description

This route is used to create a new categories for a project.

Method

POST

Request Body

Example request body:

{
"category": "title",
"description": "content"
}

Response

  • Returns the newly created categories.

Status Codes

  • 200 OK: Categories created successfully.
  • 500 Internal Server Error: Error creating the Categories.

Throws

  • An error if request validation or categories creation fails.

Example cURL

curl --location 'https://app.ai12z.net/api/projects/{projectId}/settings/categories'\
--header 'Authorization: Bearer <YOUR_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"category":"title",
"description":"content"
}'

PUT: Update a Categories

Description

This route is used to update an existing categories.

Method

PUT

Request Body

Example request body:

{
"category": "title",
"description": "content"
}

Response

  • Returns the updated categories.

Status Codes

  • 200 OK: Categories updated successfully.
  • 500 Internal Server Error: Error updating the categories.

Throws

  • An error if request validation or categories update fails.

Example cURL

curl --location --request PUT 'https://app.ai12z.net/api/projects/{projectId}/settings/categories' \
--header 'Authorization: Bearer <YOUR_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"id":"Category ID",
"category":"title",
"description":"content"
}'

DELETE: Delete a Categories

Description

This route is used to delete an existing Category ID.

Method

DELETE

Request Body

Example request body:

{
"id": "Category ID"
}

Response

  • Returns a confirmation message indicating successful deletion.

Status Codes

  • 200 OK: categories deleted successfully.
  • 500 Internal Server Error: Error deleting the categories.

Throws

  • An error if request validation or categories deletion fails.

Example cURL

curl --location --request DELETE 'https://app.ai12z.net/api/projects/{projectId}/settings/categories' \
--header 'Authorization: Bearer <YOUR_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": "Category ID"
}'