{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/logbrew/json-schema/logbrew-support-ticket-response-schema.json",
  "title": "SupportTicketResponse",
  "description": "Support ticket detail returned to authenticated clients.",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/logbrew-openapi.json#/components/schemas/SupportTicketResponse",
  "properties": {
    "account_id": {
      "description": "Authenticated account linked to the ticket, when visible.",
      "format": "uuid",
      "type": [
        "string",
        "null"
      ]
    },
    "category": {
      "$ref": "#/$defs/SupportTicketCategory",
      "description": "Stable ticket category."
    },
    "created_at": {
      "description": "Creation timestamp.",
      "format": "date-time",
      "type": "string"
    },
    "description": {
      "description": "Detailed user-facing description.",
      "type": "string"
    },
    "diagnostics": {
      "description": "Token-free structured diagnostics retained for this ticket."
    },
    "environment": {
      "description": "Environment involved in the issue, when known.",
      "type": [
        "string",
        "null"
      ]
    },
    "event_id": {
      "description": "Event identifier involved in the issue, when known.",
      "type": [
        "string",
        "null"
      ]
    },
    "framework": {
      "description": "Framework involved in the issue, when known.",
      "type": [
        "string",
        "null"
      ]
    },
    "investigation": {
      "$ref": "#/$defs/CorrelatedTelemetryNextActionResponse",
      "description": "Canonical telemetry investigation action derived from ticket correlation."
    },
    "next": {
      "description": "Display-safe next action.",
      "type": "string"
    },
    "next_action": {
      "$ref": "#/$defs/SupportTicketNextActionResponse",
      "description": "Stable machine-readable action for clients that should not parse `next`."
    },
    "organization_id": {
      "description": "Organization linked to the ticket, when available.",
      "format": "uuid",
      "type": [
        "string",
        "null"
      ]
    },
    "project_id": {
      "description": "Project linked to the ticket, when available.",
      "format": "uuid",
      "type": [
        "string",
        "null"
      ]
    },
    "release": {
      "description": "Release involved in the issue, when known.",
      "type": [
        "string",
        "null"
      ]
    },
    "routing": {
      "$ref": "#/$defs/SupportTicketRoute",
      "description": "Where the ticket goes next."
    },
    "runtime": {
      "description": "Runtime involved in the issue, when known.",
      "type": [
        "string",
        "null"
      ]
    },
    "sdk_package": {
      "description": "SDK package involved in the issue, when known.",
      "type": [
        "string",
        "null"
      ]
    },
    "sdk_version": {
      "description": "SDK version involved in the issue, when known.",
      "type": [
        "string",
        "null"
      ]
    },
    "source": {
      "$ref": "#/$defs/SupportTicketSource",
      "description": "Surface that collected the ticket."
    },
    "status": {
      "$ref": "#/$defs/SupportTicketStatus",
      "description": "Current status."
    },
    "ticket_id": {
      "description": "Stable support ticket identifier.",
      "type": "string"
    },
    "title": {
      "description": "Short user-facing summary.",
      "type": "string"
    },
    "trace_id": {
      "description": "Trace identifier involved in the issue, when known.",
      "type": [
        "string",
        "null"
      ]
    },
    "updated_at": {
      "description": "Most recent update timestamp.",
      "format": "date-time",
      "type": "string"
    }
  },
  "required": [
    "ticket_id",
    "account_id",
    "organization_id",
    "project_id",
    "source",
    "category",
    "status",
    "title",
    "description",
    "environment",
    "runtime",
    "framework",
    "sdk_package",
    "sdk_version",
    "release",
    "trace_id",
    "event_id",
    "diagnostics",
    "routing",
    "investigation",
    "created_at",
    "updated_at",
    "next",
    "next_action"
  ],
  "type": "object",
  "$defs": {
    "CorrelatedTelemetryNextActionCode": {
      "description": "Stable correlation-aware investigation action code.",
      "oneOf": [
        {
          "const": "inspect_trace",
          "description": "Inspect the correlated distributed trace.",
          "type": "string"
        },
        {
          "const": "inspect_related_logs",
          "description": "Inspect logs related by project, release, service, and environment.",
          "type": "string"
        }
      ]
    },
    "CorrelatedTelemetryNextActionResponse": {
      "description": "Correlation-aware next action shared by issues, logs, and product actions.",
      "properties": {
        "code": {
          "$ref": "#/$defs/CorrelatedTelemetryNextActionCode",
          "description": "Stable action code."
        },
        "target": {
          "$ref": "#/$defs/CorrelatedTelemetryNextActionTarget",
          "description": "Stable action target."
        }
      },
      "required": [
        "code",
        "target"
      ],
      "type": "object"
    },
    "CorrelatedTelemetryNextActionTarget": {
      "description": "Stable correlation-aware investigation target.",
      "oneOf": [
        {
          "const": "trace_summary",
          "description": "Privacy-safe trace summary endpoint.",
          "type": "string"
        },
        {
          "const": "telemetry_logs",
          "description": "Native telemetry logs endpoint.",
          "type": "string"
        }
      ]
    },
    "SupportTicketCategory": {
      "description": "Stable support ticket category vocabulary.",
      "oneOf": [
        {
          "const": "sdk_install_failure",
          "description": "SDK package installation, runtime, framework, logger, or transport issue.",
          "type": "string"
        },
        {
          "const": "ingest_failure",
          "description": "Ingest API, key, quota, or delivery failure.",
          "type": "string"
        },
        {
          "const": "auth_failure",
          "description": "Auth, OAuth, account session, or token failure.",
          "type": "string"
        },
        {
          "const": "project_setup",
          "description": "Project creation, setup, setup-seen, or setup visibility issue.",
          "type": "string"
        },
        {
          "const": "dashboard_issue",
          "description": "Website dashboard, settings, profile, or project UX issue.",
          "type": "string"
        },
        {
          "const": "docs_confusion",
          "description": "Docs, install guide, AI-agent instruction, or navigation confusion.",
          "type": "string"
        },
        {
          "const": "cli_issue",
          "description": "CLI command, auth, setup, diagnostics, or release-tooling issue.",
          "type": "string"
        },
        {
          "const": "mobile_issue",
          "description": "Mobile app project, error, support, or reporting issue.",
          "type": "string"
        },
        {
          "const": "billing_question",
          "description": "Billing, subscription, organization access, or quota plan question.",
          "type": "string"
        },
        {
          "const": "project_deletion",
          "description": "User-requested removal of one project and its live product data.",
          "type": "string"
        },
        {
          "const": "other",
          "description": "Other issue that still benefits from structured diagnostics.",
          "type": "string"
        }
      ]
    },
    "SupportTicketNextActionCode": {
      "description": "Stable support-ticket action code.",
      "oneOf": [
        {
          "const": "review_ticket",
          "description": "Review the newly created ticket.",
          "type": "string"
        },
        {
          "const": "review_tickets",
          "description": "Review the account's support tickets.",
          "type": "string"
        },
        {
          "const": "await_owner_update",
          "description": "Wait for support to update the ticket.",
          "type": "string"
        },
        {
          "const": "provide_context",
          "description": "Provide requested context for a ticket waiting on the user.",
          "type": "string"
        },
        {
          "const": "open_new_ticket_if_needed",
          "description": "Open a new ticket if a resolved or closed issue appears again.",
          "type": "string"
        }
      ]
    },
    "SupportTicketNextActionResponse": {
      "description": "Stable machine-readable support-ticket readiness action.",
      "properties": {
        "code": {
          "$ref": "#/$defs/SupportTicketNextActionCode",
          "description": "Stable action code."
        },
        "target": {
          "$ref": "#/$defs/SupportTicketNextActionTarget",
          "description": "Stable product surface the client should route to."
        }
      },
      "required": [
        "code",
        "target"
      ],
      "type": "object"
    },
    "SupportTicketNextActionTarget": {
      "description": "Stable support-ticket action target.",
      "oneOf": [
        {
          "const": "support",
          "description": "Support ticket list or creation surface.",
          "type": "string"
        },
        {
          "const": "support_ticket",
          "description": "One support-ticket detail surface.",
          "type": "string"
        }
      ]
    },
    "SupportTicketOwner": {
      "description": "Product area that handles a ticket next.",
      "oneOf": [
        {
          "const": "backend",
          "description": "The API, sign-in, ingestion, data, and ticket status.",
          "type": "string"
        },
        {
          "const": "sdk",
          "description": "SDK packages, runtimes, and frameworks.",
          "type": "string"
        },
        {
          "const": "cli",
          "description": "The command-line tool.",
          "type": "string"
        },
        {
          "const": "website",
          "description": "The website and dashboard.",
          "type": "string"
        },
        {
          "const": "docs",
          "description": "Documentation and agent instructions.",
          "type": "string"
        },
        {
          "const": "mobile",
          "description": "The mobile app.",
          "type": "string"
        }
      ]
    },
    "SupportTicketRoute": {
      "description": "Where a support ticket goes next.",
      "properties": {
        "expected_owner": {
          "$ref": "#/$defs/SupportTicketOwner",
          "description": "Product area that handles the ticket next."
        },
        "reason": {
          "description": "Display-safe routing reason.",
          "type": "string"
        },
        "requested_action": {
          "description": "Display-safe requested action for the owner.",
          "type": "string"
        }
      },
      "required": [
        "expected_owner",
        "reason",
        "requested_action"
      ],
      "type": "object"
    },
    "SupportTicketSource": {
      "description": "Surface that submitted a support ticket.",
      "oneOf": [
        {
          "const": "cli",
          "description": "Public CLI or a CLI-guided agent flow.",
          "type": "string"
        },
        {
          "const": "sdk",
          "description": "First-party SDK or SDK helper.",
          "type": "string"
        },
        {
          "const": "website",
          "description": "Website or dashboard.",
          "type": "string"
        },
        {
          "const": "docs",
          "description": "Public docs or docs-guided agent flow.",
          "type": "string"
        },
        {
          "const": "mobile",
          "description": "Private mobile app.",
          "type": "string"
        }
      ]
    },
    "SupportTicketStatus": {
      "description": "Support ticket lifecycle status.",
      "oneOf": [
        {
          "const": "open",
          "description": "Ticket has been accepted and awaits triage.",
          "type": "string"
        },
        {
          "const": "routed",
          "description": "Ticket has been routed to an owner.",
          "type": "string"
        },
        {
          "const": "in_progress",
          "description": "Ticket is under active investigation.",
          "type": "string"
        },
        {
          "const": "waiting_on_user",
          "description": "Support is waiting for more user context.",
          "type": "string"
        },
        {
          "const": "resolved",
          "description": "Ticket has been resolved.",
          "type": "string"
        },
        {
          "const": "closed",
          "description": "Ticket is closed and retained for audit/history.",
          "type": "string"
        }
      ]
    }
  }
}