{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/esyurl-fyi/json-schema/esyurl-fyi-me-schema.json",
  "title": "Me",
  "x-generated": "2026-11-07",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/esyurl-fyi-openapi.json#/components/schemas/Me",
  "type": "object",
  "properties": {
    "principal": {
      "type": "object",
      "properties": {
        "tenantId": {
          "type": "string"
        },
        "subject": {
          "type": "string"
        },
        "method": {
          "type": "string",
          "enum": [
            "api_key",
            "jwt"
          ]
        },
        "scopes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "links:read",
              "links:write"
            ]
          }
        }
      }
    },
    "tenant": {
      "type": "object",
      "properties": {
        "tenantId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "suspended"
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "origin": {
          "type": "string",
          "enum": [
            "operator",
            "agent_signup"
          ],
          "description": "Absent means operator. agent_signup tenants pay for custom domains"
        },
        "linkLimit": {
          "type": "integer",
          "description": "Link quota; absent = unlimited"
        },
        "linkCount": {
          "type": "integer",
          "description": "Links held, for tenants with a linkLimit"
        },
        "ownerEmail": {
          "type": "string",
          "description": "Set when a human claimed a self-signed-up tenant"
        }
      }
    }
  }
}