{
    "openapi": "3.0.3",
    "info": {
        "title": "WordPress REST API \u2014 Posts and Pages",
        "version": "1.0.0",
        "description": "Official REST API and agent specification for esgabrielweb.com with scoped OAuth2 permissions, Idempotency-Key mutations, and sandbox support.",
        "contact": {
            "name": "Gabriel Ram\u00edrez",
            "url": "https://esgabrielweb.com/contactame/",
            "email": "hola@esgabrielweb.com"
        },
        "x-version-policy": "API follows SemVer 2.0. Deprecations are announced 180 days in advance via Deprecation and Sunset HTTP headers.",
        "x-payment-info": {
            "protocols": [
                "UCP",
                "ACP",
                "x402",
                "MPP"
            ],
            "currency": "USD",
            "checkout_url": "https://esgabrielweb.com/precios/",
            "discovery": "https://esgabrielweb.com/.well-known/ucp"
        }
    },
    "servers": [
        {
            "url": "https://esgabrielweb.com/wp-json",
            "description": "Production REST API Endpoint"
        },
        {
            "url": "https://esgabrielweb.com/api?sandbox=true",
            "description": "Isolated Sandbox Environment for Agent Testing"
        }
    ],
    "paths": {
        "/wp/v2/posts": {
            "get": {
                "operationId": "getPosts",
                "summary": "List WordPress Posts",
                "description": "Retrieve a list of published WordPress blog posts with optional search, pagination, and sorting filters.",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Current page of the collection.",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Maximum number of items to return in result set.",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 10,
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Limit results to those matching a string search query.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "slug",
                        "in": "query",
                        "description": "Limit results to posts matching a specific post slug.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "description": "Cursor token for cursor-based pagination.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Maximum number of items to return in cursor pagination.",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 10
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A list of post objects.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/Post"
                                    }
                                }
                            }
                        },
                        "headers": {
                            "RateLimit-Limit": {
                                "description": "Maximum requests allowed per window (e.g. 120/min).",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Remaining requests in the current window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the current rate limit window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "Retry-After": {
                                "description": "Seconds to wait before retrying when a 429 response is received.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "Deprecation": {
                                "description": "Indicates the endpoint or version is deprecated.",
                                "schema": {
                                    "type": "string"
                                }
                            },
                            "Sunset": {
                                "description": "HTTP date timestamp after which the endpoint will become permanently unavailable.",
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/wp/v2/posts/{id}": {
            "get": {
                "operationId": "getPost",
                "summary": "Get a Single Post",
                "description": "Retrieve a single WordPress post by its unique numeric ID.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Unique numeric identifier for the post.",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "description": "Cursor token for cursor-based pagination.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Maximum number of items to return in cursor pagination.",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 10
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Post details.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Post"
                                }
                            }
                        },
                        "headers": {
                            "RateLimit-Limit": {
                                "description": "Maximum requests allowed per window (e.g. 120/min).",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Remaining requests in the current window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the current rate limit window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "Retry-After": {
                                "description": "Seconds to wait before retrying when a 429 response is received.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "Deprecation": {
                                "description": "Indicates the endpoint or version is deprecated.",
                                "schema": {
                                    "type": "string"
                                }
                            },
                            "Sunset": {
                                "description": "HTTP date timestamp after which the endpoint will become permanently unavailable.",
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Post not found.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/wp/v2/pages": {
            "get": {
                "operationId": "getPages",
                "summary": "List WordPress Pages",
                "description": "Retrieve a list of published WordPress pages with optional search and pagination parameters.",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Current page of the collection.",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 1,
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "description": "Maximum number of items to return in result set.",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 10,
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Limit results to pages matching a string query.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "slug",
                        "in": "query",
                        "description": "Limit results to pages matching a specific slug.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "description": "Cursor token for cursor-based pagination.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Maximum number of items to return in cursor pagination.",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 10
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "A list of page objects.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/Page"
                                    }
                                }
                            }
                        },
                        "headers": {
                            "RateLimit-Limit": {
                                "description": "Maximum requests allowed per window (e.g. 120/min).",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Remaining requests in the current window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the current rate limit window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "Retry-After": {
                                "description": "Seconds to wait before retrying when a 429 response is received.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "Deprecation": {
                                "description": "Indicates the endpoint or version is deprecated.",
                                "schema": {
                                    "type": "string"
                                }
                            },
                            "Sunset": {
                                "description": "HTTP date timestamp after which the endpoint will become permanently unavailable.",
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/wp/v2/pages/{id}": {
            "get": {
                "operationId": "getPage",
                "summary": "Get a Single Page",
                "description": "Retrieve a single WordPress page by its unique numeric ID.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "description": "Unique numeric identifier for the page.",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "cursor",
                        "in": "query",
                        "description": "Cursor token for cursor-based pagination.",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Maximum number of items to return in cursor pagination.",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "default": 10
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Page details.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Page"
                                }
                            }
                        },
                        "headers": {
                            "RateLimit-Limit": {
                                "description": "Maximum requests allowed per window (e.g. 120/min).",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Remaining requests in the current window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the current rate limit window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "Retry-After": {
                                "description": "Seconds to wait before retrying when a 429 response is received.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "Deprecation": {
                                "description": "Indicates the endpoint or version is deprecated.",
                                "schema": {
                                    "type": "string"
                                }
                            },
                            "Sunset": {
                                "description": "HTTP date timestamp after which the endpoint will become permanently unavailable.",
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Page not found.",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/wp/v2/contact": {
            "post": {
                "summary": "Submit Contact Inquiry (Idempotent)",
                "description": "Submit a new web development project inquiry or consultation request with Idempotency-Key support to avoid duplicate submissions on retries.",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "description": "Unique client-generated UUID token ensuring identical retries produce the exact same outcome without duplication.",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "example": "Empresa Demo"
                                    },
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "example": "cliente@ejemplo.com"
                                    },
                                    "message": {
                                        "type": "string",
                                        "example": "Interesado en Plan Corporativo de $350."
                                    },
                                    "service": {
                                        "type": "string",
                                        "example": "Sitio Web Corporativo"
                                    }
                                },
                                "required": [
                                    "name",
                                    "email",
                                    "message"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Inquiry received successfully.",
                        "headers": {
                            "RateLimit-Limit": {
                                "description": "Maximum requests allowed per window (e.g. 120/min).",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Remaining requests in the current window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the current rate limit window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "Retry-After": {
                                "description": "Seconds to wait before retrying when a 429 response is received.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "Deprecation": {
                                "description": "Indicates the endpoint or version is deprecated.",
                                "schema": {
                                    "type": "string"
                                }
                            },
                            "Sunset": {
                                "description": "HTTP date timestamp after which the endpoint will become permanently unavailable.",
                                "schema": {
                                    "type": "string"
                                }
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "success": {
                                            "type": "boolean"
                                        },
                                        "inquiry_id": {
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Validation Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        }
                    }
                },
                "operationId": "submitContactForm"
            }
        },
        "/wp/v2/batch": {
            "post": {
                "summary": "Batch REST Operations",
                "description": "Execute multiple read or write requests in a single round-trip HTTP request, reducing network latency for autonomous agents.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "requests": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "method": {
                                                    "type": "string",
                                                    "enum": [
                                                        "GET",
                                                        "POST"
                                                    ]
                                                },
                                                "path": {
                                                    "type": "string"
                                                },
                                                "body": {
                                                    "type": "object"
                                                }
                                            },
                                            "required": [
                                                "method",
                                                "path"
                                            ]
                                        }
                                    }
                                },
                                "required": [
                                    "requests"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Array of batch operation responses.",
                        "headers": {
                            "RateLimit-Limit": {
                                "description": "Maximum requests allowed per window (e.g. 120/min).",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Remaining requests in the current window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the current rate limit window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "Retry-After": {
                                "description": "Seconds to wait before retrying when a 429 response is received.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "Deprecation": {
                                "description": "Indicates the endpoint or version is deprecated.",
                                "schema": {
                                    "type": "string"
                                }
                            },
                            "Sunset": {
                                "description": "HTTP date timestamp after which the endpoint will become permanently unavailable.",
                                "schema": {
                                    "type": "string"
                                }
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "responses": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "operationId": "executeBatchOperations"
            }
        },
        "/wp/v2/jobs": {
            "post": {
                "summary": "Submit Asynchronous Long-Running Task",
                "description": "Submits long-running tasks (such as deep WPO audits or full site sitemap re-indexing). Returns 202 Accepted with a Location header pointing to polling status.",
                "responses": {
                    "202": {
                        "description": "Task accepted for background processing.",
                        "headers": {
                            "RateLimit-Limit": {
                                "description": "Maximum requests allowed per window (e.g. 120/min).",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Remaining": {
                                "description": "Remaining requests in the current window.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "RateLimit-Reset": {
                                "description": "Seconds until the current rate limit window resets.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "Retry-After": {
                                "description": "Seconds to wait before retrying when a 429 response is received.",
                                "schema": {
                                    "type": "integer"
                                }
                            },
                            "Deprecation": {
                                "description": "Indicates the endpoint or version is deprecated.",
                                "schema": {
                                    "type": "string"
                                }
                            },
                            "Sunset": {
                                "description": "HTTP date timestamp after which the endpoint will become permanently unavailable.",
                                "schema": {
                                    "type": "string"
                                }
                            },
                            "Location": {
                                "description": "Polling URL to check the current status and output of the asynchronous job.",
                                "schema": {
                                    "type": "string",
                                    "example": "https://esgabrielweb.com/wp-json/wp/v2/jobs/job_9845"
                                }
                            }
                        },
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "job_id": {
                                            "type": "string",
                                            "example": "job_9845"
                                        },
                                        "status": {
                                            "type": "string",
                                            "example": "processing"
                                        },
                                        "check_url": {
                                            "type": "string",
                                            "example": "https://esgabrielweb.com/wp-json/wp/v2/jobs/job_9845"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "operationId": "createAsyncJob"
            }
        }
    },
    "components": {
        "securitySchemes": {
            "OAuth2": {
                "type": "oauth2",
                "description": "RFC 8414 OAuth 2.0 with WorkOS agent_auth and PKCE S256 support.",
                "flows": {
                    "clientCredentials": {
                        "tokenUrl": "https://esgabrielweb.com/oauth/token",
                        "scopes": {
                            "read:posts": "Read blog posts, categories, and author metadata",
                            "read:pages": "Read published pages and Elementor structure",
                            "read:services": "Read web design, WooCommerce and WPO pricing",
                            "write:contact": "Submit inquiries and project requests",
                            "mcp:tools": "Invoke Model Context Protocol automation tools"
                        }
                    },
                    "authorizationCode": {
                        "authorizationUrl": "https://esgabrielweb.com/oauth/authorize",
                        "tokenUrl": "https://esgabrielweb.com/oauth/token",
                        "scopes": {
                            "read:posts": "Read blog posts, categories, and author metadata",
                            "read:pages": "Read published pages and Elementor structure",
                            "read:services": "Read web design, WooCommerce and WPO pricing",
                            "write:contact": "Submit inquiries and project requests",
                            "mcp:tools": "Invoke Model Context Protocol automation tools"
                        }
                    }
                }
            },
            "ApplicationPasswords": {
                "type": "http",
                "scheme": "basic",
                "description": "WordPress Application Passwords for direct administrative and developer tools."
            }
        },
        "schemas": {
            "RenderedField": {
                "type": "object",
                "properties": {
                    "rendered": {
                        "type": "string"
                    }
                }
            },
            "Post": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "date": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "link": {
                        "type": "string",
                        "format": "uri"
                    },
                    "title": {
                        "$ref": "#/components/schemas/RenderedField"
                    },
                    "content": {
                        "$ref": "#/components/schemas/RenderedField"
                    },
                    "excerpt": {
                        "$ref": "#/components/schemas/RenderedField"
                    },
                    "author": {
                        "type": "integer"
                    },
                    "featured_media": {
                        "type": "integer"
                    }
                }
            },
            "Page": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "date": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "link": {
                        "type": "string",
                        "format": "uri"
                    },
                    "title": {
                        "$ref": "#/components/schemas/RenderedField"
                    },
                    "content": {
                        "$ref": "#/components/schemas/RenderedField"
                    },
                    "author": {
                        "type": "integer"
                    },
                    "parent": {
                        "type": "integer"
                    }
                }
            },
            "Error": {
                "type": "object",
                "properties": {
                    "code": {
                        "type": "string"
                    },
                    "message": {
                        "type": "string"
                    },
                    "data": {
                        "type": "object",
                        "properties": {
                            "status": {
                                "type": "integer"
                            }
                        }
                    }
                }
            },
            "ErrorResponse": {
                "type": "object",
                "properties": {
                    "error": {
                        "type": "string",
                        "example": "invalid_request"
                    },
                    "code": {
                        "type": "string",
                        "example": "rest_forbidden"
                    },
                    "message": {
                        "type": "string",
                        "example": "Invalid parameter or insufficient permissions."
                    },
                    "resolution_hint": {
                        "type": "string",
                        "example": "Obtain an authorized token from /oauth/token or check /auth.md."
                    }
                },
                "required": [
                    "code",
                    "message"
                ]
            }
        }
    }
}