{
  "openapi": "3.1.0",
  "info": {
    "title": "re:solved Public API",
    "version": "1.0.0",
    "x-api-version": "v1",
    "summary": "Public endpoints and machine-readable resources of re:solved digital.",
    "description": "re:solved digital builds and operates managed AI agents. This specification covers the public HTTP surface: the AI automation opportunity report intake endpoint, the machine-readable discovery files (llms.txt, ai.txt, sitemaps, RSS) and the MCP server used by AI agents. Developer documentation lives at /developers.\n\n## Versioning\n\nThe API uses URL path versioning: the canonical form is /api/public/v1/... and the current major version is v1 (supported: v1). Unversioned paths such as /api/public/ai-audit-submit are permanent aliases of the current major version. Every response carries an API-Version header.\n\n## Deprecation\n\nBreaking changes ship only under a new major version path (for example /api/public/v2/...). Endpoints scheduled for removal respond with Deprecation: true, a Sunset date (RFC 8594) and Link rel=\"deprecation\" pointing at /developers#versioning, at least 180 days before removal. The machine-readable policy is at /api/public/versions.",
    "contact": {
      "name": "re:solved digital",
      "email": "contact@re-solved.digital",
      "url": "https://re-solved.digital/developers"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://re-solved.digital/terms"
    }
  },
  "servers": [
    {
      "url": "https://re-solved.digital",
      "description": "Production"
    }
  ],
  "x-versioning": {
    "strategy": "url-path",
    "currentVersion": "v1",
    "supportedVersions": [
      "v1"
    ],
    "versionHeader": "API-Version",
    "unversionedAliases": "resolve to the current major version",
    "deprecationSignals": [
      "Deprecation",
      "Sunset",
      "Link rel=\"deprecation\""
    ],
    "minimumNoticeDays": 180,
    "docs": "https://re-solved.digital/developers#versioning"
  },
  "externalDocs": {
    "description": "Developer documentation",
    "url": "https://re-solved.digital/developers"
  },
  "tags": [
    {
      "name": "intake",
      "description": "Lead and audit intake endpoints."
    },
    {
      "name": "discovery",
      "description": "Machine-readable files for agents and crawlers."
    },
    {
      "name": "mcp",
      "description": "Model Context Protocol server endpoints."
    },
    {
      "name": "meta",
      "description": "API versioning and deprecation metadata."
    }
  ],
  "paths": {
    "/api/public/ai-audit-submit": {
      "post": {
        "tags": [
          "intake"
        ],
        "operationId": "submitAiAuditRequest",
        "summary": "Submit an AI automation opportunity report request",
        "description": "Public, unauthenticated intake endpoint behind the AI Automation Opportunity Report form. Returns { ok: true } on success and a structured JSON error otherwise.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiAuditSubmission"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Submission accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON body or missing required fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "options": {
        "tags": [
          "intake"
        ],
        "operationId": "aiAuditSubmitPreflight",
        "summary": "CORS preflight",
        "responses": {
          "204": {
            "description": "No content."
          }
        }
      }
    },
    "/api/public/v1/ai-audit-submit": {
      "post": {
        "tags": [
          "intake"
        ],
        "operationId": "submitAiAuditRequestV1",
        "summary": "Submit an AI automation opportunity report request (v1)",
        "description": "Version-pinned form of the intake endpoint. Identical behaviour to /api/public/ai-audit-submit, which is a permanent alias of the current major version.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiAuditSubmission"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Submission accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON body or missing required fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "options": {
        "tags": [
          "intake"
        ],
        "operationId": "aiAuditSubmitV1Preflight",
        "summary": "CORS preflight",
        "responses": {
          "204": {
            "description": "No content."
          }
        }
      }
    },
    "/api/public/versions": {
      "get": {
        "tags": [
          "meta"
        ],
        "operationId": "getApiVersioningPolicy",
        "summary": "API versioning and deprecation policy",
        "description": "Machine-readable versioning strategy, supported versions, deprecation signals and per-endpoint status.",
        "responses": {
          "200": {
            "description": "Versioning policy document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/api-catalog": {
      "get": {
        "tags": [
          "discovery"
        ],
        "operationId": "getApiCatalog",
        "summary": "RFC 9727 API catalog linkset",
        "responses": {
          "200": {
            "description": "Linkset document.",
            "content": {
              "application/linkset+json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "tags": [
          "discovery"
        ],
        "operationId": "getOpenApiSpec",
        "summary": "This OpenAPI specification",
        "responses": {
          "200": {
            "description": "OpenAPI 3.1 document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "tags": [
          "discovery"
        ],
        "operationId": "getLlmsTxt",
        "summary": "llms.txt site summary for language models",
        "responses": {
          "200": {
            "description": "Plain text summary.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/ai.txt": {
      "get": {
        "tags": [
          "discovery"
        ],
        "operationId": "getAiTxt",
        "summary": "AI access and usage directives",
        "responses": {
          "200": {
            "description": "Plain text directives.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/sitemap.xml": {
      "get": {
        "tags": [
          "discovery"
        ],
        "operationId": "getSitemap",
        "summary": "XML sitemap with hreflang alternates",
        "responses": {
          "200": {
            "description": "XML sitemap.",
            "content": {
              "application/xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/rss.xml": {
      "get": {
        "tags": [
          "discovery"
        ],
        "operationId": "getRssFeed",
        "summary": "Blog RSS feed",
        "responses": {
          "200": {
            "description": "RSS 2.0 feed.",
            "content": {
              "application/rss+xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "tags": [
          "mcp"
        ],
        "operationId": "mcpJsonRpc",
        "summary": "MCP (Model Context Protocol) endpoint",
        "description": "Streamable-HTTP MCP endpoint exposing get_services_and_pricing, list_blog_posts, search_blog_posts and get_blog_post. Authorization uses OAuth 2.1; discovery metadata is at /.well-known/oauth-protected-resource.",
        "security": [
          {
            "mcpOAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "JSON-RPC 2.0 request."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC 2.0 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid OAuth token."
          }
        }
      }
    },
    "/.well-known/oauth-protected-resource": {
      "get": {
        "tags": [
          "mcp"
        ],
        "operationId": "getOAuthProtectedResourceMetadata",
        "summary": "OAuth protected resource metadata for the MCP server",
        "responses": {
          "200": {
            "description": "Metadata document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "mcpOAuth": {
        "type": "oauth2",
        "description": "OAuth 2.1 authorization for the MCP endpoint.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://re-solved.digital/.lovable/oauth/consent",
            "tokenUrl": "https://re-solved.digital/mcp",
            "scopes": {}
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message",
              "hint",
              "status"
            ],
            "properties": {
              "code": {
                "type": "string",
                "example": "invalid_request"
              },
              "message": {
                "type": "string",
                "example": "Name, company name and a valid email are required."
              },
              "hint": {
                "type": "string",
                "example": "Send name, email and company_name as non-empty strings."
              },
              "status": {
                "type": "integer",
                "example": 400
              },
              "docs": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "details": {}
            }
          }
        }
      },
      "AiAuditSubmission": {
        "type": "object",
        "required": [
          "name",
          "email",
          "company_name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200
          },
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 320
          },
          "company_name": {
            "type": "string",
            "maxLength": 200
          },
          "website_url": {
            "type": "string",
            "maxLength": 500
          },
          "linkedin_url": {
            "type": "string",
            "maxLength": 500
          },
          "business_description": {
            "type": "string",
            "maxLength": 5000
          },
          "biggest_manual_task": {
            "type": "string",
            "maxLength": 5000
          },
          "tools_used": {
            "type": "string",
            "maxLength": 5000
          },
          "additional_context": {
            "type": "string",
            "maxLength": 5000
          },
          "task_frequency": {
            "type": "string",
            "maxLength": 200
          },
          "time_spent_on_task": {
            "type": "string",
            "maxLength": 200
          },
          "people_involved": {
            "type": "string",
            "maxLength": 200
          },
          "monthly_volume": {
            "type": "string",
            "maxLength": 200
          },
          "delay_or_error_impact": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "string",
              "maxLength": 200
            }
          },
          "internal_hourly_cost_range": {
            "type": "string",
            "maxLength": 200
          },
          "consent_to_contact": {
            "type": "boolean"
          },
          "source": {
            "type": "string",
            "maxLength": 100
          }
        }
      }
    }
  }
}