{
  "openapi": "3.1.0",
  "info": {
    "title": "gitwall",
    "version": "0.1.0",
    "summary": "Embeddable GitHub activity widgets and team leaderboards.",
    "description": "A widget is a URL on /w; embedding it is an iframe. Public GET endpoints return snippets, contribution data and appearance discovery. Account-authorized endpoints create, update and delete hosted widgets. Widget JSON supports nested team color tokens and flat streak appearance fields."
  },
  "servers": [{ "url": "https://gitwall.io" }],
  "paths": {
    "/w": {
      "get": {
        "operationId": "renderWidget",
        "summary": "Render a contribution-graph widget (HTML page meant to be framed)",
        "parameters": [{ "$ref": "#/components/parameters/WidgetParams" }, {"$ref":"#/components/parameters/StreakMode"}, {"$ref":"#/components/parameters/FxPalette"}, {"$ref":"#/components/parameters/FxMix"}, {"$ref":"#/components/parameters/FxDirection"}, {"$ref":"#/components/parameters/FxSpeed"}, {"$ref":"#/components/parameters/FxSpread"}, {"$ref":"#/components/parameters/FxColor"}, {"$ref":"#/components/parameters/FxGlint"}, {"$ref":"#/components/parameters/FxSpark"}],
        "responses": { "200": { "description": "HTML", "content": { "text/html": {} } }, "400": { "description": "Missing or invalid user" }, "404": { "description": "GitHub user not found" } }
      }
    },
    "/t": {"get":{"operationId":"renderOrganizationWall","summary":"Render the installed organization wall","description":"Requires the signed wall token obtained by the GitHub App installation. Supports the same streak appearance options as /w.","parameters":[{"name":"k","in":"query","required":true,"schema":{"type":"string"},"description":"Signed wall token. Keep private."},{"name":"fx","in":"query","schema":{"type":"string","enum":["0","1"],"default":"1"}},{"$ref":"#/components/parameters/StreakMode"}, {"$ref":"#/components/parameters/FxPalette"},{"$ref":"#/components/parameters/FxMix"},{"$ref":"#/components/parameters/FxDirection"},{"$ref":"#/components/parameters/FxSpeed"},{"$ref":"#/components/parameters/FxSpread"},{"$ref":"#/components/parameters/FxColor"},{"$ref":"#/components/parameters/FxGlint"},{"$ref":"#/components/parameters/FxSpark"}],"responses":{"200":{"description":"HTML","content":{"text/html":{}}},"403":{"description":"Invalid wall token"}}}},
    "/team": {
      "get": {
        "operationId": "renderLeaderboard",
        "summary": "Render a team leaderboard (HTML page meant to be framed)",
        "parameters": [
          {"$ref":"#/components/parameters/StreakMode"},
          { "name": "users", "in": "query", "required": true, "schema": { "type": "string" }, "description": "Comma-separated GitHub logins (max 50)" },
          { "name": "repos", "in": "query", "schema": { "type": "string" }, "description": "Comma-separated owner/repo for lines-of-code stats (max 20)" },
          { "name": "months", "in": "query", "schema": { "type": "integer", "enum": [3, 6, 12], "default": 12 } },
          { "name": "theme", "in": "query", "schema": { "$ref": "#/components/schemas/ThemeId" } },
          { "name": "brand", "in": "query", "schema": { "$ref": "#/components/schemas/Hex" } },
          { "name": "tv", "in": "query", "schema": { "type": "boolean", "default": false } }
        ],
        "responses": { "200": { "description": "HTML", "content": { "text/html": {} } } }
      }
    },
    "/api/v1/widget/snippet": {
      "get": {
        "operationId": "getWidgetSnippet",
        "summary": "Get the iframe snippet and canonical URL for a widget",
        "parameters": [
          { "$ref": "#/components/parameters/WidgetParams" },
          {"$ref":"#/components/parameters/StreakMode"}, {"$ref":"#/components/parameters/FxPalette"},
          {"$ref":"#/components/parameters/FxMix"},
          {"$ref":"#/components/parameters/FxDirection"},
          {"$ref":"#/components/parameters/FxSpeed"},
          {"$ref":"#/components/parameters/FxSpread"},
          {"$ref":"#/components/parameters/FxColor"},
          {"$ref":"#/components/parameters/FxGlint"},
          {"$ref":"#/components/parameters/FxSpark"},
          { "name": "width", "in": "query", "schema": { "type": "integer", "default": 800 }, "description": "Target width in CSS px, used to size the fixed-height iframe" }
        ],
        "responses": {
          "200": {
            "description": "Snippet",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": { "type": "string", "format": "uri" },
                    "width": { "type": "integer" },
                    "height": { "type": "integer" },
                    "iframe": { "type": "string", "description": "Fixed-height <iframe> HTML. Loads eagerly; do not add loading=\"lazy\" (WebKit drops history.state in lazy iframes)" },
                    "iframeAutoResize": { "type": "string", "description": "<iframe> plus a small script that resizes it to content. Loads eagerly, like iframe" },
                    "config": { "$ref": "#/components/schemas/WidgetConfig" }
                  },
                  "required": ["url", "width", "height", "iframe", "iframeAutoResize", "config"]
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/appearance": {"get":{"operationId":"getAppearance","summary":"Discover streak appearance recipes, palettes, defaults, ranges and examples","description":"Public, no key required. These flat fields work in /w, /t, widget JSON and MCP get_snippet/create_widget/update_widget. Numeric URL values are clamped to the published ranges; invalid values fall back to defaults. JSON PATCH null resets a field or clears an optional color. presets contains full appearance recipes; palettes contains color-only choices. For creation use config; for existing widgets use patch to clear the relevant previous overrides. Recipe IDs label discovery entries and are not URL parameters.","responses":{"200":{"description":"Appearance options","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppearanceDiscovery"}}}}}}},
    "/api/v1/plans": {
      "get": {
        "operationId": "listPlans",
        "summary": "Machine-readable pricing and entitlements",
        "responses": { "200": { "description": "Plans", "content": { "application/json": {} } } }
      }
    },
    "/api/v1/widgets": {
      "get": {
        "operationId": "listWidgets",
        "summary": "List the caller's hosted widgets",
        "security": [{ "apiKey": [] }],
        "responses": { "200": { "description": "Widgets", "content": { "application/json": { "schema": { "type": "object", "properties": { "widgets": { "type": "array", "items": { "$ref": "#/components/schemas/HostedWidget" } } } } } } }, "401": { "$ref": "#/components/responses/Error" } }
      },
      "post": {
        "operationId": "createWidget",
        "summary": "Create a hosted widget whose config can be changed later without editing the site",
        "security": [{ "apiKey": [] }],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  { "$ref": "#/components/schemas/WidgetConfig" },
                  { "type": "object", "properties": { "badge": { "type": "boolean", "default": true, "description": "false requires the Pro plan" }, "allowedDomains": { "type": "array", "items": { "type": "string" }, "maxItems": 10 } } }
                ]
              }
            }
          }
        },
        "responses": { "201": { "description": "Created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HostedWidget" } } } }, "400": { "$ref": "#/components/responses/Error" }, "401": { "$ref": "#/components/responses/Error" }, "402": { "$ref": "#/components/responses/Error" } }
      }
    },
    "/api/v1/widgets/{id}": {
      "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }],
      "get": { "operationId": "getWidget", "security": [{ "apiKey": [] }], "responses": { "200": { "description": "Widget", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HostedWidget" } } } }, "404": { "$ref": "#/components/responses/Error" } } },
      "patch": { "operationId": "updateWidget", "summary": "Update any config field, badge or allowed domains", "security": [{ "apiKey": [] }], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WidgetPatch" } } } }, "responses": { "200": { "description": "Updated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/HostedWidget" } } } }, "402": { "$ref": "#/components/responses/Error" }, "404": { "$ref": "#/components/responses/Error" } } },
      "delete": { "operationId": "deleteWidget", "security": [{ "apiKey": [] }], "responses": { "204": { "description": "Deleted" }, "404": { "$ref": "#/components/responses/Error" } } }
    },
    "/api/v1/contributions/{user}": {
      "get": {
        "operationId": "getContributions",
        "summary": "Daily contribution counts with a summary",
        "parameters": [
          {"$ref":"#/components/parameters/StreakMode"},
          { "name": "user", "in": "path", "required": true, "schema": { "type": "string" } },
          { "name": "months", "in": "query", "schema": { "type": "integer", "enum": [3, 6, 12], "default": 12 } }
        ],
        "responses": {
          "200": {
            "description": "Contributions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user": { "type": "string" },
                    "from": { "type": "string", "format": "date" },
                    "to": { "type": "string", "format": "date" },
                    "months": { "type": "integer" },
                    "total": { "type": "integer" },
                    "source": { "type": "string", "enum": ["graphql", "public"] },
                    "streak": { "type": "object", "description": "Current streak over the user's whole history, not just the window", "properties": { "days": { "type": "integer" }, "start": { "type": ["string", "null"], "format": "date" } } },
                    "days": { "type": "array", "items": { "type": "object", "properties": { "date": { "type": "string", "format": "date" }, "count": { "type": "integer" } } } },
                    "repos": { "type": "array", "description": "Commits per public repository. Filled only for the account the server's GitHub token belongs to; private repositories are never listed.", "items": { "type": "object", "properties": { "name": { "type": "string" }, "url": { "type": "string" }, "commits": { "type": "integer" }, "language": { "type": ["string", "null"] }, "isPrivate": { "type": "boolean" } } } },
                    "summary": {
                      "type": "object",
                      "properties": {
                        "total": { "type": "integer" },
                        "activeDays": { "type": "integer" },
                        "streakUnit": {"type":"string","enum":["day","week"]},
                        "currentStreakStart": {"type":["string","null"],"format":"date"},
                        "currentStreakEnd": {"type":["string","null"],"format":"date"},
                        "longestStreakStart": {"type":["string","null"],"format":"date"},
                        "longestStreakEnd": {"type":["string","null"],"format":"date"},
                        "currentStreak": { "type": "integer", "description": "In daily mode counted over full history, like streak.days; weekly streaks count within the window" },
                        "longestStreak": { "type": "integer", "description": "Longest within the window; in daily mode raised to the current streak when that runs past it" },
                        "peak": { "type": ["object", "null"], "properties": { "date": { "type": "string" }, "count": { "type": "integer" } } }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": { "description": "GitHub user not found" }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": { "type": "http", "scheme": "bearer", "description": "API key from https://gitwall.io/dashboard, e.g. gw_live_…" }
    },
    "responses": {
      "Error": {
        "description": "Error with a next step",
        "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" }, "hint": { "type": "string", "description": "What to do next (a URL to hand to a human, a plan to buy, a field to fix)" } }, "required": ["message"] } } }
      }
    },
    "parameters": {
      "StreakMode": {"name":"streakMode","in":"query","schema":{"$ref":"#/components/schemas/StreakMode"}},
      "FxPalette": {"name":"fxPalette","in":"query","schema":{"type":"string","enum":["ultracode","theme","ocean","ember","custom"],"default":"ultracode","description":"Streak palette: UltraCode violet, current theme, ocean, ember, or custom colors."}},
      "FxMix": {"name":"fxMix","in":"query","schema":{"type":"number","minimum":0,"maximum":1,"default":0.2,"description":"How strongly the streak palette colors the contribution cells: 0 keeps their theme colors, 1 uses the full streak palette."}},
      "FxDirection": {"name":"fxDirection","in":"query","schema":{"type":"string","enum":["rtl","ltr"],"default":"rtl","description":"Travel direction of the glints: rtl moves from today into the past; ltr moves toward today."}},
      "FxSpeed": {"name":"fxSpeed","in":"query","schema":{"type":"number","minimum":2,"maximum":20,"default":10,"description":"Glint speed in calendar columns per second."}},
      "FxSpread": {"name":"fxSpread","in":"query","schema":{"type":"number","minimum":0,"maximum":1,"default":1,"description":"How far the glints are scattered across weekday rows: 0 aligns the rows, 1 fully disperses them."}},
      "FxColor": {"name":"fxColor","in":"query","schema":{"type":"string","pattern":"^#?[0-9a-fA-F]{6}$","description":"Optional streak body color, as six-digit RGB hex. Omit for the selected palette; PATCH null clears an override."}},
      "FxGlint": {"name":"fxGlint","in":"query","schema":{"type":"string","pattern":"^#?[0-9a-fA-F]{6}$","description":"Optional glint highlight color, as six-digit RGB hex. Omit for the selected palette; PATCH null clears an override."}},
      "FxSpark": {"name":"fxSpark","in":"query","schema":{"type":"string","pattern":"^#?[0-9a-fA-F]{6}$","description":"Optional spark color, as six-digit RGB hex. Omit for the selected palette; PATCH null clears an override."}},
      "WidgetParams": {
        "name": "user",
        "in": "query",
        "required": true,
        "schema": { "type": "string" },
        "description": "GitHub login. Other optional query params: months (3|6|12), theme (ThemeId), brand (Hex), bg, text, textDim, line, bgElev, accent (Hex), ramp (5 comma-separated Hex), title (string), stats/labels/legend/tooltips/fx/tv (1|0). Streak options: fxPalette (ultracode|theme|ocean|ember|custom), fxMix (0..1, default 0.2), fxDirection (rtl|ltr), fxSpeed (2..20 calendar columns/second, default 10), fxSpread (0..1, default 1), fxColor/fxGlint/fxSpark (six-digit hex). GET /api/v1/appearance lists presets and defaults."
      }
    },
    "schemas": {
      "StreakMode": {"type":"string","enum":["daily","weekly"],"default":"daily","description":"daily counts consecutive contribution days. weekly counts consecutive Monday–Sunday weeks with contributions on at least five distinct days. The current week may qualify early; until it ends, it does not break an existing streak. Uses the dates in the contribution calendar."},
      "Hex": { "type": "string", "pattern": "^#?[0-9a-fA-F]{6}$", "description": "RGB hex, # optional" },
      "ThemeId": { "type": "string", "enum": ["github-dark", "github-light", "tethered", "tethered-light", "mono-dark"] },
      "WidgetConfigPatch": {"type":"object","properties":{"streakMode":{"$ref":"#/components/schemas/StreakMode"},"user":{"type":"string"},"months":{"type":"integer","enum":[3,6,12]},"theme":{"$ref":"#/components/schemas/ThemeId"},"colors":{"type":["object","null"],"description":"Partial theme colors merge key by key; null clears all saved heatmap overrides. MCP accepts the same valid color object or null for update_widget.","properties":{"brand":{"anyOf":[{"$ref":"#/components/schemas/Hex"},{"type":"null"}]},"bg":{"anyOf":[{"$ref":"#/components/schemas/Hex"},{"type":"null"}]},"bgElev":{"anyOf":[{"$ref":"#/components/schemas/Hex"},{"type":"null"}]},"line":{"anyOf":[{"$ref":"#/components/schemas/Hex"},{"type":"null"}]},"text":{"anyOf":[{"$ref":"#/components/schemas/Hex"},{"type":"null"}]},"textDim":{"anyOf":[{"$ref":"#/components/schemas/Hex"},{"type":"null"}]},"accent":{"anyOf":[{"$ref":"#/components/schemas/Hex"},{"type":"null"}]},"ramp":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/Hex"},"minItems":5,"maxItems":5},{"type":"null"}]}},"additionalProperties":false},"title":{"type":"string"},"stats":{"type":"boolean"},"labels":{"type":"boolean"},"legend":{"type":"boolean"},"tooltips":{"type":"boolean"},"fx":{"type":"boolean","default":true,"description":"UltraCode-style glimmer for 3+ consecutive days or an active five-day weekly streak; false keeps the original heatmap"},"tv":{"type":"boolean"},"fxPalette":{"type":["string","null"],"enum":["ultracode","theme","ocean","ember","custom",null],"default":"ultracode","description":"Streak palette: UltraCode violet, current theme, ocean, ember, or custom colors."},"fxMix":{"type":["number","null"],"minimum":0,"maximum":1,"default":0.2,"description":"How strongly the streak palette colors the contribution cells: 0 keeps their theme colors, 1 uses the full streak palette."},"fxDirection":{"type":["string","null"],"enum":["rtl","ltr",null],"default":"rtl","description":"Travel direction of the glints: rtl moves from today into the past; ltr moves toward today."},"fxSpeed":{"type":["number","null"],"minimum":2,"maximum":20,"default":10,"description":"Glint speed in calendar columns per second."},"fxSpread":{"type":["number","null"],"minimum":0,"maximum":1,"default":1,"description":"How far the glints are scattered across weekday rows: 0 aligns the rows, 1 fully disperses them."},"fxColor":{"type":["string","null"],"pattern":"^#?[0-9a-fA-F]{6}$","description":"Optional streak body color, as six-digit RGB hex. Omit for the selected palette; PATCH null clears an override."},"fxGlint":{"type":["string","null"],"pattern":"^#?[0-9a-fA-F]{6}$","description":"Optional glint highlight color, as six-digit RGB hex. Omit for the selected palette; PATCH null clears an override."},"fxSpark":{"type":["string","null"],"pattern":"^#?[0-9a-fA-F]{6}$","description":"Optional spark color, as six-digit RGB hex. Omit for the selected palette; PATCH null clears an override."}},"description":"All fields optional. Omitted fields keep their saved values. null resets appearance values or clears color overrides. Nested theme colors merge key by key."},
      "WidgetPatch": {"type":"object","properties":{"streakMode":{"$ref":"#/components/schemas/StreakMode"},"user":{"type":"string"},"months":{"type":"integer","enum":[3,6,12]},"theme":{"$ref":"#/components/schemas/ThemeId"},"colors":{"type":["object","null"],"description":"Partial theme colors merge key by key; null clears all saved heatmap overrides. MCP accepts the same valid color object or null for update_widget.","properties":{"brand":{"anyOf":[{"$ref":"#/components/schemas/Hex"},{"type":"null"}]},"bg":{"anyOf":[{"$ref":"#/components/schemas/Hex"},{"type":"null"}]},"bgElev":{"anyOf":[{"$ref":"#/components/schemas/Hex"},{"type":"null"}]},"line":{"anyOf":[{"$ref":"#/components/schemas/Hex"},{"type":"null"}]},"text":{"anyOf":[{"$ref":"#/components/schemas/Hex"},{"type":"null"}]},"textDim":{"anyOf":[{"$ref":"#/components/schemas/Hex"},{"type":"null"}]},"accent":{"anyOf":[{"$ref":"#/components/schemas/Hex"},{"type":"null"}]},"ramp":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/Hex"},"minItems":5,"maxItems":5},{"type":"null"}]}},"additionalProperties":false},"title":{"type":"string"},"stats":{"type":"boolean"},"labels":{"type":"boolean"},"legend":{"type":"boolean"},"tooltips":{"type":"boolean"},"fx":{"type":"boolean","default":true,"description":"UltraCode-style glimmer for 3+ consecutive days or an active five-day weekly streak; false keeps the original heatmap"},"tv":{"type":"boolean"},"fxPalette":{"type":["string","null"],"enum":["ultracode","theme","ocean","ember","custom",null],"default":"ultracode","description":"Streak palette: UltraCode violet, current theme, ocean, ember, or custom colors."},"fxMix":{"type":["number","null"],"minimum":0,"maximum":1,"default":0.2,"description":"How strongly the streak palette colors the contribution cells: 0 keeps their theme colors, 1 uses the full streak palette."},"fxDirection":{"type":["string","null"],"enum":["rtl","ltr",null],"default":"rtl","description":"Travel direction of the glints: rtl moves from today into the past; ltr moves toward today."},"fxSpeed":{"type":["number","null"],"minimum":2,"maximum":20,"default":10,"description":"Glint speed in calendar columns per second."},"fxSpread":{"type":["number","null"],"minimum":0,"maximum":1,"default":1,"description":"How far the glints are scattered across weekday rows: 0 aligns the rows, 1 fully disperses them."},"fxColor":{"type":["string","null"],"pattern":"^#?[0-9a-fA-F]{6}$","description":"Optional streak body color, as six-digit RGB hex. Omit for the selected palette; PATCH null clears an override."},"fxGlint":{"type":["string","null"],"pattern":"^#?[0-9a-fA-F]{6}$","description":"Optional glint highlight color, as six-digit RGB hex. Omit for the selected palette; PATCH null clears an override."},"fxSpark":{"type":["string","null"],"pattern":"^#?[0-9a-fA-F]{6}$","description":"Optional spark color, as six-digit RGB hex. Omit for the selected palette; PATCH null clears an override."},"config":{"$ref":"#/components/schemas/WidgetConfigPatch"},"badge":{"type":"boolean"},"allowedDomains":{"type":"array","items":{"type":"string"},"maxItems":10}},"description":"Supply config fields directly, or inside config. An appearance-only PATCH is supported."},
      "ThemeColors": {"type":"object","description":"Partial Gitwall team color tokens. All keys are optional; omitted tokens retain their saved values on an update.","properties":{"brand":{"$ref":"#/components/schemas/Hex"},"bg":{"$ref":"#/components/schemas/Hex"},"bgElev":{"$ref":"#/components/schemas/Hex"},"line":{"$ref":"#/components/schemas/Hex"},"text":{"$ref":"#/components/schemas/Hex"},"textDim":{"$ref":"#/components/schemas/Hex"},"accent":{"$ref":"#/components/schemas/Hex"},"ramp":{"type":"array","items":{"$ref":"#/components/schemas/Hex"},"minItems":5,"maxItems":5}},"additionalProperties":false},
      "DesignTokens": {"type":"object","description":"Portable Gitwall JSON export: resolved colors plus appearance settings, with no user/content fields. The configurator also accepts flat color tokens. Imports require at least one known color, reject any invalid known value atomically, preserve omitted appearance settings and ignore unknown metadata.","properties":{"colors":{"$ref":"#/components/schemas/ThemeColors"},"fxPalette":{"type":"string","enum":["ultracode","theme","ocean","ember","custom"],"default":"ultracode","description":"Streak palette: UltraCode violet, current theme, ocean, ember, or custom colors."},"fxMix":{"type":"number","minimum":0,"maximum":1,"default":0.2,"description":"How strongly the streak palette colors the contribution cells: 0 keeps their theme colors, 1 uses the full streak palette."},"fxDirection":{"type":"string","enum":["rtl","ltr"],"default":"rtl","description":"Travel direction of the glints: rtl moves from today into the past; ltr moves toward today."},"fxSpeed":{"type":"number","minimum":2,"maximum":20,"default":10,"description":"Glint speed in calendar columns per second."},"fxSpread":{"type":"number","minimum":0,"maximum":1,"default":1,"description":"How far the glints are scattered across weekday rows: 0 aligns the rows, 1 fully disperses them."},"fxColor":{"type":"string","pattern":"^#?[0-9a-fA-F]{6}$","description":"Optional streak body color, as six-digit RGB hex. Omit for the selected palette; PATCH null clears an override."},"fxGlint":{"type":"string","pattern":"^#?[0-9a-fA-F]{6}$","description":"Optional glint highlight color, as six-digit RGB hex. Omit for the selected palette; PATCH null clears an override."},"fxSpark":{"type":"string","pattern":"^#?[0-9a-fA-F]{6}$","description":"Optional spark color, as six-digit RGB hex. Omit for the selected palette; PATCH null clears an override."}},"required":["colors"]},
      "StreakAppearance": {"type":"object","properties":{"fxPalette":{"type":"string","enum":["ultracode","theme","ocean","ember","custom"],"default":"ultracode","description":"Streak palette: UltraCode violet, current theme, ocean, ember, or custom colors."},"fxMix":{"type":"number","minimum":0,"maximum":1,"default":0.2,"description":"How strongly the streak palette colors the contribution cells: 0 keeps their theme colors, 1 uses the full streak palette."},"fxDirection":{"type":"string","enum":["rtl","ltr"],"default":"rtl","description":"Travel direction of the glints: rtl moves from today into the past; ltr moves toward today."},"fxSpeed":{"type":"number","minimum":2,"maximum":20,"default":10,"description":"Glint speed in calendar columns per second."},"fxSpread":{"type":"number","minimum":0,"maximum":1,"default":1,"description":"How far the glints are scattered across weekday rows: 0 aligns the rows, 1 fully disperses them."},"fxColor":{"type":"string","pattern":"^#?[0-9a-fA-F]{6}$","description":"Optional streak body color, as six-digit RGB hex. Omit for the selected palette; PATCH null clears an override."},"fxGlint":{"type":"string","pattern":"^#?[0-9a-fA-F]{6}$","description":"Optional glint highlight color, as six-digit RGB hex. Omit for the selected palette; PATCH null clears an override."},"fxSpark":{"type":"string","pattern":"^#?[0-9a-fA-F]{6}$","description":"Optional spark color, as six-digit RGB hex. Omit for the selected palette; PATCH null clears an override."}}},
      "AppearancePreset": {"type":"object","description":"A full appearance recipe. Unlike a color-only palette, this sets the widget theme and all motion/tint settings. Materialize config or patch; recipe IDs are not URL parameters.","properties":{"id":{"type":"string","example":"tethered-twinkles","examples":["tethered-twinkles","ocean-twinkles"]},"label":{"type":"string","example":"TetherEd twinkles"},"description":{"type":"string"},"config":{"type":"object","description":"Explicit saved appearance values. Create a widget with these fields plus its user and content settings.","properties":{"theme":{"$ref":"#/components/schemas/ThemeId"},"fx":{"type":"boolean"},"fxPalette":{"type":"string","enum":["ultracode","theme","ocean","ember","custom"],"default":"ultracode","description":"Streak palette: UltraCode violet, current theme, ocean, ember, or custom colors."},"fxMix":{"type":"number","minimum":0,"maximum":1,"default":0.2,"description":"How strongly the streak palette colors the contribution cells: 0 keeps their theme colors, 1 uses the full streak palette."},"fxDirection":{"type":"string","enum":["rtl","ltr"],"default":"rtl","description":"Travel direction of the glints: rtl moves from today into the past; ltr moves toward today."},"fxSpeed":{"type":"number","minimum":2,"maximum":20,"default":10,"description":"Glint speed in calendar columns per second."},"fxSpread":{"type":"number","minimum":0,"maximum":1,"default":1,"description":"How far the glints are scattered across weekday rows: 0 aligns the rows, 1 fully disperses them."},"fxColor":{"type":"string","pattern":"^#?[0-9a-fA-F]{6}$","description":"Optional streak body color, as six-digit RGB hex. Omit for the selected palette; PATCH null clears an override."},"fxGlint":{"type":"string","pattern":"^#?[0-9a-fA-F]{6}$","description":"Optional glint highlight color, as six-digit RGB hex. Omit for the selected palette; PATCH null clears an override."},"fxSpark":{"type":"string","pattern":"^#?[0-9a-fA-F]{6}$","description":"Optional spark color, as six-digit RGB hex. Omit for the selected palette; PATCH null clears an override."}},"required":["theme","fx","fxPalette","fxMix","fxDirection","fxSpeed","fxSpread"]},"patch":{"$ref":"#/components/schemas/WidgetConfigPatch","description":"Use for updates. Full preset patches explicitly restore saved appearance settings and clear colors, fxColor, fxGlint and fxSpark; content fields are preserved. The same patch works in REST and MCP update_widget."}},"required":["id","label","description","config","patch"]},
      "AppearanceDiscovery": {"type":"object","properties":{"version":{"type":"integer"},"defaults":{"$ref":"#/components/schemas/StreakAppearance"},"fields":{"type":"object","description":"JSON-schema definitions for every appearance option"},"palettes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["ultracode","theme","ocean","ember","custom"],"default":"ultracode","description":"Streak palette: UltraCode violet, current theme, ocean, ember, or custom colors."},"label":{"type":"string"},"description":{"type":"string"},"config":{"$ref":"#/components/schemas/StreakAppearance","description":"Use when creating a widget. To replace the palette on an existing widget, use patch so saved custom overrides do not mask it."},"patch":{"$ref":"#/components/schemas/WidgetConfigPatch","description":"Use this payload to switch an existing widget to this palette. Named presets clear old custom streak color overrides; custom supplies explicit colors."}}},"description":"Color-only streak palettes. These preserve the heatmap theme and motion settings; use presets for full appearance recipes."},"examples":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"config":{"$ref":"#/components/schemas/StreakAppearance"}}}},"usage":{"type":"string"},"presets":{"type":"array","description":"Full saved appearance recipes: TetherEd twinkles restores the approved UltraCode look; Ocean twinkles uses the TetherEd theme with Ocean colors. Both set explicit mix, direction, speed and spread.","items":{"$ref":"#/components/schemas/AppearancePreset"}}},"required":["version","defaults","fields","palettes","examples","usage","presets"]},
      "HostedWidget": {
        "type": "object",
        "properties": {
          "id": { "type": "string", "example": "w_a1b2c3d4e5" },
          "url": { "type": "string", "format": "uri" },
          "iframe": { "type": "string" },
          "config": { "$ref": "#/components/schemas/WidgetConfig" },
          "badge": { "type": "boolean" },
          "allowedDomains": { "type": "array", "items": { "type": "string" } },
          "createdAt": { "type": "string", "format": "date-time" },
          "updatedAt": { "type": "string", "format": "date-time" }
        }
      },
      "WidgetConfig": {
        "type": "object",
        "properties": {
          "streakMode": {"$ref":"#/components/schemas/StreakMode"},
          "user": { "type": "string" },
          "months": { "type": "integer", "enum": [3, 6, 12] },
          "theme": { "$ref": "#/components/schemas/ThemeId" },
          "colors": { "$ref": "#/components/schemas/ThemeColors" },
          "title": { "type": "string" },
          "stats": { "type": "boolean" },
          "labels": { "type": "boolean" },
          "legend": { "type": "boolean" },
          "tooltips": { "type": "boolean" },
          "fx": { "type": "boolean", "default": true, "description": "UltraCode-style glimmer for 3+ consecutive days or an active five-day weekly streak; false keeps the original heatmap" },
          "fxPalette": {"type":"string","enum":["ultracode","theme","ocean","ember","custom"],"default":"ultracode","description":"Streak palette: UltraCode violet, current theme, ocean, ember, or custom colors."},
          "fxMix": {"type":"number","minimum":0,"maximum":1,"default":0.2,"description":"How strongly the streak palette colors the contribution cells: 0 keeps their theme colors, 1 uses the full streak palette."},
          "fxDirection": {"type":"string","enum":["rtl","ltr"],"default":"rtl","description":"Travel direction of the glints: rtl moves from today into the past; ltr moves toward today."},
          "fxSpeed": {"type":"number","minimum":2,"maximum":20,"default":10,"description":"Glint speed in calendar columns per second."},
          "fxSpread": {"type":"number","minimum":0,"maximum":1,"default":1,"description":"How far the glints are scattered across weekday rows: 0 aligns the rows, 1 fully disperses them."},
          "fxColor": {"type":"string","pattern":"^#?[0-9a-fA-F]{6}$","description":"Optional streak body color, as six-digit RGB hex. Omit for the selected palette; PATCH null clears an override."},
          "fxGlint": {"type":"string","pattern":"^#?[0-9a-fA-F]{6}$","description":"Optional glint highlight color, as six-digit RGB hex. Omit for the selected palette; PATCH null clears an override."},
          "fxSpark": {"type":"string","pattern":"^#?[0-9a-fA-F]{6}$","description":"Optional spark color, as six-digit RGB hex. Omit for the selected palette; PATCH null clears an override."},
          "tv": { "type": "boolean" }
        },
        "required": ["user"]
      }
    }
  }
}
