{
    "openapi": "3.1.1",
    "info": {
        "title": "STEP BY STEP 3D Public API",
        "version": "1.0.0",
        "description": "Read-only public service discovery API for STEP BY STEP 3D. No authentication is required. API versioning and deprecation policy: major versions are explicit in the URL. A breaking change creates a new major version. Deprecated versions remain documented for at least 90 days before a Sunset date is announced.",
        "contact": {
            "url": "https://stepbystep3d.com/llms.txt"
        },
        "x-deprecation-policy": "https://stepbystep3d.com/api-versioning"
    },
    "servers": [
        {
            "url": "https://stepbystep3d.com/wp-json/stepbystep3d/v1",
            "description": "Production"
        }
    ],
    "paths": {
        "/status": {
            "get": {
                "operationId": "getPublicApiStatus",
                "summary": "Get public API discovery links.",
                "description": "Returns the API name, version, OpenAPI document, resource index, and service collection URL.",
                "responses": {
                    "200": {
                        "description": "Public API metadata.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Status"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/services": {
            "get": {
                "operationId": "listPublicServices",
                "summary": "List published Matterport and real-estate services.",
                "description": "Returns published STEP BY STEP 3D service pages with pagination and an optional service-type filter.",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "One-based result page.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Maximum results per page.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100,
                            "default": 20
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "description": "Optional published service type.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "matterport",
                                "real-estate"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A paginated public service collection.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ServiceCollection"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Invalid request parameter.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/services/{serviceId}": {
            "get": {
                "operationId": "getPublicService",
                "summary": "Get one published service.",
                "description": "Returns a public service by its published WordPress post identifier.",
                "parameters": [
                    {
                        "name": "serviceId",
                        "in": "path",
                        "required": true,
                        "description": "Published service identifier.",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Published public service.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Service"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Service was not found.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "Status": {
                "type": "object",
                "required": [
                    "name",
                    "version",
                    "openapi",
                    "resources",
                    "serviceUrl"
                ],
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "version": {
                        "type": "string"
                    },
                    "openapi": {
                        "type": "string",
                        "format": "uri"
                    },
                    "resources": {
                        "type": "string",
                        "format": "uri"
                    },
                    "serviceUrl": {
                        "type": "string",
                        "format": "uri"
                    }
                }
            },
            "Service": {
                "type": "object",
                "required": [
                    "id",
                    "title",
                    "url",
                    "description",
                    "type",
                    "updatedAt"
                ],
                "properties": {
                    "id": {
                        "type": "integer",
                        "description": "Published WordPress service post identifier."
                    },
                    "title": {
                        "type": "string",
                        "description": "Published page title."
                    },
                    "url": {
                        "type": "string",
                        "format": "uri",
                        "description": "Canonical public service page URL."
                    },
                    "description": {
                        "type": "string",
                        "description": "Published WordPress excerpt."
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "matterport",
                            "real-estate"
                        ],
                        "description": "Published service page type."
                    },
                    "updatedAt": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Last published-content modification time."
                    },
                    "searchTerms": {
                        "type": "array",
                        "description": "Optional public service terms used to improve collection discovery.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "pageIdentity": {
                        "type": "object",
                        "description": "Canonical identity and the H1 rendered by the shared service template.",
                        "properties": {
                            "canonicalUrl": {
                                "type": "string",
                                "format": "uri"
                            },
                            "primaryHeading": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "headingElement": {
                                "type": "string",
                                "enum": [
                                    "h1"
                                ]
                            },
                            "source": {
                                "type": "string"
                            }
                        }
                    },
                    "serviceArea": {
                        "type": "object",
                        "description": "Published city/state service area; not an office or customer-property address.",
                        "properties": {
                            "meaning": {
                                "type": "string"
                            },
                            "city": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "state": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "displayName": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "geocodedQuery": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "coordinates": {
                                "type": [
                                    "object",
                                    "null"
                                ],
                                "properties": {
                                    "latitude": {
                                        "type": "number"
                                    },
                                    "longitude": {
                                        "type": "number"
                                    },
                                    "source": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    },
                    "locationContext": {
                        "type": "object",
                        "description": "City/state location terms and a Google Maps search URL. Coordinate resolution is explicitly labelled.",
                        "properties": {
                            "city": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "state": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "displayName": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "mapSearchUrl": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "uri"
                            },
                            "geocodingStatus": {
                                "type": "string",
                                "enum": [
                                    "coordinatesResolved",
                                    "cityStateTermsAvailable",
                                    "notAssigned"
                                ]
                            },
                            "meaning": {
                                "type": "string"
                            }
                        }
                    },
                    "visualLocationAsset": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "description": "Published map or visual location asset selected for the service page."
                    },
                    "heroCompanionMedia": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "description": "Published Matterport or companion media for the service-page hero."
                    },
                    "pricing": {
                        "type": "object",
                        "description": "Published pricing context. A detailed published catalog may be supplied for a service detail response.",
                        "properties": {
                            "publishedOnPage": {
                                "type": "boolean"
                            },
                            "sourceUrl": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "uri"
                            },
                            "currency": {
                                "type": "string"
                            },
                            "market": {
                                "type": "string"
                            },
                            "lastUpdated": {
                                "type": "string",
                                "format": "date-time"
                            },
                            "residentialOffers": {
                                "type": "array",
                                "description": "Published residential offers and price bands when available."
                            }
                        }
                    },
                    "pageContent": {
                        "type": "object",
                        "description": "Included on a service detail response; plain-text published content source."
                    },
                    "frequentlyAskedQuestions": {
                        "type": "object",
                        "description": "Included on a service detail response only when the canonical page publishes FAQPage schema.",
                        "properties": {
                            "sourceUrl": {
                                "type": "string",
                                "format": "uri"
                            },
                            "pageType": {
                                "type": "string",
                                "enum": [
                                    "matterport",
                                    "real-estate"
                                ]
                            },
                            "source": {
                                "type": "string",
                                "enum": [
                                    "publishedFAQPageSchema"
                                ]
                            },
                            "scope": {
                                "type": "string"
                            },
                            "items": {
                                "type": "array",
                                "items": {
                                    "type": "object",
                                    "required": [
                                        "question",
                                        "answer"
                                    ],
                                    "properties": {
                                        "question": {
                                            "type": "string"
                                        },
                                        "answer": {
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "ServiceCollection": {
                "type": "object",
                "required": [
                    "items",
                    "page",
                    "perPage",
                    "total",
                    "totalPages"
                ],
                "properties": {
                    "items": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Service"
                        }
                    },
                    "page": {
                        "type": "integer"
                    },
                    "perPage": {
                        "type": "integer"
                    },
                    "total": {
                        "type": "integer"
                    },
                    "totalPages": {
                        "type": "integer"
                    }
                }
            },
            "Error": {
                "type": "object",
                "required": [
                    "error"
                ],
                "properties": {
                    "error": {
                        "type": "object",
                        "required": [
                            "code",
                            "message",
                            "hint"
                        ],
                        "properties": {
                            "code": {
                                "type": "string"
                            },
                            "message": {
                                "type": "string"
                            },
                            "hint": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        }
    }
}