{
  "openapi": "3.0.3",
  "info": {
    "title": "Nihonbase API",
    "description": "REST API for Japanese regions, prefectures, cities, public holidays (1955–2027), and Gregorian↔era (和暦) conversion (1868–2100, including 元年/gannen).\n\nBase URL: `https://api.nihonbase.com/api/v1`\n\nAuth: send `X-API-Key: jda_…` (preferred) or `Authorization: Bearer jda_…` (only when the token is your API key; Sanctum user tokens like `1|…` are not API keys).\n\n`/health` and `/plans` require no key and do not count against quota.",
    "version": "1.0.0",
    "contact": {
      "name": "Nihonbase",
      "email": "info@nihonzera.com",
      "url": "https://nihonbase.com/en"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://nihonbase.com/en/terms"
    }
  },
  "servers": [
    {
      "url": "https://api.nihonbase.com/api/v1",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Public",
      "description": "No API key required"
    },
    {
      "name": "Regions"
    },
    {
      "name": "Prefectures"
    },
    {
      "name": "Cities"
    },
    {
      "name": "Holidays"
    },
    {
      "name": "Era"
    },
    {
      "name": "Admin",
      "description": "Sanctum Bearer token for a user with `is_admin = true`. Not API-key authenticated."
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "API key starting with `jda_`"
      },
      "ApiKeyBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "jda_",
        "description": "Same API key as Bearer (not a Sanctum session token)"
      },
      "AdminSanctum": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Sanctum",
        "description": "Sanctum personal access token for an admin user (`is_admin = true`)"
      }
    },
    "schemas": {
      "ErrorBody": {
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "API_KEY_REQUIRED",
              "RESOURCE_NOT_FOUND",
              "VALIDATION_ERROR",
              "INVALID_ERA_INPUT"
            ],
            "description": "Machine-readable error code. HTTP 429 has no named code in docs."
          },
          "message": {
            "type": "string"
          }
        }
      },
      "EnvelopeError": {
        "type": "object",
        "required": [
          "success",
          "data",
          "meta",
          "error"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "data": {
            "nullable": true
          },
          "meta": {
            "type": "object",
            "additionalProperties": true
          },
          "error": {
            "$ref": "#/components/schemas/ErrorBody"
          }
        }
      },
      "PaginationMeta": {
        "type": "object",
        "properties": {
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "limit": {
            "type": "integer",
            "minimum": 1
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "Region": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string",
            "example": "kanto"
          }
        }
      },
      "Prefecture": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "name_ja": {
            "type": "string"
          },
          "name_en": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "iso_code": {
            "type": "string",
            "example": "JP-01"
          },
          "region_id": {
            "type": "integer"
          },
          "capital": {
            "type": "string"
          },
          "area_km2": {
            "type": "number"
          },
          "population": {
            "type": "integer"
          }
        }
      },
      "City": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "prefecture_id": {
            "type": "integer"
          }
        },
        "description": "City fields as exposed by the live API; confirm extra multilingual fields against a live key."
      },
      "Holiday": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date"
          },
          "name": {
            "type": "string"
          },
          "name_ja": {
            "type": "string"
          },
          "year": {
            "type": "integer"
          }
        },
        "description": "Holiday fields as documented; confirm exact keys against a live key."
      },
      "EraInfo": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "example": "reiwa"
          },
          "name_en": {
            "type": "string",
            "example": "Reiwa"
          },
          "name_ja": {
            "type": "string",
            "example": "令和"
          },
          "year": {
            "type": "integer",
            "example": 8
          },
          "gannen": {
            "type": "boolean"
          },
          "label_en": {
            "type": "string",
            "example": "Reiwa 8"
          },
          "label_ja": {
            "type": "string",
            "example": "令和8年"
          }
        }
      },
      "EraConversion": {
        "type": "object",
        "properties": {
          "gregorian_year": {
            "type": "integer"
          },
          "reference_date": {
            "type": "string",
            "format": "date"
          },
          "era": {
            "$ref": "#/components/schemas/EraInfo"
          }
        }
      },
      "Plan": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "requests_per_day": {
            "type": "integer"
          },
          "stripe_price_id": {
            "type": "string",
            "nullable": true
          },
          "requests_per_minute": {
            "type": "integer",
            "example": 10
          }
        }
      },
      "HealthData": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "example": "ok"
          },
          "service": {
            "type": "string",
            "example": "nihonbase"
          }
        }
      },
      "AdminPlanSummary": {
        "type": "object",
        "required": [
          "id",
          "name",
          "slug"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string",
            "example": "Basic"
          },
          "slug": {
            "type": "string",
            "example": "basic"
          }
        }
      },
      "AdminUserListItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "is_admin": {
            "type": "boolean"
          },
          "api_keys_count": {
            "type": "integer"
          },
          "is_subscriber": {
            "type": "boolean",
            "description": "True when the account has an active or trialing subscription (account-level, not only api_keys.plan_id)"
          },
          "plan": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/AdminPlanSummary"
              }
            ]
          },
          "subscription_status": {
            "type": "string",
            "nullable": true,
            "example": "active"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AdminSubscription": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "user_id": {
            "type": "integer",
            "nullable": true
          },
          "api_key_id": {
            "type": "integer",
            "nullable": true
          },
          "api_key_name": {
            "type": "string",
            "nullable": true
          },
          "user_email": {
            "type": "string",
            "nullable": true
          },
          "plan_id": {
            "type": "integer",
            "nullable": true
          },
          "plan": {
            "nullable": true,
            "description": "Resolved object (subscription plan_id, then stripe_price_id, then api key plan). Not a string.",
            "allOf": [
              {
                "$ref": "#/components/schemas/AdminPlanSummary"
              }
            ]
          },
          "status": {
            "type": "string",
            "example": "active"
          },
          "stripe_subscription_id": {
            "type": "string",
            "nullable": true
          },
          "stripe_customer_id": {
            "type": "string",
            "nullable": true
          },
          "current_period_start": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "current_period_end": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "cancel_at_period_end": {
            "type": "boolean"
          },
          "cancel_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "canceled_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "ended_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    },
    "parameters": {
      "page": {
        "name": "page",
        "in": "query",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "default": 1
        }
      },
      "limitPrefectures": {
        "name": "limit",
        "in": "query",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 200,
          "default": 50
        }
      },
      "limitCities": {
        "name": "limit",
        "in": "query",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 200
        }
      },
      "limitHolidays": {
        "name": "limit",
        "in": "query",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 366
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Missing or invalid API key",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/EnvelopeError"
            },
            "example": {
              "success": false,
              "data": null,
              "meta": [],
              "error": {
                "code": "API_KEY_REQUIRED",
                "message": "An API key is required. Send X-API-Key: jda_…, or Authorization: Bearer jda_… (only when the token is your API key; Sanctum user tokens look like 1|… and are not API keys)."
              }
            }
          }
        }
      },
      "NotFound": {
        "description": "Resource not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/EnvelopeError"
            }
          }
        }
      },
      "ValidationError": {
        "description": "Invalid request parameters",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/EnvelopeError"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "Over plan quota (HTTP 429)"
      }
    }
  },
  "paths": {
    "/health": {
      "get": {
        "tags": [
          "Public"
        ],
        "summary": "Health check",
        "operationId": "getHealth",
        "security": [],
        "responses": {
          "200": {
            "description": "Service is up",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "$ref": "#/components/schemas/HealthData"
                    },
                    "meta": {
                      "type": "array",
                      "items": {}
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "status": "ok",
                    "service": "nihonbase"
                  },
                  "meta": [],
                  "error": null
                }
              }
            }
          }
        }
      }
    },
    "/plans": {
      "get": {
        "tags": [
          "Public"
        ],
        "summary": "List pricing plans",
        "operationId": "listPlans",
        "security": [],
        "responses": {
          "200": {
            "description": "Current plans and daily request limits",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Plan"
                      }
                    },
                    "meta": {
                      "type": "array",
                      "items": {}
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": [
                    {
                      "id": 1,
                      "name": "Free",
                      "slug": "free",
                      "requests_per_day": 100,
                      "stripe_price_id": null,
                      "requests_per_minute": 10
                    },
                    {
                      "id": 2,
                      "name": "Basic",
                      "slug": "basic",
                      "requests_per_day": 5000,
                      "stripe_price_id": "price_…",
                      "requests_per_minute": 60
                    },
                    {
                      "id": 3,
                      "name": "Business",
                      "slug": "business",
                      "requests_per_day": 50000,
                      "stripe_price_id": "price_…",
                      "requests_per_minute": 300
                    }
                  ],
                  "meta": [],
                  "error": null
                }
              }
            }
          }
        }
      }
    },
    "/regions": {
      "get": {
        "tags": [
          "Regions"
        ],
        "summary": "List all regions",
        "description": "Returns id, name, slug. No query params.",
        "operationId": "listRegions",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "ApiKeyBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Regions list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Region"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/prefectures": {
      "get": {
        "tags": [
          "Prefectures"
        ],
        "summary": "List prefectures (paginated)",
        "operationId": "listPrefectures",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "ApiKeyBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/page"
          },
          {
            "$ref": "#/components/parameters/limitPrefectures"
          },
          {
            "name": "region",
            "in": "query",
            "description": "Region slug filter, e.g. kanto",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated prefectures",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Prefecture"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/PaginationMeta"
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/prefectures/{id}": {
      "get": {
        "tags": [
          "Prefectures"
        ],
        "summary": "Get a prefecture with its region",
        "operationId": "getPrefecture",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "ApiKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Prefecture detail"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/prefectures/{id}/cities": {
      "get": {
        "tags": [
          "Cities",
          "Prefectures"
        ],
        "summary": "Cities in a prefecture (paginated)",
        "operationId": "listPrefectureCities",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "ApiKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/page"
          },
          {
            "$ref": "#/components/parameters/limitCities"
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated cities"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/cities": {
      "get": {
        "tags": [
          "Cities"
        ],
        "summary": "List cities (paginated)",
        "operationId": "listCities",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "ApiKeyBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/page"
          },
          {
            "$ref": "#/components/parameters/limitCities"
          },
          {
            "name": "prefecture",
            "in": "query",
            "description": "Prefecture id or romaji name",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated cities"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/cities/{id}": {
      "get": {
        "tags": [
          "Cities"
        ],
        "summary": "Get a city with its prefecture and region",
        "operationId": "getCity",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "ApiKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "City detail"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/holidays": {
      "get": {
        "tags": [
          "Holidays"
        ],
        "summary": "List holidays (paginated)",
        "operationId": "listHolidays",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "ApiKeyBearer": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/page"
          },
          {
            "$ref": "#/components/parameters/limitHolidays"
          },
          {
            "name": "year",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1955,
              "maximum": 2027
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated holidays"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/holidays/{year}": {
      "get": {
        "tags": [
          "Holidays"
        ],
        "summary": "All holidays in a year",
        "description": "Years 1955–2027.",
        "operationId": "listHolidaysByYear",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "ApiKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1955,
              "maximum": 2027
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Holidays for the year"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/era": {
      "get": {
        "tags": [
          "Era"
        ],
        "summary": "Convert Gregorian date or year to Japanese era",
        "description": "Pass `date=YYYY-MM-DD` or `year=YYYY` (1868–2100). Year 1 of an era is 元年 in `label_ja` (`gannen: true`).",
        "operationId": "convertEra",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "ApiKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "example": "2026-03-01"
          },
          {
            "name": "year",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1868,
              "maximum": 2100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Era conversion",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "$ref": "#/components/schemas/EraConversion"
                    },
                    "meta": {
                      "type": "array",
                      "items": {}
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                },
                "example": {
                  "success": true,
                  "data": {
                    "gregorian_year": 2026,
                    "reference_date": "2026-03-01",
                    "era": {
                      "slug": "reiwa",
                      "name_en": "Reiwa",
                      "name_ja": "令和",
                      "year": 8,
                      "gannen": false,
                      "label_en": "Reiwa 8",
                      "label_ja": "令和8年"
                    }
                  },
                  "meta": [],
                  "error": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/era/{year}": {
      "get": {
        "tags": [
          "Era"
        ],
        "summary": "Era for a Gregorian year (Jan 1, Asia/Tokyo)",
        "operationId": "getEraByYear",
        "security": [
          {
            "ApiKeyHeader": []
          },
          {
            "ApiKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1868,
              "maximum": 2100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Era for that year"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/admin/users": {
      "get": {
        "tags": [
          "Admin"
        ],
        "summary": "List users",
        "operationId": "adminListUsers",
        "security": [
          {
            "AdminSanctum": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/page"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "is_admin",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "name",
            "in": "query",
            "description": "Case-insensitive partial match on name",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "query",
            "description": "Case-insensitive partial match on email",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Case-insensitive partial match on name or email",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subscriber",
            "in": "query",
            "description": "`1` = accounts with an active or trialing subscription; `0` = everyone else",
            "schema": {
              "type": "string",
              "enum": [
                "1",
                "0"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated users",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AdminUserListItem"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/PaginationMeta"
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/admin/subscriptions": {
      "get": {
        "tags": [
          "Admin"
        ],
        "summary": "List subscriptions",
        "operationId": "adminListSubscriptions",
        "security": [
          {
            "AdminSanctum": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/page"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated subscriptions. `plan` is an object `{id, name, slug}` or null — never a string.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AdminSubscription"
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/PaginationMeta"
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/admin/subscriptions/{id}": {
      "get": {
        "tags": [
          "Admin"
        ],
        "summary": "Show a subscription",
        "operationId": "adminShowSubscription",
        "security": [
          {
            "AdminSanctum": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Subscription. `plan` is `{id, name, slug}` or null.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "data": {
                      "$ref": "#/components/schemas/AdminSubscription"
                    },
                    "meta": {
                      "type": "object"
                    },
                    "error": {
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    }
  }
}
