Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/diarpicu2022-commits/backend-AgroPulse/llms.txt

Use this file to discover all available pages before exploring further.

The tickets API provides a lightweight issue-tracking layer inside AgroPulse. Operators can open tickets to report hardware faults, calibration problems, or any operational issue that requires follow-up. Each ticket is linked to the user who created it and moves through a defined lifecycle from OPEN to IN_PROGRESS to CLOSED. Priority levels help teams triage work across multiple greenhouses.

Status and priority values

Status
ValueMeaning
OPENNewly created, not yet assigned. Default on creation.
IN_PROGRESSBeing actively worked on.
CLOSEDResolved and no further action required.
Priority
ValueMeaning
LOWNon-urgent issue, can be addressed in normal workflow.
MEDIUMShould be addressed soon. Default on creation.
HIGHRequires prompt attention.

Endpoints

List all tickets

Retrieves every ticket in the system as a flat JSON array.
GET /api/tickets
Response Returns a JSON array of ticket objects (not wrapped in an envelope object).
[].id
number
required
Auto-generated primary key.
[].title
string
required
Short description of the issue.
[].description
string
Full details of the issue.
[].status
string
required
Current lifecycle state. One of OPEN, IN_PROGRESS, or CLOSED.
[].priority
string
required
Urgency level. One of LOW, MEDIUM, or HIGH.
[].userId
number
ID of the user who filed the ticket.
[].userName
string
Display name of the user who filed the ticket.
[].createdAt
string
required
ISO-8601 timestamp of when the ticket was created.
[].updatedAt
string
required
ISO-8601 timestamp of the last update to the ticket.
curl http://localhost:8080/api/tickets

Create a ticket

Opens a new support ticket.
POST /api/tickets
Request body
title
string
required
Short description of the issue.
description
string
Full details of the issue. Stored as free-form text with no length limit.
status
string
default:"OPEN"
Initial lifecycle state. Accepted values: OPEN, IN_PROGRESS, CLOSED.
priority
string
default:"MEDIUM"
Urgency level. Accepted values: LOW, MEDIUM, HIGH.
userId
number
ID of the user filing the ticket.
userName
string
Display name of the user filing the ticket.
curl -X POST http://localhost:8080/api/tickets \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Irrigation pump failure",
    "description": "Pump P-02 stopped responding after the power outage on June 14.",
    "priority": "HIGH",
    "userId": 5,
    "userName": "Ana Martínez"
  }'

Get a single ticket

Retrieves one ticket by its ID.
GET /api/tickets/{id}
Path parameters
id
number
required
The ID of the ticket to retrieve.
Returns the ticket object on success. Returns 404 Not Found if no ticket with that ID exists.
curl http://localhost:8080/api/tickets/13

Update a ticket

Performs a partial update on an existing ticket. Only fields included in the request body are changed; omitted fields retain their current values.
PUT /api/tickets/{id}
Path parameters
id
number
required
The ID of the ticket to update.
Request body
title
string
Updated short description.
description
string
Updated full details.
status
string
New lifecycle state. Accepted values: OPEN, IN_PROGRESS, CLOSED.
priority
string
New urgency level. Accepted values: LOW, MEDIUM, HIGH.
userId
number
Updated user ID.
userName
string
Updated user display name.
The updatedAt timestamp is set to the current server time automatically on every successful update.
curl -X PUT http://localhost:8080/api/tickets/13 \
  -H "Content-Type: application/json" \
  -d '{
    "status": "IN_PROGRESS"
  }'
Returns 404 Not Found if no ticket with the given ID exists.

Delete a ticket

Permanently removes a ticket record.
DELETE /api/tickets/{id}
Path parameters
id
number
required
The ID of the ticket to delete.
Returns { "deleted": true } on success. Returns 404 Not Found if the ticket does not exist.
curl -X DELETE http://localhost:8080/api/tickets/13

Build docs developers (and LLMs) love