API Contract
Base URL: http://localhost:8080
GET /health
Section titled “GET /health”Returns service health.
Success:
{"status": "ok"}POST /tickets
Section titled “POST /tickets”Creates a ticket.
Headers:
Content-Type: application/jsonX-User-Id: <user id>Idempotency-Key: <optional key>
Request:
{ "title": "Login broken", "description": "Cannot access account"}Success: 201 Created
Errors:
400when title or description is missing.
GET /tickets
Section titled “GET /tickets”Lists tickets.
Success: 200 OK
GET /tickets/{id}
Section titled “GET /tickets/{id}”Reads one ticket with comments and drafts.
Success: 200 OK
Errors:
404when ticket does not exist.
POST /tickets/{id}/comments
Section titled “POST /tickets/{id}/comments”Adds a comment.
Request:
{"body": "Asked user for screenshot"}Success: 201 Created
Errors:
400when body is missing.404when ticket does not exist.
POST /tickets/{id}/draft
Section titled “POST /tickets/{id}/draft”Creates a simulated draft response for human approval.
Success: 201 Created
Errors:
404when ticket does not exist.
POST /drafts/{id}/approve
Section titled “POST /drafts/{id}/approve”Approves and marks a draft as sent.
Headers:
X-User-Id: <approver id>X-User-Role: agent
Success: 200 OK
Errors:
403when caller is not an agent.404when draft does not exist.
GET /audit-events
Section titled “GET /audit-events”Lists audit events.
Success: 200 OK