{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/logbrew/json-schema/logbrew-action-page-response-schema.json",
  "title": "ActionPageResponse",
  "description": "Opt-in cursor page for native actions.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/logbrew-actions-api-openapi.yml#/components/schemas/ActionPageResponse",
  "properties": {
    "actions": {
      "description": "Action rows in newest-first order.",
      "items": {
        "$ref": "#/$defs/ActionResponse"
      },
      "type": "array"
    },
    "next_cursor": {
      "anyOf": [
        {
          "$ref": "#/$defs/ActionCursorResponse"
        },
        {
          "type": "null"
        }
      ],
      "description": "Exclusive continuation cursor when another page exists."
    }
  },
  "required": [
    "actions",
    "next_cursor"
  ],
  "type": "object",
  "$defs": {
    "ActionCursorResponse": {
      "description": "Exclusive continuation cursor for a native action page.",
      "properties": {
        "id": {
          "description": "ID of the final action in the page.",
          "format": "uuid",
          "type": "string"
        },
        "time": {
          "description": "Occurrence timestamp of the final action in the page.",
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "time",
        "id"
      ],
      "type": "object"
    },
    "ActionResponse": {
      "description": "An action returned to API clients.",
      "properties": {
        "distinct_id": {
          "description": "Stable actor identifier.",
          "type": "string"
        },
        "environment": {
          "description": "Deployment environment.",
          "type": "string"
        },
        "id": {
          "description": "Unique action identifier.",
          "format": "uuid",
          "type": "string"
        },
        "name": {
          "description": "Machine-safe action name.",
          "type": "string"
        },
        "next_action": {
          "$ref": "#/$defs/CorrelatedTelemetryNextActionResponse",
          "description": "Machine-readable next investigation action."
        },
        "occurred_at": {
          "description": "Action occurrence timestamp.",
          "format": "date-time",
          "type": "string"
        },
        "project_id": {
          "description": "Owning project ID.",
          "format": "uuid",
          "type": "string"
        },
        "properties": {
          "description": "Action properties."
        },
        "release": {
          "description": "Application release.",
          "type": "string"
        },
        "service_name": {
          "description": "Logical service name.",
          "type": "string"
        },
        "session_id": {
          "description": "Session identifier.",
          "type": [
            "string",
            "null"
          ]
        },
        "span_id": {
          "description": "Exact span identifier within the distributed trace.",
          "type": [
            "string",
            "null"
          ]
        },
        "trace_id": {
          "description": "Distributed trace identifier.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "project_id",
        "name",
        "distinct_id",
        "session_id",
        "occurred_at",
        "properties",
        "environment",
        "release",
        "service_name",
        "trace_id",
        "next_action"
      ],
      "type": "object"
    },
    "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"
        }
      ]
    }
  }
}