Skip to content

API Contract

Base URL: http://localhost:8080

Returns service health.

Success:

{"status": "ok"}

Creates a ticket.

Headers:

  • Content-Type: application/json
  • X-User-Id: <user id>
  • Idempotency-Key: <optional key>

Request:

{
"title": "Login broken",
"description": "Cannot access account"
}

Success: 201 Created

Errors:

  • 400 when title or description is missing.

Lists tickets.

Success: 200 OK

Reads one ticket with comments and drafts.

Success: 200 OK

Errors:

  • 404 when ticket does not exist.

Adds a comment.

Request:

{"body": "Asked user for screenshot"}

Success: 201 Created

Errors:

  • 400 when body is missing.
  • 404 when ticket does not exist.

Creates a simulated draft response for human approval.

Success: 201 Created

Errors:

  • 404 when ticket does not exist.

Approves and marks a draft as sent.

Headers:

  • X-User-Id: <approver id>
  • X-User-Role: agent

Success: 200 OK

Errors:

  • 403 when caller is not an agent.
  • 404 when draft does not exist.

Lists audit events.

Success: 200 OK