{
    "openapi": "3.0.3",
    "info": {
        "title": "YRUZ API",
        "version": "4.2.1",
        "description": "YRUZ social network APIs: REST (mobile/integrations), Legacy OAuth (third-party apps), Citations feed (AI crawlers), and internal AJAX (web UI).",
        "contact": {
            "email": "zanto@yruz.one"
        }
    },
    "servers": [
        {
            "url": "https://yruz.one"
        }
    ],
    "security": [
        {
            "ApiKeyAuth": []
        }
    ],
    "components": {
        "securitySchemes": {
            "ApiKeyAuth": {
                "type": "apiKey",
                "in": "header",
                "name": "X-API-Key",
                "description": "Plus X-Signature (HMAC-SHA256 of X-Timestamp with the API secret) and X-Timestamp (unix, \u00b1300s)."
            },
            "SessionAuth": {
                "type": "apiKey",
                "in": "cookie",
                "name": "c_user",
                "description": "Logged-in session cookies + X-Requested-With: XMLHttpRequest header (AJAX only)."
            },
            "OAuth2": {
                "type": "oauth2",
                "flows": {
                    "authorizationCode": {
                        "authorizationUrl": "https://yruz.one/api/oauth",
                        "tokenUrl": "https://yruz.one/api/authorize",
                        "scopes": []
                    }
                }
            }
        },
        "schemas": {
            "Success": {
                "type": "object",
                "properties": {
                    "status": {
                        "type": "string",
                        "example": "success"
                    },
                    "message": {
                        "type": "string"
                    },
                    "data": {
                        "type": "object"
                    },
                    "has_more": {
                        "type": "boolean"
                    },
                    "timestamp": {
                        "type": "string"
                    }
                }
            },
            "ApiError": {
                "type": "object",
                "properties": {
                    "status": {
                        "type": "string",
                        "example": "error"
                    },
                    "message": {
                        "type": "string"
                    },
                    "timestamp": {
                        "type": "string"
                    }
                }
            }
        }
    },
    "paths": {
        "/apis/php/ping": {
            "get": {
                "tags": [
                    "Core"
                ],
                "summary": "Health check",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "pong",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Success"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/apis/php/auth/signup": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Register a new user account",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "username",
                                    "email",
                                    "password",
                                    "first_name",
                                    "last_name",
                                    "gender",
                                    "device_type"
                                ],
                                "properties": {
                                    "username": {
                                        "type": "string"
                                    },
                                    "email": {
                                        "type": "string"
                                    },
                                    "password": {
                                        "type": "string"
                                    },
                                    "first_name": {
                                        "type": "string"
                                    },
                                    "last_name": {
                                        "type": "string"
                                    },
                                    "gender": {
                                        "type": "string"
                                    },
                                    "device_type": {
                                        "type": "string",
                                        "enum": [
                                            "A",
                                            "I"
                                        ]
                                    },
                                    "device_os_version": {
                                        "type": "string"
                                    },
                                    "device_name": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Registered",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Success"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/apis/php/auth/signin": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Sign in (sets session cookies; may return two_factor_key)",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "username_email",
                                    "password"
                                ],
                                "properties": {
                                    "username_email": {
                                        "type": "string"
                                    },
                                    "password": {
                                        "type": "string"
                                    },
                                    "device_type": {
                                        "type": "string"
                                    },
                                    "device_os_version": {
                                        "type": "string"
                                    },
                                    "device_name": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Signed in",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Success"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/apis/php/auth/two_factor_authentication": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Verify 2FA code",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "two_factor_key",
                                    "user_id"
                                ],
                                "properties": {
                                    "two_factor_key": {
                                        "type": "string"
                                    },
                                    "user_id": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Verified",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Success"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/apis/php/auth/signout": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Destroy session",
                "responses": {
                    "200": {
                        "description": "Signed out"
                    }
                }
            }
        },
        "/apis/php/auth/forget_password": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Request password reset",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "email"
                                ],
                                "properties": {
                                    "email": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Reset initiated"
                    }
                }
            }
        },
        "/apis/php/auth/forget_password_confirm": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Confirm reset code",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "email": {
                                        "type": "string"
                                    },
                                    "reset_key": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Confirmed"
                    }
                }
            }
        },
        "/apis/php/auth/forget_password_reset": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Set new password",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "email": {
                                        "type": "string"
                                    },
                                    "reset_key": {
                                        "type": "string"
                                    },
                                    "password": {
                                        "type": "string"
                                    },
                                    "confirm": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Password set"
                    }
                }
            }
        },
        "/apis/php/auth/activation": {
            "post": {
                "tags": [
                    "Auth"
                ],
                "summary": "Activate account with code",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "code": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Activated"
                    }
                }
            }
        },
        "/apis/php/app/settings": {
            "get": {
                "tags": [
                    "App"
                ],
                "summary": "System (+user, if logged in) settings. Public.",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Settings",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Success"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/apis/php/app/contact_us": {
            "post": {
                "tags": [
                    "App"
                ],
                "summary": "Submit contact form. Public.",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "name",
                                    "email",
                                    "subject",
                                    "message"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string"
                                    },
                                    "email": {
                                        "type": "string"
                                    },
                                    "subject": {
                                        "type": "string"
                                    },
                                    "message": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Sent"
                    }
                }
            }
        },
        "/apis/php/app/static_pages": {
            "get": {
                "tags": [
                    "App"
                ],
                "summary": "List static pages. Public.",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Pages"
                    }
                }
            }
        },
        "/apis/php/app/static_pages/{page_url}": {
            "get": {
                "tags": [
                    "App"
                ],
                "summary": "Get one static page. Public.",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "page_url",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Page"
                    }
                }
            }
        },
        "/apis/php/app/genders": {
            "get": {
                "tags": [
                    "App"
                ],
                "summary": "List genders. Public.",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Genders"
                    }
                }
            }
        },
        "/apis/php/app/user_groups": {
            "get": {
                "tags": [
                    "App"
                ],
                "summary": "List user groups. Public.",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Groups"
                    }
                }
            }
        },
        "/apis/php/app/languages": {
            "get": {
                "tags": [
                    "App"
                ],
                "summary": "List languages. Public.",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Languages"
                    }
                }
            }
        },
        "/apis/php/app/countries": {
            "get": {
                "tags": [
                    "App"
                ],
                "summary": "List countries. Public.",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Countries"
                    }
                }
            }
        },
        "/apis/php/app/custom_fields": {
            "get": {
                "tags": [
                    "App"
                ],
                "summary": "List profile fields. Public.",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Fields"
                    }
                }
            }
        },
        "/apis/php/app/categories": {
            "get": {
                "tags": [
                    "App"
                ],
                "summary": "List categories by type",
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "get",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "example": "blogs"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Categories"
                    }
                }
            }
        },
        "/apis/php/user/connect": {
            "post": {
                "tags": [
                    "User"
                ],
                "summary": "Follow/friend/unfriend",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "do": {
                                        "type": "string"
                                    },
                                    "id": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Done"
                    }
                }
            }
        },
        "/apis/php/user/image_delete": {
            "post": {
                "tags": [
                    "User"
                ],
                "summary": "Delete avatar or cover",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "handle": {
                                        "type": "string",
                                        "enum": [
                                            "picture",
                                            "cover"
                                        ]
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Deleted"
                    }
                }
            }
        },
        "/apis/php/user/onesignal": {
            "post": {
                "tags": [
                    "User"
                ],
                "summary": "Update push player ID",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "onesignal_id": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Updated"
                    }
                }
            }
        },
        "/apis/php/user/delete": {
            "post": {
                "tags": [
                    "User"
                ],
                "summary": "Delete own account (password required)",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "password": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Deleted"
                    }
                }
            }
        },
        "/apis/php/data/load": {
            "get": {
                "tags": [
                    "Data"
                ],
                "summary": "Paginated data (new_people)",
                "parameters": [
                    {
                        "name": "get",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Data"
                    }
                }
            }
        },
        "/apis/php/data/upload": {
            "post": {
                "tags": [
                    "Data"
                ],
                "summary": "Upload files (multipart, not JSON)",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Uploaded"
                    }
                }
            }
        },
        "/apis/php/data/delete": {
            "post": {
                "tags": [
                    "Data"
                ],
                "summary": "Delete uploaded file",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "src": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Deleted"
                    }
                }
            }
        },
        "/apis/php/data/reset": {
            "post": {
                "tags": [
                    "Data"
                ],
                "summary": "Reset counters",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "reset": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Reset"
                    }
                }
            }
        },
        "/apis/php/data/report": {
            "post": {
                "tags": [
                    "Data"
                ],
                "summary": "Report content",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "string"
                                    },
                                    "handle": {
                                        "type": "string"
                                    },
                                    "category": {
                                        "type": "string"
                                    },
                                    "reason": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Reported"
                    }
                }
            }
        },
        "/apis/php/chat/conversations": {
            "get": {
                "tags": [
                    "Chat"
                ],
                "summary": "List conversations",
                "parameters": [
                    {
                        "name": "offset",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Conversations"
                    }
                }
            }
        },
        "/apis/php/chat/conversation": {
            "get": {
                "tags": [
                    "Chat"
                ],
                "summary": "Get conversation by id or user",
                "parameters": [
                    {
                        "name": "conversation_id",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Conversation"
                    }
                }
            }
        },
        "/apis/php/chat/conversation/{id}": {
            "delete": {
                "tags": [
                    "Chat"
                ],
                "summary": "Delete conversation",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Deleted"
                    }
                }
            }
        },
        "/apis/php/chat/messages": {
            "get": {
                "tags": [
                    "Chat"
                ],
                "summary": "Messages in a conversation",
                "parameters": [
                    {
                        "name": "conversation_id",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "last_message_id",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Messages"
                    }
                }
            }
        },
        "/apis/php/chat/message": {
            "post": {
                "tags": [
                    "Chat"
                ],
                "summary": "Send message",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "conversation_id": {
                                        "type": "string"
                                    },
                                    "message": {
                                        "type": "string"
                                    },
                                    "photo": {
                                        "type": "string"
                                    },
                                    "video": {
                                        "type": "string"
                                    },
                                    "voice_note": {
                                        "type": "string"
                                    },
                                    "recipients": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Sent"
                    }
                }
            }
        },
        "/apis/php/chat/message/{id}": {
            "delete": {
                "tags": [
                    "Chat"
                ],
                "summary": "Delete message",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Deleted"
                    }
                }
            }
        },
        "/apis/php/chat/actions/typing": {
            "post": {
                "tags": [
                    "Chat"
                ],
                "summary": "Typing indicator",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "conversation_id": {
                                        "type": "string"
                                    },
                                    "is_typing": {
                                        "type": "boolean"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Broadcast"
                    }
                }
            }
        },
        "/apis/php/chat/actions/seen": {
            "post": {
                "tags": [
                    "Chat"
                ],
                "summary": "Mark seen",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "ids": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Seen"
                    }
                }
            }
        },
        "/apis/php/chat/actions/leave": {
            "post": {
                "tags": [
                    "Chat"
                ],
                "summary": "Leave group conversation",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "conversation_id": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Left"
                    }
                }
            }
        },
        "/apis/php/chat/reactions/react": {
            "post": {
                "tags": [
                    "Chat"
                ],
                "summary": "React/unreact",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "do": {
                                        "type": "string"
                                    },
                                    "message_id": {
                                        "type": "string"
                                    },
                                    "reaction": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Reacted"
                    }
                }
            }
        },
        "/apis/php/chat/reactions/who_reacts": {
            "get": {
                "tags": [
                    "Chat"
                ],
                "summary": "Who reacted",
                "parameters": [
                    {
                        "name": "message_id",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Users"
                    }
                }
            }
        },
        "/apis/php/chat/calls": {
            "get": {
                "tags": [
                    "Chat"
                ],
                "summary": "Call history",
                "responses": {
                    "200": {
                        "description": "Calls"
                    }
                }
            }
        },
        "/apis/php/chat/contacts": {
            "get": {
                "tags": [
                    "Chat"
                ],
                "summary": "Messaging contacts",
                "parameters": [
                    {
                        "name": "query",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contacts"
                    }
                }
            }
        },
        "/apis/php/monetization/monetization_plans": {
            "get": {
                "tags": [
                    "Monetization"
                ],
                "summary": "List plans",
                "responses": {
                    "200": {
                        "description": "Plans"
                    }
                }
            },
            "post": {
                "tags": [
                    "Monetization"
                ],
                "summary": "Create plan (can_monetize_content required)",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "node_id": {
                                        "type": "string"
                                    },
                                    "node_type": {
                                        "type": "string"
                                    },
                                    "title": {
                                        "type": "string"
                                    },
                                    "price": {
                                        "type": "string"
                                    },
                                    "period_num": {
                                        "type": "string"
                                    },
                                    "period": {
                                        "type": "string"
                                    },
                                    "custom_description": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Created"
                    }
                }
            }
        },
        "/apis/php/monetization/monetization_plans/{id}": {
            "get": {
                "tags": [
                    "Monetization"
                ],
                "summary": "Get plan",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Plan"
                    }
                }
            },
            "put": {
                "tags": [
                    "Monetization"
                ],
                "summary": "Update plan",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Updated"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Monetization"
                ],
                "summary": "Delete plan",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Deleted"
                    }
                }
            }
        },
        "/api/oauth": {
            "get": {
                "tags": [
                    "LegacyOAuth"
                ],
                "summary": "Begin OAuth authorization (login + approve)",
                "security": [],
                "parameters": [
                    {
                        "name": "app_id",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "302": {
                        "description": "Redirect with auth_key (or login page)"
                    }
                }
            }
        },
        "/api/authorize": {
            "post": {
                "tags": [
                    "LegacyOAuth"
                ],
                "summary": "Exchange auth_key for access_token (1-minute TTL)",
                "security": [],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/x-www-form-urlencoded": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "app_id",
                                    "app_secret",
                                    "auth_key"
                                ],
                                "properties": {
                                    "app_id": {
                                        "type": "string"
                                    },
                                    "app_secret": {
                                        "type": "string"
                                    },
                                    "auth_key": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Token",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "access_token": {
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/get_user_info": {
            "get": {
                "tags": [
                    "LegacyOAuth"
                ],
                "summary": "Authorized user profile",
                "security": [],
                "parameters": [
                    {
                        "name": "access_token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Profile"
                    }
                }
            }
        },
        "/citations": {
            "get": {
                "tags": [
                    "Citations"
                ],
                "summary": "Machine index for AI crawlers (no auth, CORS-open, 10-min cache)",
                "security": [],
                "responses": {
                    "200": {
                        "description": "Index with counts, endpoints, sitemaps"
                    }
                }
            }
        },
        "/citations?type=questions": {
            "get": {
                "tags": [
                    "Citations"
                ],
                "summary": "Latest 50 questions with QAPage URLs (&solved=1 for solved only)",
                "security": [],
                "responses": {
                    "200": {
                        "description": "Questions"
                    }
                }
            }
        },
        "/citations?type=glossary": {
            "get": {
                "tags": [
                    "Citations"
                ],
                "summary": "All glossary terms with DefinedTerm URLs",
                "security": [],
                "responses": {
                    "200": {
                        "description": "Terms"
                    }
                }
            }
        },
        "/citations?type=blogs": {
            "get": {
                "tags": [
                    "Citations"
                ],
                "summary": "Latest 50 blogs with Article URLs",
                "security": [],
                "responses": {
                    "200": {
                        "description": "Blogs"
                    }
                }
            }
        },
        "/agent/identity": {
            "post": {
                "tags": [
                    "Agents"
                ],
                "summary": "Register anonymous agent identity, returns identity_assertion + claim_token",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "enum": [
                                            "anonymous"
                                        ]
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "identity_assertion (JWT) + claim_token + endpoints"
                    }
                }
            }
        },
        "/agent/identity/claim": {
            "post": {
                "tags": [
                    "Agents"
                ],
                "summary": "Start claim ceremony, returns user_code + verification_uri",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "claim_token": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "user_code + verification_uri"
                    }
                }
            }
        },
        "/oauth2/token": {
            "post": {
                "tags": [
                    "Agents"
                ],
                "summary": "jwt-bearer or claim grant, returns Bearer access_token",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "grant_type": {
                                        "type": "string"
                                    },
                                    "assertion": {
                                        "type": "string"
                                    },
                                    "claim_token": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "access_token or authorization_pending"
                    }
                }
            }
        },
        "/oauth2/revoke": {
            "post": {
                "tags": [
                    "Agents"
                ],
                "summary": "Revoke an agent access token",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "token": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "revoked flag"
                    }
                }
            }
        },
        "/claim": {
            "get": {
                "tags": [
                    "Agents"
                ],
                "summary": "User-facing claim approval page (login required)",
                "security": [],
                "responses": {
                    "200": {
                        "description": "Approval UI"
                    }
                }
            }
        },
        "/a2a": {
            "post": {
                "tags": [
                    "Agents"
                ],
                "summary": "A2A JSON-RPC: message/send, tasks/get, tasks/list, tasks/cancel (Bearer agent token)",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "jsonrpc": {
                                        "type": "string"
                                    },
                                    "id": {
                                        "type": "integer"
                                    },
                                    "method": {
                                        "type": "string"
                                    },
                                    "params": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "JSON-RPC result or error"
                    }
                }
            }
        }
    }
}