{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/gunspec-io/json-schema/gunspec-io-support-ticket-schema.json",
  "title": "SupportTicket",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/gunspec-io-account-api-openapi.yml#/components/schemas/SupportTicket",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Opaque ticket id."
    },
    "subject": {
      "type": "string",
      "description": "One-line summary of the issue."
    },
    "description": {
      "type": "string",
      "description": "Prose summary of the record, where one has been written."
    },
    "status": {
      "$ref": "#/$defs/TicketStatus"
    },
    "priority": {
      "$ref": "#/$defs/TicketPriority"
    },
    "category": {
      "type": [
        "string",
        "null"
      ],
      "description": "What the ticket is about: `billing`, `technical`, `data_quality`, `feature_request`, `other`."
    },
    "reply_count": {
      "type": "integer",
      "description": "How many replies the thread holds."
    },
    "created_at": {
      "type": "string",
      "description": "When the ticket was opened, ISO 8601."
    },
    "updated_at": {
      "type": "string",
      "description": "When the ticket last changed, ISO 8601."
    },
    "closed_at": {
      "type": [
        "string",
        "null"
      ],
      "description": "When it was closed, or null while it is open."
    }
  },
  "required": [
    "id",
    "subject",
    "status",
    "priority"
  ],
  "$defs": {
    "TicketPriority": {
      "type": "string",
      "enum": [
        "low",
        "normal",
        "high",
        "urgent"
      ],
      "description": "Support ticket priority."
    },
    "TicketStatus": {
      "type": "string",
      "enum": [
        "open",
        "in_progress",
        "waiting",
        "resolved",
        "closed"
      ],
      "description": "Lifecycle of a support ticket. `waiting` means we are waiting on the customer."
    }
  }
}