Skip to main content

Logs API Documentation

GET: Retrieve Logs

Description

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

Method

GET

Query Parameters

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

Response

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

Status Codes

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

Throws

  • An error if request validation or logs retrieval fails.

Example cURL

curl --location 'https://app.ai12z.net/api/projects/{projectId}/logs' \
--header 'Authorization: Bearer <YOUR_KEY>' \
--data-urlencode 'sort=name' \
--data-urlencode 'page=1' \
--data-urlencode 'limit=10'

GET: Retrieve Logs by ID

Description

This route is used to retrieve details of a specific logs by its ID.

Method

GET

URL Parameters

  • id (string): The ID of the logs to retrieve.

Response

  • Returns a JSON response with logs details such as id, module and messageHtml.

Status Codes

  • 200 OK: Logs retrieved successfully.
  • 500 Internal Server Error:Error retrieving the Logs.

Throws

  • An error if the logs is not found or any other error occurs.

Example cURL

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

DELETE: Delete a Logs

Description

This route is used to delete an existing logs.

Method

DELETE

Request Body

Example request body:

{
"id": "Log ID"
}

Response

  • Returns a confirmation message indicating successful deletion.

Status Codes

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

Throws

  • An error if request validation or Logs deletion fails.

Example cURL

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