{
  "openapi": "3.1.0",
  "info": {
    "title": "Nova Agent Onboarding API",
    "version": "1.1.0",
    "description": "Account-owner-mediated onboarding for one Self-Managed WordPress site. Polling clients must wait for retry_after_seconds (always at least 5) and back off; receipts expire after 72 hours. Machine-readable product and pricing facts are published at https://nova.host/.well-known/catalog.json; the Self-Managed plan is $10/month for one site with Agent access included."
  },
  "servers": [{ "url": "https://nova.host" }],
  "x-agent-flow": [
    { "step": 1, "method": "POST", "path": "/api/agent-onboarding/register", "action": "Register an account receipt." },
    { "step": 2, "method": "GET", "path": "/api/agent-onboarding/{onboarding_id}", "action": "Ask the owner to verify email and poll for claimed." },
    { "step": 3, "method": "POST", "path": "/api/auth/login", "action": "Sign in after verification." },
    { "step": "optional", "method": "POST", "path": "/api/agent-purchases", "action": "Purchase an eligible self-serve product with an owner-issued agent key and Shared Payment Token.", "optional": true, "preconditions": ["Account owner has issued an agent key with a monthly spending ceiling.", "Only self-serve products may be purchased this way.", "Managed plans with a setup fee require human confirmation and cannot be purchased through this endpoint."] },
    { "step": 4, "method": "POST", "path": "/api/agent-onboarding/checkout", "action": "Create and hand off the owner checkout URL." },
    { "step": 5, "method": "GET", "path": "/api/agent-onboarding/{onboarding_id}", "action": "Poll for webhook-confirmed payment." },
    { "step": 6, "method": "POST", "path": "/api/tenants", "action": "Provision the subscribed site, passing status.subscription.id as subscriptionId." },
    { "step": 7, "method": "POST", "path": "/api/agent-onboarding/{onboarding_id}/finalize", "action": "Finalize and receive MCP credentials once." },
    { "step": "domain-1", "flow": "domain", "method": "GET", "path": "/api/registrar/search", "action": "Check availability and yearly price for a domain name or keyword.", "preconditions": ["The owner has a verified account and a hosting subscription; the Self-Managed plan allows one custom domain.", "Every call carries the login JWT, which expires after one hour; exchange refresh_token at POST /api/auth/refresh before each long wait."] },
    { "step": "domain-2", "flow": "domain", "method": "PUT", "path": "/api/registrar/contact", "action": "Save the registrant contact once per account." },
    { "step": "domain-3", "flow": "domain", "method": "POST", "path": "/api/registrar/purchase", "action": "Create the order and hand checkoutUrl to the owner; it is valid for 12 hours." },
    { "step": "domain-4", "flow": "domain", "method": "GET", "path": "/api/registrar/orders/{order_id}", "action": "Poll no faster than every 10 seconds for paymentStatus paid, then status registered and active." },
    { "step": "domain-5", "flow": "domain", "method": "POST", "path": "/api/registrar/domains/{domain}/attach", "action": "Attach the registered domain to a site unless tenantId was given at purchase, then poll GET /api/tenants/{tenant_id}/domain-config until dns_verified and ssl_status active." },
    { "step": "domain-6", "flow": "domain", "method": "POST", "path": "/api/tenants/{tenant_id}/go-live/execute", "action": "Make the domain the site's primary URL." }
  ],
  "paths": {
    "/api/agent-onboarding/register": {
      "post": {
        "summary": "Register an agent-led onboarding receipt",
        "description": "Uses the signup email policy and existing verification email. Idempotent for normalized email plus idempotency_key. Issues no session or token.",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RegisterRequest" } } } },
        "responses": {
          "202": { "description": "Verification required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RegisterAccepted" } } } },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "409": { "description": "Verified account already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExistingAccount" } } } },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      }
    },
    "/api/agent-onboarding/{onboarding_id}": {
      "get": {
        "summary": "Poll onboarding state",
        "description": "Before claim, a poll token reveals only awaiting_email or claimed. After login, a JWT reveals the full receipt. Receipts expire 72 hours after creation.",
        "security": [{ "pollToken": [] }, { "bearerJwt": [] }],
        "parameters": [{ "name": "onboarding_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": {
          "200": { "description": "Current state; poll-token responses omit subscription and tenant details", "content": { "application/json": { "schema": { "oneOf": [{ "$ref": "#/components/schemas/PollStatus" }, { "$ref": "#/components/schemas/OnboardingStatus" }] } } } },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "410": { "$ref": "#/components/responses/Expired" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "502": { "description": "A discovered tenant could not be persisted to the receipt; response retains the prior state and provides retry_after_seconds", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
        }
      }
    },
    "/api/auth/login": {
      "post": {
        "summary": "Sign in to a verified account",
        "description": "Existing login endpoint. Unverified email addresses are rejected and no JWT is issued.",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginRequest" } } } },
        "responses": {
          "200": { "description": "Authenticated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginResponse" } } } },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "description": "Email is unverified or account is inactive", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      }
    },
    "/api/agent-onboarding/checkout": {
      "post": {
        "summary": "Create owner-facing checkout",
        "description": "Only plan host is accepted. Checkout uses onboarding_id as the Stripe idempotency key. Payment state changes only after a Stripe-signed webhook records host/active.",
        "security": [{ "bearerJwt": [] }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CheckoutRequest" } } } },
        "responses": {
          "200": { "description": "Checkout created", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CheckoutResponse" } } } },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "410": { "$ref": "#/components/responses/Expired" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      }
    },
    "/api/tenants": {
      "post": {
        "summary": "Provision a WordPress tenant",
        "description": "Existing endpoint. Requires an active subscription and enforces the host plan's one-site limit.",
        "security": [{ "bearerJwt": [] }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TenantRequest" } } } },
        "responses": {
          "201": { "description": "Tenant provisioning started", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TenantResponse" } } } },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "description": "Subscription does not permit provisioning", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "409": { "description": "Site limit or subdomain conflict", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
        }
      }
    },
    "/api/agent-onboarding/{onboarding_id}/finalize": {
      "post": {
        "summary": "Finalize MCP access",
        "description": "Requires a caller-owned active tenant and a host/active subscription. Acquires a five-minute issuance lease before creating credentials, then records issuance and clears the lease. Enables only content_read, content_write, publish, site_data_read, and operations; destructive remains disabled. The plaintext MCP key is returned only once and stored only as a hash.",
        "security": [{ "bearerJwt": [] }],
        "parameters": [{ "name": "onboarding_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FinalizeRequest" } } } },
        "responses": {
          "200": { "description": "MCP credentials issued with non-destructive default grants content_read, content_write, publish, site_data_read, and operations enabled; destructive is disabled.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/FinalizeResponse" } } } },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "description": "Tenant ownership or subscription precondition failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "409": { "description": "MCP credentials were already issued", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AlreadyFinalized" } } } },
          "410": { "$ref": "#/components/responses/Expired" },
          "423": { "description": "Another credential issuance attempt holds the lease; retry after five seconds", "headers": { "Retry-After": { "schema": { "type": "integer", "const": 5 } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IssuanceLocked" } } } },
          "502": { "description": "Upstream or receipt persistence failed. If key creation may have completed, Retry-After identifies when the issuance lease expires.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
        }
      }
    },
    "/api/agent-purchases": {
      "post": {
        "summary": "Purchase an eligible self-serve product",
        "description": "Agent-initiated purchases are enabled per account. Uses an owner-issued agent key, its monthly spending ceiling, and a bounded Shared Payment Token. When agent purchasing is not enabled for an account, the endpoint returns 403 agent_purchases_disabled and the agent should hand the owner the checkout link instead. Managed plans with a setup fee require human confirmation and cannot be purchased through this endpoint.",
        "security": [{ "bearerJwt": [], "agentKey": [] }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentPurchaseRequest" } } } },
        "responses": {
          "200": { "description": "Idempotent replay of a previous purchase state", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentPurchaseResponse" } } } },
          "201": { "description": "Purchase processed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentPurchaseResponse" } } } },
          "400": { "description": "Agent purchase request was invalid", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentPurchaseBadRequestError" } } } },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "402": { "description": "Payment requires action or failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentPurchasePaymentError" } } } },
          "403": { "description": "Agent purchasing is disabled (agent_purchases_disabled), or the spending ceiling, key, ownership, or product policy rejected the purchase", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentPurchaseForbiddenError" } } } },
          "409": { "description": "An active subscription or idempotency conflict prevents the purchase", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentPurchaseConflictError" } } } },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "502": { "description": "Key introspection or fulfilment service failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentPurchaseFulfilmentError" } } } }
        }
      },
      "get": {
        "summary": "List agent-initiated purchases for the account owner",
        "security": [{ "bearerJwt": [], "agentKey": [] }],
        "responses": {
          "200": { "description": "Agent purchase history", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentPurchaseListResponse" } } } },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "502": { "description": "Billing service unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
        }
      }
    },
    "/api/agent-purchases/{id}/convert": {
      "post": {
        "summary": "Convert a fulfilled agent purchase to another eligible product",
        "description": "Wrong-product conversion. The caller's bearer token is verified through auth-service /profile and X-Nova-Agent-Key is forwarded to billing. The source must be fulfilled with a PaymentIntent, within the conversion window, and worth at least the target product. Managed-plan purchases require human confirmation.",
        "security": [{ "bearerJwt": [], "agentKey": [] }],
        "parameters": [{ "name": "id", "in": "path", "required": true, "description": "Agent purchase id", "schema": { "type": "string", "minLength": 8, "maxLength": 64, "pattern": "^[A-Za-z0-9-]+$" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false, "required": ["to_product_id"], "properties": { "to_product_id": { "type": "string", "enum": ["host", "seo_content"] } } } } } },
        "responses": {
          "200": { "description": "Converted purchase", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentPurchaseResponse" } } } },
          "400": { "description": "Invalid purchase id, body, target, or missing agent key (invalid_request)", "content": { "application/json": { "schema": { "type": "object", "required": ["error"], "properties": { "error": { "const": "invalid_request" }, "message": { "type": "string" } } } } } },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "description": "Agent purchasing is disabled or conversion policy rejected the request", "content": { "application/json": { "schema": { "type": "object", "required": ["error"], "properties": { "error": { "type": "string", "enum": ["agent_purchases_disabled", "managed_plan_requires_human", "conversion_window_expired", "conversion_requires_upgrade_payment"] }, "next": { "type": "string" } } } } } },
          "404": { "description": "Purchase not found (purchase_not_found)", "content": { "application/json": { "schema": { "type": "object", "required": ["error"], "properties": { "error": { "const": "purchase_not_found" } } } } } },
          "409": { "description": "Source was already converted or is not fulfilled", "content": { "application/json": { "schema": { "type": "object", "required": ["error"], "properties": { "error": { "type": "string", "enum": ["already_converted", "source_not_fulfilled"] } } } } } },
          "502": { "description": "Auth or billing service unavailable; billing 5xx responses are mapped to billing_service_unavailable", "content": { "application/json": { "schema": { "type": "object", "required": ["error"], "properties": { "error": { "type": "string", "enum": ["auth_service_unavailable", "billing_service_unavailable"] } } } } } }
        }
      }
    },
    "/api/agent-purchases/spend-limit": {
      "get": {
        "summary": "Get the agent key's monthly spending limit",
        "security": [{ "bearerJwt": [], "agentKey": [] }],
        "parameters": [{ "name": "key_id", "in": "query", "required": true, "schema": { "type": "string", "minLength": 1 } }],
        "responses": {
          "200": { "description": "Current monthly ceiling and spend", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AgentSpendLimitResponse" } } } },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "502": { "description": "Billing service unavailable", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
        }
      }
    },
    "/api/auth/refresh": {
      "post": {
        "summary": "Exchange a refresh token for a fresh JWT",
        "description": "The login JWT expires after one hour. Send refresh_token from the login response to receive a new one-hour JWT. The refresh token is not rotated and stays valid for 30 days of use. When login issued no refresh_token, sign in again instead.",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RefreshRequest" } } } },
        "responses": {
          "200": { "description": "Fresh JWT", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RefreshResponse" } } } },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "description": "Refresh token is unknown or expired (invalid_refresh_token)", "content": { "application/json": { "schema": { "type": "object", "required": ["error"], "properties": { "error": { "const": "invalid_refresh_token" }, "message": { "type": "string" } } } } } },
          "403": { "description": "Email is unverified or account is inactive", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "502": { "description": "Auth service unreachable (auth_error)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
        }
      }
    },
    "/api/registrar/search": {
      "get": {
        "summary": "Search domain availability and price",
        "description": "q is a keyword of at least three characters, searched across every offered TLD, or a full domain name. Each result reports purchasable and, when purchasable, the first-year priceCents and renewalPriceCents in US cents. Results that are not purchasable carry reason premium or cost_limit.",
        "security": [{ "bearerJwt": [] }],
        "parameters": [{ "name": "q", "in": "query", "required": true, "schema": { "type": "string", "minLength": 3 } }],
        "responses": {
          "200": { "description": "Candidates", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/DomainSearchResult" } } } } },
          "400": { "description": "q is shorter than three characters (invalid_query) or not a valid domain name (invalid_domain)", "content": { "application/json": { "schema": { "type": "object", "required": ["error"], "properties": { "error": { "type": "string", "enum": ["invalid_query", "invalid_domain"] }, "message": { "type": "string" } } } } } },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "502": { "description": "Registrar lookup failed (registrar_error)", "content": { "application/json": { "schema": { "type": "object", "required": ["error"], "properties": { "error": { "const": "registrar_error" }, "message": { "type": "string" } } } } } },
          "503": { "description": "Domain registration is not configured (registrar_not_configured)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
        }
      }
    },
    "/api/registrar/contact": {
      "get": {
        "summary": "Read the registrant contact",
        "security": [{ "bearerJwt": [] }],
        "responses": {
          "200": { "description": "Registrant contact on file", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DomainContact" } } } },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "404": { "description": "No registrant contact is configured yet (contact_not_found)", "content": { "application/json": { "schema": { "type": "object", "required": ["error"], "properties": { "error": { "const": "contact_not_found" }, "message": { "type": "string" } } } } } }
        }
      },
      "put": {
        "summary": "Save the registrant contact",
        "description": "Required once per account before the first purchase. country is a two-letter ISO code and phone is E.164. Saving again replaces the contact.",
        "security": [{ "bearerJwt": [] }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DomainContact" } } } },
        "responses": {
          "200": { "description": "Saved contact", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DomainContact" } } } },
          "400": { "description": "Malformed body (invalid_request) or a missing or invalid field (invalid_contact)", "content": { "application/json": { "schema": { "type": "object", "required": ["error"], "properties": { "error": { "type": "string", "enum": ["invalid_request", "invalid_contact"] }, "message": { "type": "string" } } } } } },
          "401": { "$ref": "#/components/responses/Unauthorized" }
        }
      }
    },
    "/api/registrar/purchase": {
      "post": {
        "summary": "Order a domain and receive the owner payment link",
        "description": "Without paymentMethodId the order is created in checkout mode: the response carries a Stripe-hosted checkoutUrl for the account owner, valid until checkoutExpiresAt (12 hours). Hand it to the owner and poll GET /api/registrar/orders/{order_id}. Repeating the request while the link is live returns the same order without creating another; a stale order is replaced by a fresh one. tenantId must name a site the caller owns and makes the domain attach to that site automatically after registration. A non-empty paymentMethodId selects the dashboard's card mode, whose response carries a clientSecret that only a browser can confirm.",
        "security": [{ "bearerJwt": [] }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DomainPurchaseRequest" } } } },
        "responses": {
          "200": { "description": "Order created, or the outstanding order for the same domain returned again", "content": { "application/json": { "schema": { "oneOf": [{ "$ref": "#/components/schemas/DomainCheckoutOrder" }, { "$ref": "#/components/schemas/DomainCardOrder" }] } } } },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "description": "tenantId is not a site owned by the caller (tenant_not_owned)", "content": { "application/json": { "schema": { "type": "object", "required": ["error"], "properties": { "error": { "const": "tenant_not_owned" }, "message": { "type": "string" } } } } } },
          "409": { "description": "contact_required: save the registrant contact first. domain_unavailable or domain_not_purchasable: choose another name. domain_reserved: an order for this domain is outstanding; retry shortly, or cancel it first when switching payment modes", "content": { "application/json": { "schema": { "type": "object", "required": ["error"], "properties": { "error": { "type": "string", "enum": ["contact_required", "domain_unavailable", "domain_not_purchasable", "domain_reserved"] }, "message": { "type": "string" } } } } } },
          "502": { "description": "The registrar (registrar_error), billing (billing_error) or the site ownership check (provisioner_error) failed; nothing was charged", "content": { "application/json": { "schema": { "type": "object", "required": ["error"], "properties": { "error": { "type": "string", "enum": ["registrar_error", "billing_error", "provisioner_error"] }, "message": { "type": "string" } } } } } },
          "503": { "description": "Domain registration is not configured (registrar_not_configured)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
        }
      }
    },
    "/api/registrar/orders": {
      "get": {
        "summary": "List the caller's domain orders",
        "description": "Newest first, at most 100. Use it to recover an orderId after a timeout.",
        "security": [{ "bearerJwt": [] }],
        "parameters": [{ "name": "status", "in": "query", "required": false, "schema": { "$ref": "#/components/schemas/DomainOrderStatus" } }, { "name": "domain", "in": "query", "required": false, "schema": { "type": "string", "format": "hostname" } }],
        "responses": {
          "200": { "description": "Orders", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DomainOrderList" } } } },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" }
        }
      }
    },
    "/api/registrar/orders/{order_id}": {
      "get": {
        "summary": "Read one domain order",
        "description": "Poll no faster than every 10 seconds. After the owner pays, paymentStatus moves processing then paid, and status moves paid, registered, active as registration and DNS complete at the registrar; paid may persist for hours while the registrar queues the registration, in which case lastError explains and the service retries every 15 minutes. A declined card is retried by the owner inside the payment page and is not visible here; paymentStatus stays awaiting_payment until the owner pays or the link expires (expired, then status cancelled). registration_failed is terminal for the agent: report lastError to the owner. When an order placed with tenantId reaches active, a lastError beginning attach: means the automatic attach did not complete.",
        "security": [{ "bearerJwt": [] }],
        "parameters": [{ "name": "order_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": {
          "200": { "description": "Order", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DomainOrder" } } } },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "404": { "description": "Order not found or not owned by the caller (order_not_found)", "content": { "application/json": { "schema": { "type": "object", "required": ["error"], "properties": { "error": { "const": "order_not_found" }, "message": { "type": "string" } } } } } }
        }
      }
    },
    "/api/registrar/orders/{order_id}/cancel": {
      "post": {
        "summary": "Cancel a pending domain order",
        "description": "Abandons an order that is still pending_payment and voids its payment link. Send no request body. Once the owner has paid, the order can no longer be cancelled and will complete.",
        "security": [{ "bearerJwt": [] }],
        "parameters": [{ "name": "order_id", "in": "path", "required": true, "schema": { "type": "string", "format": "uuid" } }],
        "responses": {
          "200": { "description": "Order cancelled", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DomainOrderCancelled" } } } },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "404": { "description": "Order not found or not owned by the caller (order_not_found)", "content": { "application/json": { "schema": { "type": "object", "required": ["error"], "properties": { "error": { "const": "order_not_found" }, "message": { "type": "string" } } } } } },
          "409": { "$ref": "#/components/responses/Conflict", "description": "The order is not pending_payment, or payment was already received and the order will complete (order_not_cancellable)" },
          "502": { "description": "Billing could not void the payment link; the order is unchanged (billing_error)", "content": { "application/json": { "schema": { "type": "object", "required": ["error"], "properties": { "error": { "const": "billing_error" }, "message": { "type": "string" } } } } } }
        }
      }
    },
    "/api/registrar/domains/{domain}/attach": {
      "post": {
        "summary": "Attach a registered domain to a site",
        "description": "Points the domain's DNS at Nova and adds it as a custom domain of the site. Needed only when tenantId was not given at purchase, or when the order's lastError begins attach:. Afterwards poll GET /api/tenants/{tenant_id}/domain-config until the domain appears in custom_domains with dns_verified true and ssl_status active.",
        "security": [{ "bearerJwt": [] }],
        "parameters": [{ "name": "domain", "in": "path", "required": true, "description": "Domain registered through this account, lower case", "schema": { "type": "string", "format": "hostname" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DomainAttachRequest" } } } },
        "responses": {
          "200": { "description": "Attached", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DomainAttachResponse" } } } },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "description": "The site's plan has no free custom-domain slot (plan_limit_reached; the Self-Managed plan allows one) or the site is not owned by the caller (tenant_not_owned)", "content": { "application/json": { "schema": { "type": "object", "required": ["error"], "properties": { "error": { "type": "string", "enum": ["plan_limit_reached", "tenant_not_owned"] }, "message": { "type": "string" } } } } } },
          "404": { "description": "The domain is not registered through this account (domain_not_found)", "content": { "application/json": { "schema": { "type": "object", "required": ["error"], "properties": { "error": { "const": "domain_not_found" }, "message": { "type": "string" } } } } } },
          "409": { "$ref": "#/components/responses/Conflict", "description": "The domain is attached to another site (attach_conflict)" },
          "502": { "description": "DNS or site configuration failed (attach_failed)", "content": { "application/json": { "schema": { "type": "object", "required": ["error"], "properties": { "error": { "const": "attach_failed" }, "message": { "type": "string" } } } } } },
          "503": { "description": "Domain registration is not configured (registrar_not_configured)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
        }
      }
    },
    "/api/tenants/{tenant_id}/domain-config": {
      "get": {
        "summary": "Read a site's custom-domain configuration",
        "description": "Existing endpoint. custom_domains lists each attached domain with dns_verified and ssl_status; after attach, poll it until the new domain shows dns_verified true and ssl_status active.",
        "security": [{ "bearerJwt": [] }],
        "parameters": [{ "name": "tenant_id", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": {
          "200": { "description": "Domain configuration", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TenantDomainConfig" } } } },
          "401": { "description": "Authentication failed or the site is not owned by the caller", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
        }
      }
    },
    "/api/tenants/{tenant_id}/go-live/execute": {
      "post": {
        "summary": "Make a custom domain the site's primary URL",
        "description": "Existing endpoint. Requires the domain's DNS to already resolve to Nova, which holds for a domain registered and attached through this API. Set update_wordpress true to rewrite the WordPress site URL and content to the new domain. The response lists each migration step; success false names the step that failed.",
        "security": [{ "bearerJwt": [] }],
        "parameters": [{ "name": "tenant_id", "in": "path", "required": true, "schema": { "type": "string" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GoLiveExecuteRequest" } } } },
        "responses": {
          "200": { "description": "Migration result", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GoLiveExecuteResponse" } } } },
          "400": { "description": "DNS does not yet resolve to Nova (success false, message explains)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GoLiveExecuteResponse" } } } },
          "401": { "description": "Authentication failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
          "403": { "description": "The subscription plan does not include a live domain", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GoLiveExecuteResponse" } } } },
          "409": { "description": "The domain is already in use by another site or app", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GoLiveExecuteResponse" } } } },
          "500": { "description": "An unknown or unowned tenant_id, or an invalid body, currently surfaces as 500 through the portal proxy", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerJwt": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" },
      "pollToken": { "type": "apiKey", "in": "header", "name": "X-Poll-Token" },
      "agentKey": { "type": "apiKey", "in": "header", "name": "X-Nova-Agent-Key" }
    },
    "responses": {
      "BadRequest": { "description": "Invalid request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
      "Unauthorized": { "description": "Authentication failed", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
      "NotFound": { "description": "Receipt not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
      "Expired": { "description": "Onboarding receipt expired", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
      "RateLimited": { "description": "Per-IP/day or edge limit exceeded", "headers": { "Retry-After": { "schema": { "type": "integer", "minimum": 5 } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
      "Conflict": { "description": "Request conflicts with the current state of the order or domain; error carries the stable code", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
    },
    "schemas": {
      "RegisterRequest": { "type": "object", "additionalProperties": false, "required": ["email", "password", "idempotency_key"], "properties": { "email": { "type": "string", "format": "email" }, "password": { "type": "string", "format": "password" }, "company_name": { "type": "string" }, "idempotency_key": { "type": "string", "minLength": 1 } } },
      "RegisterAccepted": { "type": "object", "additionalProperties": false, "required": ["onboarding_id", "state", "poll_token", "claim_expires_at", "next"], "properties": { "onboarding_id": { "type": "string", "format": "uuid" }, "state": { "const": "awaiting_email" }, "poll_token": { "type": "string" }, "claim_expires_at": { "type": "string", "format": "date-time" }, "next": { "type": "string", "pattern": "^Ask the account owner to open the verification email sent to .+, then poll GET /api/agent-onboarding/.+\\.$" } } },
      "ExistingAccount": { "type": "object", "additionalProperties": false, "required": ["state", "next"], "properties": { "state": { "const": "existing_account" }, "next": { "const": "Sign in with POST /api/auth/login" } } },
      "LoginRequest": { "type": "object", "additionalProperties": false, "required": ["email", "password"], "properties": { "email": { "type": "string", "format": "email" }, "password": { "type": "string", "format": "password" } } },
      "LoginResponse": { "type": "object", "required": ["token", "user"], "properties": { "token": { "type": "string", "description": "Bearer JWT" }, "refresh_token": { "type": "string" }, "user": { "type": "object", "required": ["id", "email"], "properties": { "id": { "type": "string" }, "email": { "type": "string", "format": "email" } }, "additionalProperties": true } }, "additionalProperties": true },
      "CheckoutRequest": { "type": "object", "additionalProperties": false, "required": ["onboarding_id", "plan"], "properties": { "onboarding_id": { "type": "string", "format": "uuid" }, "plan": { "const": "host" } } },
      "CheckoutResponse": { "type": "object", "additionalProperties": false, "required": ["checkout_url", "expires_at", "next"], "properties": { "checkout_url": { "type": "string", "format": "uri" }, "expires_at": { "type": "string", "format": "date-time" }, "next": { "const": "Hand checkout_url to the account owner; poll status until state=paid." } } },
      "Subscription": { "type": ["object", "null"], "required": ["id", "plan", "status"], "properties": { "id": { "type": "string", "description": "Pass this value as subscriptionId to POST /api/tenants." }, "plan": { "type": "string" }, "status": { "type": "string" } }, "additionalProperties": false },
      "TenantStatus": { "type": ["object", "null"], "required": ["id", "status", "site_url", "wp_admin_url"], "properties": { "id": { "type": "string" }, "status": { "type": "string" }, "site_url": { "type": "string", "format": "uri" }, "wp_admin_url": { "type": "string", "format": "uri" } }, "additionalProperties": false },
      "PollStatus": { "type": "object", "additionalProperties": false, "required": ["onboarding_id", "state", "next", "retry_after_seconds"], "properties": { "onboarding_id": { "type": "string", "format": "uuid" }, "state": { "type": "string", "enum": ["awaiting_email", "claimed"] }, "next": { "type": "string" }, "retry_after_seconds": { "type": "integer", "minimum": 5 } } },
      "OnboardingStatus": { "type": "object", "additionalProperties": false, "required": ["onboarding_id", "state", "subscription", "tenant", "next", "retry_after_seconds"], "properties": { "onboarding_id": { "type": "string", "format": "uuid" }, "state": { "type": "string", "enum": ["awaiting_email", "claimed", "awaiting_payment", "paid", "provisioning", "site_active", "mcp_ready"] }, "subscription": { "$ref": "#/components/schemas/Subscription" }, "tenant": { "$ref": "#/components/schemas/TenantStatus" }, "next": { "type": "string" }, "retry_after_seconds": { "type": "integer", "minimum": 5 } } },
      "TenantRequest": { "type": "object", "additionalProperties": true, "required": ["subscriptionId", "name", "subdomain", "siteTitle"], "properties": { "subscriptionId": { "type": "string" }, "name": { "type": "string" }, "subdomain": { "type": "string" }, "siteTitle": { "type": "string" }, "domain": { "type": "string" }, "adminEmail": { "type": "string", "format": "email" }, "tagline": { "type": "string" }, "language": { "type": "string" }, "timezone": { "type": "string" }, "plugins": { "type": "array", "items": { "type": "string" } }, "theme": { "type": "string" } } },
      "TenantResponse": { "type": "object", "required": ["id", "status"], "properties": { "id": { "type": "string" }, "status": { "type": "string" }, "site_url": { "type": "string", "format": "uri" }, "wp_admin_url": { "type": "string", "format": "uri" } }, "additionalProperties": true },
      "FinalizeRequest": { "type": "object", "additionalProperties": false, "required": ["tenant_id"], "properties": { "tenant_id": { "type": "string" } } },
      "McpJson": { "type": "object", "additionalProperties": false, "required": ["mcpServers"], "properties": { "mcpServers": { "type": "object", "additionalProperties": false, "required": ["nova"], "properties": { "nova": { "type": "object", "additionalProperties": false, "required": ["type", "url", "headers"], "properties": { "type": { "const": "http" }, "url": { "const": "https://mcp.nova.host/mcp" }, "headers": { "type": "object", "additionalProperties": false, "required": ["Authorization"], "properties": { "Authorization": { "type": "string", "pattern": "^Bearer .+" } } } } } } } } },
      "FinalizeResponse": { "type": "object", "additionalProperties": false, "required": ["mcp_endpoint", "mcp_api_key", "mcp_json", "claude_code_command", "site_url", "wp_admin_url", "tenant_id", "next"], "properties": { "mcp_endpoint": { "const": "https://mcp.nova.host/mcp" }, "mcp_api_key": { "type": "string", "writeOnly": true }, "mcp_json": { "$ref": "#/components/schemas/McpJson" }, "claude_code_command": { "type": "string" }, "site_url": { "type": "string", "format": "uri" }, "wp_admin_url": { "type": "string", "format": "uri" }, "tenant_id": { "type": "string" }, "next": { "const": "Save mcp_api_key now; it is not shown again. Rotate it from the dashboard." } } },
      "AlreadyFinalized": { "type": "object", "additionalProperties": false, "required": ["state"], "properties": { "state": { "const": "mcp_ready" } } },
      "IssuanceLocked": { "type": "object", "additionalProperties": false, "required": ["error", "retry_after_seconds"], "properties": { "error": { "const": "credential_issuance_locked" }, "retry_after_seconds": { "type": "integer", "const": 5 } } },
      "AgentPurchaseRequest": { "type": "object", "additionalProperties": false, "required": ["product_id", "shared_payment_token", "idempotency_key"], "properties": { "product_id": { "type": "string", "enum": ["host", "seo_content"], "description": "An agent-purchasable self-serve product." }, "tenant_id": { "type": "string", "minLength": 1, "description": "Required when product_id is seo_content; omit for host." }, "shared_payment_token": { "type": "string", "minLength": 1, "writeOnly": true, "description": "An owner-authorized payment token bounded by amount and time." }, "idempotency_key": { "type": "string", "minLength": 1 } } },
      "AgentPurchaseResponse": { "type": "object", "additionalProperties": false, "required": ["purchase_id", "status"], "properties": { "purchase_id": { "type": "string" }, "product_id": { "type": "string", "enum": ["host", "seo_content"] }, "status": { "type": "string", "enum": ["reserved", "paid", "requires_action", "failed", "fulfilled", "fulfilment_failed", "refunded", "converted"] }, "amount_cents": { "type": "integer", "minimum": 0 }, "currency": { "type": "string" }, "period_start": { "type": "string" }, "period_end": { "type": "string" }, "receipt_url": { "type": "string", "format": "uri" }, "next": { "type": "string" }, "idempotent": { "type": "boolean" } } },
      "AgentPurchaseBadRequestError": { "type": "object", "additionalProperties": true, "required": ["error"], "properties": { "error": { "type": "string", "enum": ["invalid_request", "user_id_required", "agent_key_required", "token_insufficient"] }, "reason": { "type": "string" } } },
      "AgentPurchasePaymentError": { "type": "object", "additionalProperties": true, "required": ["error"], "properties": { "error": { "type": "string", "enum": ["requires_action", "payment_failed"] }, "next_action": { "type": "object", "additionalProperties": true }, "decline_code": { "type": "string" }, "idempotent": { "type": "boolean" } } },
      "AgentPurchaseForbiddenError": { "type": "object", "additionalProperties": true, "required": ["error"], "properties": { "error": { "type": "string", "enum": ["agent_purchases_disabled", "key_revoked", "key_user_mismatch", "ceiling_not_set", "managed_plan_requires_human", "product_not_agent_purchasable", "tenant_not_owned", "ceiling_exceeded"] }, "ceiling_cents": { "type": "integer", "minimum": 0 }, "spent_cents": { "type": "integer", "minimum": 0 } } },
      "AgentPurchaseConflictError": { "type": "object", "additionalProperties": true, "required": ["error"], "properties": { "error": { "type": "string", "enum": ["subscription_active", "idempotency_conflict"] } } },
      "AgentPurchaseFulfilmentError": { "type": "object", "additionalProperties": true, "required": ["error"], "properties": { "error": { "type": "string", "enum": ["key_introspection_failed", "fulfilment_service_unavailable", "fulfilment_failed"] }, "idempotent": { "type": "boolean" } } },
      "AgentPurchaseListResponse": { "type": "object", "additionalProperties": false, "required": ["purchases"], "properties": { "purchases": { "type": "array", "items": { "$ref": "#/components/schemas/AgentPurchaseResponse" } } } },
      "AgentSpendLimitResponse": { "type": "object", "additionalProperties": false, "required": ["monthly_spend_ceiling_cents", "spent_cents_this_month", "remaining_cents"], "properties": { "monthly_spend_ceiling_cents": { "type": "integer", "minimum": 0 }, "spent_cents_this_month": { "type": "integer", "minimum": 0 }, "remaining_cents": { "type": "integer", "minimum": 0 } } },
      "RefreshRequest": { "type": "object", "additionalProperties": false, "required": ["refresh_token"], "properties": { "refresh_token": { "type": "string", "minLength": 1, "description": "refresh_token from the login response" } } },
      "RefreshResponse": { "type": "object", "required": ["token"], "properties": { "token": { "type": "string", "description": "Bearer JWT valid for one hour" } }, "additionalProperties": true },
      "DomainSearchResult": { "type": "object", "additionalProperties": false, "required": ["domainName", "purchasable", "priceCents", "renewalPriceCents"], "properties": { "domainName": { "type": "string", "format": "hostname" }, "purchasable": { "type": "boolean" }, "priceCents": { "type": "integer", "minimum": 0, "description": "First-year price in US cents; 0 when not purchasable" }, "renewalPriceCents": { "type": "integer", "minimum": 0, "description": "Yearly renewal price in US cents; 0 when not purchasable" }, "reason": { "type": "string", "enum": ["premium", "cost_limit"], "description": "Present only when purchasable is false" } } },
      "DomainContact": { "type": "object", "additionalProperties": false, "required": ["firstName", "lastName", "address1", "city", "state", "zip", "country", "email", "phone"], "properties": { "firstName": { "type": "string", "minLength": 1 }, "lastName": { "type": "string", "minLength": 1 }, "companyName": { "type": "string" }, "address1": { "type": "string", "minLength": 1 }, "address2": { "type": "string" }, "city": { "type": "string", "minLength": 1 }, "state": { "type": "string", "minLength": 1 }, "zip": { "type": "string", "minLength": 1 }, "country": { "type": "string", "minLength": 2, "maxLength": 2, "description": "Two-letter ISO country code" }, "email": { "type": "string", "format": "email" }, "phone": { "type": "string", "pattern": "^\\+[1-9][0-9]{6,14}$", "description": "E.164" } } },
      "DomainOrderStatus": { "type": "string", "enum": ["pending_payment", "paid", "registered", "active", "registration_failed", "cancelled", "refunded"] },
      "DomainPaymentMode": { "type": "string", "enum": ["card", "checkout"] },
      "DomainPaymentStatus": { "type": "string", "enum": ["awaiting_payment", "processing", "paid", "payment_failed", "expired", "cancelled", "refunded"], "description": "processing means the owner paid and confirmation is in flight; expired means the payment link lapsed and the order will be cancelled; payment_failed applies to card mode only" },
      "DomainPurchaseRequest": { "type": "object", "additionalProperties": false, "required": ["domainName"], "properties": { "domainName": { "type": "string", "format": "hostname", "description": "Full domain name, for example example.com" }, "tenantId": { "type": "string", "description": "Site to attach the domain to after registration; must be owned by the caller" }, "paymentMethodId": { "type": "string", "description": "Dashboard card mode only; omit to receive the owner payment link" }, "paymentMode": { "$ref": "#/components/schemas/DomainPaymentMode", "description": "Defaults to checkout when paymentMethodId is empty, else card; checkout with a paymentMethodId is rejected" } } },
      "DomainCheckoutOrder": { "type": "object", "additionalProperties": false, "required": ["orderId", "status", "paymentMode", "checkoutUrl", "checkoutExpiresAt", "priceCents", "domainName"], "properties": { "orderId": { "type": "string", "format": "uuid" }, "status": { "const": "pending_payment" }, "paymentMode": { "const": "checkout" }, "checkoutUrl": { "type": "string", "format": "uri", "description": "Stripe-hosted payment page for the account owner" }, "checkoutExpiresAt": { "type": "string", "format": "date-time" }, "priceCents": { "type": "integer", "minimum": 0 }, "domainName": { "type": "string", "format": "hostname" } } },
      "DomainCardOrder": { "type": "object", "additionalProperties": false, "required": ["orderId", "status", "clientSecret", "subscriptionId", "priceCents", "domainName"], "properties": { "orderId": { "type": "string", "format": "uuid" }, "status": { "const": "pending_payment" }, "clientSecret": { "type": "string", "description": "Confirmed in the browser by the dashboard; not usable by an agent" }, "subscriptionId": { "type": "string" }, "priceCents": { "type": "integer", "minimum": 0 }, "domainName": { "type": "string", "format": "hostname" } } },
      "DomainOrder": { "type": "object", "required": ["orderId", "status", "domainName", "priceCents", "paymentMode", "paymentStatus", "checkoutUrl", "checkoutExpiresAt", "lastPaymentError", "subscriptionId", "lastError", "attempts", "tenantId", "createdAt", "updatedAt"], "properties": { "orderId": { "type": "string", "format": "uuid" }, "status": { "$ref": "#/components/schemas/DomainOrderStatus" }, "domainName": { "type": "string", "format": "hostname" }, "priceCents": { "type": "integer", "minimum": 0 }, "paymentMode": { "$ref": "#/components/schemas/DomainPaymentMode" }, "paymentStatus": { "$ref": "#/components/schemas/DomainPaymentStatus" }, "checkoutUrl": { "type": ["string", "null"], "format": "uri", "description": "Owner payment link; null unless the order is pending_payment and the link is still valid" }, "checkoutExpiresAt": { "type": ["string", "null"], "format": "date-time" }, "lastPaymentError": { "type": "string", "description": "Card-mode decline message; empty otherwise" }, "subscriptionId": { "type": ["string", "null"] }, "lastError": { "type": "string", "description": "Registration, DNS or attach failure detail; attach failures begin with attach:" }, "attempts": { "type": "integer", "minimum": 0 }, "tenantId": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "updatedAt": { "type": "string", "format": "date-time" } }, "additionalProperties": true },
      "DomainOrderList": { "type": "object", "additionalProperties": false, "required": ["orders"], "properties": { "orders": { "type": "array", "items": { "$ref": "#/components/schemas/DomainOrder" } } } },
      "DomainOrderCancelled": { "type": "object", "additionalProperties": false, "required": ["orderId", "status"], "properties": { "orderId": { "type": "string", "format": "uuid" }, "status": { "const": "cancelled" } } },
      "DomainAttachRequest": { "type": "object", "additionalProperties": false, "required": ["tenantId"], "properties": { "tenantId": { "type": "string", "minLength": 1 } } },
      "DomainAttachResponse": { "type": "object", "additionalProperties": false, "required": ["ok"], "properties": { "ok": { "const": true } } },
      "CustomDomainMapping": { "type": "object", "required": ["custom_domain", "status", "dns_verified", "ssl_status"], "properties": { "tenant_id": { "type": "string" }, "custom_domain": { "type": "string", "format": "hostname" }, "status": { "type": "string", "enum": ["pending", "active", "failed"] }, "dns_verified": { "type": "boolean" }, "ssl_status": { "type": "string", "enum": ["pending", "active", "failed"] }, "created_at": { "type": "string", "format": "date-time" }, "last_checked_at": { "type": "string", "format": "date-time" } }, "additionalProperties": true },
      "TenantDomainConfig": { "type": "object", "required": ["tenant_id", "default_domain", "custom_domain_limit", "custom_domains"], "properties": { "tenant_id": { "type": "string" }, "load_balancer_ip": { "type": "string" }, "default_domain": { "type": "string", "format": "hostname" }, "custom_domain_limit": { "type": "integer", "description": "-1 means unlimited" }, "custom_domains": { "type": ["array", "null"], "items": { "$ref": "#/components/schemas/CustomDomainMapping" }, "description": "null when no custom domain is attached" } }, "additionalProperties": true },
      "GoLiveExecuteRequest": { "type": "object", "additionalProperties": false, "required": ["production_domain"], "properties": { "production_domain": { "type": "string", "format": "hostname", "description": "The attached custom domain" }, "update_wordpress": { "type": "boolean", "description": "Rewrite the WordPress site URL and content to the new domain" }, "keep_staging_domain": { "type": "boolean", "description": "Keep the platform subdomain serving the site; defaults to true" } } },
      "GoLiveStep": { "type": "object", "additionalProperties": false, "required": ["name", "status"], "properties": { "name": { "type": "string", "enum": ["verify_dns", "create_ingress", "update_database", "update_wordpress", "search_replace_content", "update_annotation", "verify_site"] }, "status": { "type": "string", "enum": ["pending", "in_progress", "completed", "failed"] }, "message": { "type": "string" } } },
      "GoLiveExecuteResponse": { "type": "object", "additionalProperties": false, "required": ["success", "message"], "properties": { "success": { "type": "boolean" }, "tenant_id": { "type": "string" }, "old_domain": { "type": "string" }, "new_domain": { "type": "string" }, "steps": { "type": ["array", "null"], "items": { "$ref": "#/components/schemas/GoLiveStep" } }, "message": { "type": "string" } } },
      "Error": { "type": "object", "required": ["error"], "properties": { "error": { "type": "string" }, "message": { "type": "string" } }, "additionalProperties": true }
    }
  }
}
