{
  "openapi": "3.0.1",
  "info": {
    "title": "Fluid Account MCP API",
    "version": "1.0.0",
    "description": "Minimal MCP-facing definition for AccountController token renewal."
  },
  "servers": [
    {
      "url": "https://{tenant}.fluid.work",
      "description": "Your Fluid tenant. Replace {tenant} with your organisation's subdomain.",
      "variables": {
        "tenant": {
          "default": "your-tenant",
          "description": "Fluid tenant subdomain, e.g. 'acme' for https://acme.fluid.work. Sandbox tenants use '{tenant}-sandbox'."
        }
      }
    }
  ],
  "security": [
    {
      "basicAuth": []
    }
  ],
  "tags": [
    {
      "name": "Account",
      "description": "Account endpoints used to manage Fluid authentication tokens."
    }
  ],
  "paths": {
    "/api/Account/CreatePersonalAccessTokenBase64": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Create a new Base64 PAT token",
        "description": "Creates a new Personal Access Token for the authenticated user and returns it already encoded for HTTP Basic authentication. Use this before the current token expires, then replace the MCP token input with the returned token value.",
        "operationId": "createPersonalAccessTokenBase64",
        "parameters": [
          {
            "name": "username",
            "in": "query",
            "description": "Optional username. Only application administrators can request a token for another user.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The new Basic-auth-ready token and expiry details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatePersonalAccessTokenBase64Response"
                }
              }
            }
          }
        },
        "security": [
          {
            "basicAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic",
        "description": "Use your current Fluid PAT or a previously issued Base64 PAT token."
      }
    },
    "schemas": {
      "CreatePersonalAccessTokenBase64Response": {
        "type": "object",
        "required": [
          "subject",
          "token",
          "expiresUtc"
        ],
        "properties": {
          "subject": {
            "type": "string",
            "description": "The user reference encoded into the token."
          },
          "token": {
            "type": "string",
            "description": "A Base64 encoded HTTP Basic auth token ready to use as the MCP token input."
          },
          "expiresUtc": {
            "type": "number",
            "format": "double",
            "description": "Unix timestamp in UTC seconds for token expiry."
          }
        }
      }
    }
  }
}
