{
  "openapi": "3.1.0",
  "info": {
    "title": "Mashilo Digital Content API",
    "version": "1.0.0",
    "summary": "Read-only access to Mashilo Digital's published services, industries, case studies and blog.",
    "description": "A public, read-only JSON API over the content Mashilo Digital publishes on mashilodigital.co.za. No API key, no account, no authentication. Every response is `application/json; charset=UTF-8`. Error responses use a consistent envelope: `{ \"code\": <machine-readable slug>, \"message\": <human-readable text>, \"data\": { \"status\": <http status> } }`.",
    "termsOfService": "https://mashilodigital.co.za/privacy-policy/",
    "contact": {
      "name": "Mashilo Digital",
      "email": "info@mashilodigital.co.za",
      "url": "https://mashilodigital.co.za/contact-us/"
    },
    "license": {
      "name": "All rights reserved",
      "url": "https://mashilodigital.co.za/privacy-policy/"
    }
  },
  "servers": [
    {
      "url": "https://mashilodigital.co.za",
      "description": "Production"
    }
  ],
  "tags": [
    { "name": "Services", "description": "Service lines Mashilo Digital sells." },
    { "name": "Industries", "description": "Industries with dedicated coverage." },
    { "name": "Proof", "description": "Case studies and published outcome reporting." },
    { "name": "Editorial", "description": "Blog posts and long-form content." },
    { "name": "Meta", "description": "Discovery and taxonomy." }
  ],
  "security": [],
  "paths": {
    "/wp-json/wp/v2/types": {
      "get": {
        "operationId": "listContentTypes",
        "summary": "List content types",
        "description": "Returns every post type exposed by the API, including custom types. Useful for discovering what can be queried.",
        "tags": ["Meta"],
        "security": [],
        "responses": {
          "200": {
            "description": "A map of post type slug to its schema.",
            "content": {
              "application/json": {
                "schema": { "type": "object", "additionalProperties": true }
              }
            }
          },
          "default": { "$ref": "#/components/responses/Error" }
        }
      }
    },
    "/wp-json/wp/v2/categories": {
      "get": {
        "operationId": "listCategories",
        "summary": "List categories",
        "description": "All category terms, with id, name, slug, description, parent and post count.",
        "tags": ["Meta"],
        "security": [],
        "parameters": [
          { "$ref": "#/components/parameters/page" },
          { "$ref": "#/components/parameters/per_page" },
          { "$ref": "#/components/parameters/search" }
        ],
        "responses": {
          "200": {
            "description": "Array of category terms.",
            "content": {
              "application/json": {
                "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Term" } }
              }
            }
          },
          "default": { "$ref": "#/components/responses/Error" }
        }
      }
    },
    "/wp-json/wp/v2/pages": {
      "get": {
        "operationId": "listPages",
        "summary": "List published pages",
        "description": "Published WordPress pages, including the service pages, industry pages and contact page.",
        "tags": ["Services", "Industries", "Meta"],
        "security": [],
        "parameters": [
          { "$ref": "#/components/parameters/page" },
          { "$ref": "#/components/parameters/per_page" },
          { "$ref": "#/components/parameters/search" },
          { "$ref": "#/components/parameters/orderby" },
          {
            "name": "slug",
            "in": "query",
            "required": false,
            "description": "Filter by a single page slug.",
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": {
            "description": "Array of pages, newest first by default.",
            "content": {
              "application/json": {
                "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Page" } }
              }
            }
          },
          "default": { "$ref": "#/components/responses/Error" }
        }
      }
    },
    "/wp-json/wp/v2/posts": {
      "get": {
        "operationId": "listPosts",
        "summary": "List published posts",
        "description": "Published blog posts and long-form editorial content.",
        "tags": ["Editorial", "Proof"],
        "security": [],
        "parameters": [
          { "$ref": "#/components/parameters/page" },
          { "$ref": "#/components/parameters/per_page" },
          { "$ref": "#/components/parameters/search" },
          { "$ref": "#/components/parameters/orderby" },
          {
            "name": "categories",
            "in": "query",
            "required": false,
            "description": "Filter by category id. Multiple ids may be comma separated.",
            "schema": { "type": "integer" }
          }
        ],
        "responses": {
          "200": {
            "description": "Array of posts.",
            "content": {
              "application/json": {
                "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Post" } }
              }
            }
          },
          "default": { "$ref": "#/components/responses/Error" }
        }
      }
    },
    "/wp-json/wp/v2/posts/{id}": {
      "get": {
        "operationId": "getPost",
        "summary": "Get one post",
        "description": "A single published post by id.",
        "tags": ["Editorial"],
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Post id.",
            "schema": { "type": "integer" }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested post.",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/Post" } }
            }
          },
          "404": { "$ref": "#/components/responses/Error" },
          "default": { "$ref": "#/components/responses/Error" }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {},
    "parameters": {
      "page": {
        "name": "page",
        "in": "query",
        "required": false,
        "description": "1-based page number.",
        "schema": { "type": "integer", "minimum": 1, "default": 1 }
      },
      "per_page": {
        "name": "per_page",
        "in": "query",
        "required": false,
        "description": "Items per response, 1 to 100.",
        "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 10 }
      },
      "search": {
        "name": "search",
        "in": "query",
        "required": false,
        "description": "Full-text search across title and content.",
        "schema": { "type": "string" }
      },
      "orderby": {
        "name": "orderby",
        "in": "query",
        "required": false,
        "description": "Sort field.",
        "schema": { "type": "string", "enum": ["date", "id", "title", "slug", "modified"], "default": "date" }
      }
    },
    "responses": {
      "Error": {
        "description": "Error. The body always carries a machine-readable `code`, a human-readable `message`, and the HTTP `status`.",
        "content": {
          "application/json": { "schema": { "$ref": "#/components/schemas/Error" } }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": ["code", "message", "data"],
        "properties": {
          "code": {
            "type": "string",
            "description": "Machine-readable error slug, for example `rest_no_route`.",
            "examples": ["rest_no_route", "rest_post_invalid_id", "rest_invalid_param"]
          },
          "message": {
            "type": "string",
            "description": "Human-readable explanation of what went wrong."
          },
          "data": {
            "type": "object",
            "required": ["status"],
            "properties": {
              "status": { "type": "integer", "description": "HTTP status code." },
              "params": { "type": "array", "items": { "type": "string" } },
              "details": { "type": "object", "additionalProperties": true }
            }
          }
        }
      },
      "Rendered": {
        "type": "object",
        "properties": {
          "rendered": { "type": "string", "description": "HTML content." },
          "protected": { "type": "boolean" }
        }
      },
      "Term": {
        "type": "object",
        "properties": {
          "id": { "type": "integer" },
          "name": { "type": "string" },
          "slug": { "type": "string" },
          "description": { "type": "string" },
          "parent": { "type": "integer" },
          "count": { "type": "integer" }
        }
      },
      "Page": {
        "type": "object",
        "properties": {
          "id": { "type": "integer" },
          "date": { "type": "string", "format": "date-time" },
          "modified": { "type": "string", "format": "date-time" },
          "slug": { "type": "string" },
          "status": { "type": "string", "enum": ["publish", "draft", "pending", "private"] },
          "type": { "type": "string" },
          "link": { "type": "string", "format": "uri" },
          "title": { "$ref": "#/components/schemas/Rendered" },
          "content": { "$ref": "#/components/schemas/Rendered" },
          "excerpt": { "$ref": "#/components/schemas/Rendered" }
        }
      },
      "Post": {
        "type": "object",
        "properties": {
          "id": { "type": "integer" },
          "date": { "type": "string", "format": "date-time" },
          "modified": { "type": "string", "format": "date-time" },
          "slug": { "type": "string" },
          "status": { "type": "string", "enum": ["publish", "draft", "pending", "private"] },
          "link": { "type": "string", "format": "uri" },
          "title": { "$ref": "#/components/schemas/Rendered" },
          "content": { "$ref": "#/components/schemas/Rendered" },
          "excerpt": { "$ref": "#/components/schemas/Rendered" },
          "categories": { "type": "array", "items": { "type": "integer" } }
        }
      }
    }
  }
}
