{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/grafomem-com/json-schema/grafomem-com-dashboard-response-schema.json",
  "title": "DashboardResponse",
  "description": "Aggregated dashboard data returned by ``GET /v1/portal/me``.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/grafomem-com-portal-api-openapi.yml#/components/schemas/DashboardResponse",
  "properties": {
    "tenant_id": {
      "type": "string",
      "title": "Tenant Id"
    },
    "name": {
      "type": "string",
      "title": "Name"
    },
    "email": {
      "type": "string",
      "title": "Email"
    },
    "keys": {
      "items": {
        "$ref": "#/$defs/ApiKeyMeta"
      },
      "type": "array",
      "title": "Keys"
    },
    "plan": {
      "type": "string",
      "title": "Plan"
    },
    "timezone": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Timezone"
    },
    "usage": {
      "$ref": "#/$defs/UsageSummaryOut"
    },
    "compliance": {
      "anyOf": [
        {
          "$ref": "#/$defs/ComplianceOut"
        },
        {
          "type": "null"
        }
      ]
    },
    "billing": {
      "anyOf": [
        {
          "$ref": "#/$defs/BillingOut"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "type": "object",
  "required": [
    "tenant_id",
    "name",
    "email",
    "plan",
    "usage"
  ],
  "$defs": {
    "ApiKeyMeta": {
      "properties": {
        "key_id": {
          "type": "string",
          "title": "Key Id"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Name"
        },
        "role": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Role"
        },
        "scopes": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Scopes"
        },
        "created_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Created At"
        },
        "last_used_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Last Used At"
        },
        "expires_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Expires At"
        }
      },
      "type": "object",
      "required": [
        "key_id"
      ],
      "title": "ApiKeyMeta",
      "description": "Non-secret metadata for one tenant_api_keys row — NEVER the key itself.\n014 step (a): the console lists keys by metadata; the full key is shown only at\nmint/rotate (the create/rotate response bodies), never on /me."
    },
    "BillingOut": {
      "properties": {
        "plan": {
          "type": "string",
          "title": "Plan",
          "default": "starter"
        },
        "status": {
          "type": "string",
          "title": "Status",
          "default": "active"
        },
        "current_period_end": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Current Period End"
        }
      },
      "type": "object",
      "title": "BillingOut",
      "description": "Current billing / subscription status."
    },
    "ComplianceOut": {
      "properties": {
        "conformance_rate": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Conformance Rate"
        },
        "capabilities": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Capabilities"
        },
        "audited_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Audited At"
        }
      },
      "type": "object",
      "title": "ComplianceOut",
      "description": "Latest conformance snapshot."
    },
    "UsageSummaryOut": {
      "properties": {
        "writes": {
          "type": "integer",
          "title": "Writes",
          "default": 0
        },
        "reads": {
          "type": "integer",
          "title": "Reads",
          "default": 0
        },
        "deletes": {
          "type": "integer",
          "title": "Deletes",
          "default": 0
        },
        "supersedes": {
          "type": "integer",
          "title": "Supersedes",
          "default": 0
        },
        "total_bytes": {
          "type": "integer",
          "title": "Total Bytes",
          "default": 0
        },
        "total_operations": {
          "type": "integer",
          "title": "Total Operations",
          "default": 0
        }
      },
      "type": "object",
      "title": "UsageSummaryOut",
      "description": "Usage stats for the dashboard."
    }
  }
}