{
  "openapi": "3.1.0",
  "info": {
    "title": "Doing Work discovery stub",
    "version": "1.0.0",
    "description": "Discovery stub for agents. The product API and MCP servers run on the app host, https://app.doingwork.work. Assistants should use the MCP connectors listed at https://doingwork.work/.well-known/mcp.json. Access is granted by the account owner through OAuth with the scopes below. Versioning: info.version follows semantic versioning. Breaking changes get a new major version and are announced at https://doingwork.work/agents/ first. New fields can appear in minor versions, so clients should ignore unknown fields.",
    "x-api-versioning": {
      "strategy": "semver in info.version; breaking changes bump the major version",
      "changelog": "https://doingwork.work/agents/"
    }
  },
  "servers": [
    {
      "url": "https://app.doingwork.work",
      "description": "Doing Work app host"
    }
  ],
  "components": {
    "securitySchemes": {
      "doingWorkOAuth": {
        "type": "oauth2",
        "description": "Authorization code flow with PKCE (S256). Dynamic client registration at /oauth/register. Metadata: https://app.doingwork.work/.well-known/oauth-authorization-server",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://app.doingwork.work/oauth/authorize",
            "tokenUrl": "https://app.doingwork.work/oauth/token",
            "refreshUrl": "https://app.doingwork.work/oauth/token",
            "scopes": {
              "quotes": "Homeowner connector (/mcp/home): full use of the quote tools for the signed-in homeowner",
              "quotes:read": "Homeowner connector (/mcp/home): read only",
              "shop": "Shop connector (/mcp/shop): full use of the shop tools for the signed-in shop",
              "shop:read": "Shop connector (/mcp/shop): read only"
            }
          }
        }
      }
    },
    "schemas": {
      "Health": {
        "type": "object",
        "description": "Public status of the Doing Work app. Extra fields may appear; ignore unknown ones.",
        "properties": {
          "ok": {
            "type": "boolean",
            "description": "True when the app is serving requests"
          },
          "mode": {
            "type": "string",
            "description": "Runtime mode, for example production"
          },
          "buildSha": {
            "type": "string",
            "description": "Git commit of the running app build"
          },
          "termsVersion": {
            "type": "string",
            "description": "Date of the current terms of service, YYYY-MM-DD"
          },
          "planCents": {
            "type": "integer",
            "description": "Monthly plan price in US cents (4900 = $49)"
          },
          "textOverageCents": {
            "type": "integer",
            "description": "Price per text past the monthly allowance, in US cents"
          },
          "connectLive": {
            "type": "boolean",
            "description": "True when Stripe Connect payments are live"
          },
          "vendors": {
            "type": "object",
            "description": "Status of each outside service",
            "additionalProperties": {
              "type": "string",
              "enum": [
                "live",
                "off"
              ]
            }
          },
          "mailPostalAddress": {
            "type": "string",
            "description": "Postal mailing address used in emails"
          }
        },
        "required": [
          "ok"
        ],
        "additionalProperties": true
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Machine-readable error code, for example unauthorized"
              },
              "message": {
                "type": "string",
                "description": "Human-readable message"
              }
            },
            "required": [
              "code",
              "message"
            ]
          }
        },
        "required": [
          "error"
        ]
      }
    }
  },
  "paths": {
    "/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "App health check",
        "description": "Public, no sign-in. Returns ok=true when the Doing Work app is up.",
        "security": [],
        "responses": {
          "200": {
            "description": "The app is up",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                },
                "example": {
                  "ok": true,
                  "mode": "production",
                  "planCents": 4900
                }
              }
            }
          },
          "5XX": {
            "description": "The app is down or restarting",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "status"
        ]
      }
    }
  },
  "externalDocs": {
    "description": "Connector docs for AI assistants",
    "url": "https://doingwork.work/agents/#install"
  }
}
