{
  "openapi": "3.1.0",
  "info": {
    "title": "Jetonomy REST API",
    "version": "1.9.7",
    "description": "Machine-readable OpenAPI 3.1 contract for the Jetonomy WordPress forum plugin (free core + Pro extensions). Built from the plugin's rest-api-reference.md, which was in turn generated by reading every register_rest_route() call in the source.\n\n**Authentication.** Two modes, both funnelled through REST_Auth::auth_mutation(): (1) Cookie + `X-WP-Nonce` header (the web app) - every mutation needs a valid `wp_rest` nonce; get a fresh one from `GET /auth/nonce`. (2) Application Passwords via HTTP Basic (mobile app + integrations), which skip the nonce check. Both modes enforce ban/silence and pending-email-verification gates.\n\n**Namespaces.** Almost everything is under `jetonomy/v1`. Two Pro surfaces live under `jetonomy-pro/v1` (marked with a per-operation `servers` override): the Attachments routes (`/attachments*`) and the Site Announcements admin routes (`/site-announcements*`). The public announcement read (`/announcements/active`) stays on `jetonomy/v1`.\n\n**Private-community mode.** When Settings -> Community Access is `private`, every `GET` requires login; a logged-out read returns `401 community_private`.\n\n**Pagination.** Offset-based (`limit`/`offset`) on most lists, cursor-based (`after`/`before`) on posts/replies/messages. Collection bodies are `{ data: [...], meta: { count, has_more, cursor_next, total, offset } }`.",
    "contact": {
      "name": "Wbcom Designs",
      "url": "https://wbcomdesigns.com"
    },
    "license": {
      "name": "GPL-2.0-or-later"
    }
  },
  "servers": [
    {
      "url": "https://your-site.com/wp-json/jetonomy/v1",
      "description": "Jetonomy free core namespace (default for all routes unless a per-operation override says otherwise)"
    }
  ],
  "security": [
    {
      "cookieAuth": [],
      "nonceAuth": []
    },
    {
      "appPassword": []
    }
  ],
  "tags": [
    {
      "name": "Spaces",
      "description": "Sub-communities: create, membership, roles, invites, join requests."
    },
    {
      "name": "Posts",
      "description": "Topics/questions/ideas/status-updates nested under a space."
    },
    {
      "name": "Replies",
      "description": "Threaded replies (up to 3 levels) under a post."
    },
    {
      "name": "Users",
      "description": "Profiles, account management, mention typeahead."
    },
    {
      "name": "Blocks",
      "description": "Member-to-member blocking (1.8.0)."
    },
    {
      "name": "Auth",
      "description": "Login, registration, password reset, email verification, nonce."
    },
    {
      "name": "Notifications",
      "description": "In-app notifications."
    },
    {
      "name": "Subscriptions",
      "description": "Follow spaces and posts."
    },
    {
      "name": "Search",
      "description": "FULLTEXT search across posts, spaces, tags."
    },
    {
      "name": "Categories",
      "description": "Nested category taxonomy for spaces."
    },
    {
      "name": "Tags",
      "description": "Post tags (read-only)."
    },
    {
      "name": "Leaderboards",
      "description": "Reputation ranking."
    },
    {
      "name": "Bookmarks",
      "description": "Personal post bookmarks."
    },
    {
      "name": "Moderation",
      "description": "Queue, flags, bans, and space-scoped moderation."
    },
    {
      "name": "Media",
      "description": "Image uploads and the community media library."
    },
    {
      "name": "App Config",
      "description": "Mobile-app config and site admin utilities."
    },
    {
      "name": "Feed",
      "description": "Global home feed, activity polling, oEmbed."
    },
    {
      "name": "Private Messaging",
      "description": "Pro: direct and group conversations."
    },
    {
      "name": "Reactions",
      "description": "Pro: emoji reactions on posts and replies."
    },
    {
      "name": "Polls",
      "description": "Pro: polls attached to posts."
    },
    {
      "name": "Custom Fields",
      "description": "Pro: custom fields on posts, profiles, spaces."
    },
    {
      "name": "Custom Badges",
      "description": "Pro: configurable achievement badges."
    },
    {
      "name": "Webhooks",
      "description": "Pro: outbound HMAC-signed webhooks."
    },
    {
      "name": "White Label",
      "description": "Pro: branding overrides."
    },
    {
      "name": "Site Announcements",
      "description": "Pro: pinned site-wide announcements (namespace split)."
    },
    {
      "name": "Web Push",
      "description": "Pro: browser and native push notifications."
    },
    {
      "name": "AI",
      "description": "Pro: AI usage stats and reply suggestions."
    },
    {
      "name": "Advanced Moderation",
      "description": "Pro: automated moderation rules."
    },
    {
      "name": "Email Digest",
      "description": "Pro: digest preferences and admin stats."
    },
    {
      "name": "SEO Pro",
      "description": "Pro: per-space SEO metadata."
    },
    {
      "name": "Reply By Email",
      "description": "Pro: inbound email-to-reply webhook."
    },
    {
      "name": "Anonymous Posting",
      "description": "Pro: reveal the author of an anonymous item."
    },
    {
      "name": "Attachments",
      "description": "Pro: link/detach/download attachments (namespace split)."
    },
    {
      "name": "Analytics",
      "description": "Pro extension. Community analytics; requires manage_options."
    },
    {
      "name": "Learnomy",
      "description": "Pro extension. Learnomy course-discussion integration."
    },
    {
      "name": "Access Rules",
      "description": "Who may enter a space. Requires jetonomy_manage_spaces."
    }
  ],
  "paths": {
    "/access-rules/{id}": {
      "delete": {
        "tags": [
          "Access Rules"
        ],
        "summary": "Delete an access rule",
        "operationId": "deleteAccessRule",
        "description": "Removes the rule. Space visibility is not reverted. Requires `jetonomy_manage_spaces`.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/admin/digest/stats": {
      "get": {
        "tags": [
          "Email Digest"
        ],
        "summary": "Digest send stats",
        "operationId": "getDigestStats",
        "description": "Digest send statistics. Requires manage_options.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DigestStats"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/admin/digest/test": {
      "post": {
        "tags": [
          "Email Digest"
        ],
        "summary": "Send a test digest",
        "operationId": "sendTestDigest",
        "description": "Send a test digest to the caller. Requires manage_options.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/admin/recount": {
      "post": {
        "tags": [
          "App Config"
        ],
        "summary": "Rebuild counters",
        "operationId": "adminRecount",
        "description": "Rebuild denormalized counters. Requires manage_options.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/admin/users/trust-level": {
      "post": {
        "tags": [
          "App Config"
        ],
        "summary": "Bulk-set trust level",
        "operationId": "adminSetTrustLevel",
        "description": "Bulk-set trust level for users. Requires manage_options.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CountResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user_ids": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    }
                  },
                  "trust_level": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 5
                  }
                },
                "required": [
                  "user_ids",
                  "trust_level"
                ]
              }
            }
          }
        }
      }
    },
    "/ai/suggest-reply": {
      "post": {
        "tags": [
          "AI"
        ],
        "summary": "Suggest a reply draft",
        "operationId": "aiSuggestReply",
        "description": "Suggest a reply draft for a post. Login required and the caller must be able to read the post.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiSuggestion"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "post_id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "post_id"
                ]
              }
            }
          }
        }
      }
    },
    "/ai/usage": {
      "get": {
        "tags": [
          "AI"
        ],
        "summary": "AI usage stats",
        "operationId": "getAiUsage",
        "description": "AI usage statistics. Requires manage_options.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiUsage"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "day",
                "week",
                "month",
                "all"
              ],
              "default": "month"
            }
          }
        ]
      }
    },
    "/ai/usage/summary": {
      "get": {
        "tags": [
          "AI"
        ],
        "summary": "AI usage by provider",
        "operationId": "getAiUsageSummary",
        "description": "By-provider AI usage summary. Requires manage_options.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiUsageSummary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/analytics/diff-report": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Dual-path drift report",
        "operationId": "analyticsDiffReport",
        "description": "Per-metric drift comparing the direct-query path against the event-driven aggregate: returns from_query, from_events, drift_pct and within_tolerance. Diagnostic only - the dual-write path is opt-in and default OFF via the jetonomy_pro_analytics_dual_write filter. Requires `manage_options`.",
        "parameters": [
          {
            "name": "range",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "custom"
              ],
              "default": "30d"
            },
            "description": "Reporting window. Use `custom` with `start` and `end`."
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Start date (YYYY-MM-DD). Only with range=custom."
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "End date (YYYY-MM-DD). Only with range=custom."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "data": {}
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/analytics/engagement": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Engagement metrics",
        "operationId": "analyticsEngagement",
        "description": "Engagement rate, median reply time, unanswered percentage. Requires `manage_options`.",
        "parameters": [
          {
            "name": "range",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "custom"
              ],
              "default": "30d"
            },
            "description": "Reporting window. Use `custom` with `start` and `end`."
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Start date (YYYY-MM-DD). Only with range=custom."
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "End date (YYYY-MM-DD). Only with range=custom."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "data": {}
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/analytics/export": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Export analytics as CSV",
        "operationId": "analyticsExport",
        "description": "Streamed CSV download of the current window. Requires `manage_options`.",
        "parameters": [
          {
            "name": "range",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "custom"
              ],
              "default": "30d"
            },
            "description": "Reporting window. Use `custom` with `start` and `end`."
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Start date (YYYY-MM-DD). Only with range=custom."
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "End date (YYYY-MM-DD). Only with range=custom."
          }
        ],
        "responses": {
          "200": {
            "description": "CSV download",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/analytics/moderation": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Moderation statistics",
        "operationId": "analyticsModeration",
        "description": "Flags, bans, silences and spam volumes. Requires `manage_options`.",
        "parameters": [
          {
            "name": "range",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "custom"
              ],
              "default": "30d"
            },
            "description": "Reporting window. Use `custom` with `start` and `end`."
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Start date (YYYY-MM-DD). Only with range=custom."
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "End date (YYYY-MM-DD). Only with range=custom."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "data": {}
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/analytics/overview": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Analytics overview",
        "operationId": "analyticsOverview",
        "description": "Daily series plus period-over-period comparison. Requires `manage_options`.",
        "parameters": [
          {
            "name": "range",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "custom"
              ],
              "default": "30d"
            },
            "description": "Reporting window. Use `custom` with `start` and `end`."
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Start date (YYYY-MM-DD). Only with range=custom."
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "End date (YYYY-MM-DD). Only with range=custom."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "data": {}
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/analytics/top-contributors": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Top contributors",
        "operationId": "analyticsTopContributors",
        "description": "Members ranked by posts plus replies. Requires `manage_options`.",
        "parameters": [
          {
            "name": "range",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "custom"
              ],
              "default": "30d"
            },
            "description": "Reporting window. Use `custom` with `start` and `end`."
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Start date (YYYY-MM-DD). Only with range=custom."
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "End date (YYYY-MM-DD). Only with range=custom."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "data": {}
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/analytics/top-spaces": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Top spaces",
        "operationId": "analyticsTopSpaces",
        "description": "Spaces ranked by activity in the window. Requires `manage_options`.",
        "parameters": [
          {
            "name": "range",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "custom"
              ],
              "default": "30d"
            },
            "description": "Reporting window. Use `custom` with `start` and `end`."
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "Start date (YYYY-MM-DD). Only with range=custom."
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "End date (YYYY-MM-DD). Only with range=custom."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "data": {}
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/announcements/active": {
      "get": {
        "tags": [
          "Site Announcements"
        ],
        "summary": "Active announcements",
        "operationId": "getActiveAnnouncements",
        "description": "Public/app read of active pinned announcements. Public read. Served on the jetonomy/v1 namespace.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnnouncementCollection"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/anonymous/reveal": {
      "post": {
        "tags": [
          "Anonymous Posting"
        ],
        "summary": "Reveal anonymous author",
        "operationId": "revealAnonymousAuthor",
        "description": "Reveal the real author of an anonymous post/reply (audit-logged). Requires manage_options.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnonymousReveal"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "object_type": {
                    "type": "string",
                    "enum": [
                      "post",
                      "reply"
                    ]
                  },
                  "object_id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "object_type",
                  "object_id"
                ]
              }
            }
          }
        }
      }
    },
    "/app/config": {
      "get": {
        "tags": [
          "App Config"
        ],
        "summary": "App config",
        "operationId": "getAppConfig",
        "description": "Public branding + Pro feature flags for pre-login theming (mobile app). Public read.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppConfig"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/attachments": {
      "post": {
        "tags": [
          "Attachments"
        ],
        "summary": "Link an attachment",
        "operationId": "createAttachment",
        "description": "Link an uploaded WP media item to a post or reply. Requires the parent's write permission. Served on jetonomy-pro/v1.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Attachment"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "media_id": {
                    "type": "integer",
                    "description": "WP attachment (media) ID"
                  },
                  "object_type": {
                    "type": "string",
                    "enum": [
                      "post",
                      "reply"
                    ]
                  },
                  "object_id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "media_id",
                  "object_type",
                  "object_id"
                ]
              }
            }
          }
        },
        "servers": [
          {
            "url": "https://your-site.com/wp-json/jetonomy-pro/v1",
            "description": "Jetonomy Pro namespace"
          }
        ]
      }
    },
    "/attachments/batch": {
      "get": {
        "tags": [
          "Attachments"
        ],
        "summary": "Batch read attachments",
        "operationId": "batchAttachments",
        "description": "Batch read attachments for an admin content-view page. Requires manage_options. Served on jetonomy-pro/v1.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttachmentCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated link IDs"
          },
          {
            "name": "object_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "post",
                "reply"
              ]
            }
          },
          {
            "name": "object_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Comma-separated parent object IDs"
          }
        ],
        "servers": [
          {
            "url": "https://your-site.com/wp-json/jetonomy-pro/v1",
            "description": "Jetonomy Pro namespace"
          }
        ]
      }
    },
    "/attachments/{id}": {
      "delete": {
        "tags": [
          "Attachments"
        ],
        "summary": "Detach an attachment",
        "operationId": "deleteAttachment",
        "description": "Detach an attachment link (id = link_id, not the WP media ID). Requires the parent's write permission. Served on jetonomy-pro/v1.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The attachment link_id"
          }
        ],
        "servers": [
          {
            "url": "https://your-site.com/wp-json/jetonomy-pro/v1",
            "description": "Jetonomy Pro namespace"
          }
        ]
      }
    },
    "/attachments/{id}/download": {
      "get": {
        "tags": [
          "Attachments"
        ],
        "summary": "Download an attachment",
        "operationId": "downloadAttachment",
        "description": "Force-download an attachment (Content-Disposition). Public read following the parent's visibility. Served on jetonomy-pro/v1.",
        "responses": {
          "200": {
            "description": "Binary file stream"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The attachment link_id"
          }
        ],
        "servers": [
          {
            "url": "https://your-site.com/wp-json/jetonomy-pro/v1",
            "description": "Jetonomy Pro namespace"
          }
        ]
      }
    },
    "/auth/app-connect": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Mint an Application Password for a mobile app",
        "operationId": "authAppConnect",
        "description": "Mint step of the site app-connect bridge (Wbcom App Auth standard). Exchanges a live one-time bridge token, issued by a freshly rendered approve screen, for a WordPress Application Password returned INSIDE the app deep link.\n\n**Registered conditionally.** When BuddyNext is active it owns the single connect bridge for the site and Jetonomy joins its scheme allowlist instead - this route then does not exist and returns 404. That is the one-door rule: a second mint endpoint would be a second credential issuer to secure and audit.\n\n**Never redirects.** The credential comes back in the response body and the approve screen navigates client-side; a Location header carrying a credential would be written to proxy and access logs. The response is sent `Cache-Control: no-store`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "scheme",
                  "bridge_token"
                ],
                "properties": {
                  "scheme": {
                    "type": "string",
                    "description": "App URL scheme. Must be on the allowlist (jetonomy_app_connect_schemes); an unknown scheme is rejected 400 before anything is minted."
                  },
                  "bridge_token": {
                    "type": "string",
                    "description": "One-time token from the approve screen. Consumed on use; a replayed or forged token is rejected 410."
                  },
                  "app_name": {
                    "type": "string",
                    "description": "Device / app label shown on the credential."
                  },
                  "app_id": {
                    "type": "string",
                    "description": "Stable per-install UUID. On reconnect, credentials matching this app_id are replaced rather than stacked."
                  },
                  "state": {
                    "type": "string",
                    "description": "The app's own nonce, echoed verbatim in the deep link so the app can prove the redirect answers a flow it started."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Credential minted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "site_url": {
                      "type": "string"
                    },
                    "user_login": {
                      "type": "string"
                    },
                    "uuid": {
                      "type": "string"
                    },
                    "deep_link": {
                      "type": "string",
                      "description": "Scheme URL carrying the credential. Treat as secret."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Unrecognised app scheme (jetonomy_app_bad_scheme)"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "410": {
            "description": "Bridge token expired, already used, or not issued to this user (jetonomy_app_bridge_expired)"
          },
          "429": {
            "description": "More than 5 connection attempts in an hour (jetonomy_rate_limited)"
          }
        }
      }
    },
    "/auth/login": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Sign in",
        "operationId": "authLogin",
        "description": "Authenticate with username/email + password. Rate-limited 5/min per IP.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "username": {
                    "type": "string"
                  },
                  "password": {
                    "type": "string"
                  },
                  "remember": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "username",
                  "password"
                ]
              }
            }
          }
        },
        "security": []
      }
    },
    "/auth/lost-password": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Request a password reset",
        "operationId": "authLostPassword",
        "description": "Request a password reset email. Rate-limited 3/5min per IP.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user_login": {
                    "type": "string"
                  }
                },
                "required": [
                  "user_login"
                ]
              }
            }
          }
        },
        "security": []
      }
    },
    "/auth/nonce": {
      "get": {
        "tags": [
          "Auth"
        ],
        "summary": "Get a fresh nonce",
        "operationId": "authNonce",
        "description": "Return a fresh wp_rest nonce for the current session. Login required.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NonceResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/auth/register": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Register an account",
        "operationId": "authRegister",
        "description": "Create a new account (anti-spam gated). Rate-limited 5/min per IP.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "username": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "password": {
                    "type": "string"
                  }
                },
                "required": [
                  "username",
                  "email",
                  "password"
                ]
              }
            }
          }
        },
        "security": []
      }
    },
    "/auth/resend-verification": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Resend verification email",
        "operationId": "authResendVerification",
        "description": "Resend the email verification link. Rate-limited 3/5min per IP.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/auth/verify-email": {
      "get": {
        "tags": [
          "Auth"
        ],
        "summary": "Verify email",
        "operationId": "authVerifyEmail",
        "description": "Consume an email verification link.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "security": []
      }
    },
    "/badges": {
      "get": {
        "tags": [
          "Custom Badges"
        ],
        "summary": "List badges",
        "operationId": "listBadges",
        "description": "List active badges (paginated). Public read.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadgeCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ]
      },
      "post": {
        "tags": [
          "Custom Badges"
        ],
        "summary": "Create a badge",
        "operationId": "createBadge",
        "description": "Create a badge. Requires manage_options.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Badge"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BadgeCreate"
              }
            }
          }
        }
      }
    },
    "/badges/{id}": {
      "get": {
        "tags": [
          "Custom Badges"
        ],
        "summary": "Get a badge",
        "operationId": "getBadge",
        "description": "Get a badge (includes earned_count). Public read.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Badge"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      },
      "patch": {
        "tags": [
          "Custom Badges"
        ],
        "summary": "Update a badge",
        "operationId": "updateBadge",
        "description": "Update a badge. Requires manage_options.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Badge"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BadgeCreate"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Custom Badges"
        ],
        "summary": "Deactivate a badge",
        "operationId": "deleteBadge",
        "description": "Deactivate a badge. Requires manage_options.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/badges/{id}/award": {
      "post": {
        "tags": [
          "Custom Badges"
        ],
        "summary": "Manually award a badge",
        "operationId": "awardBadge",
        "description": "Manually award a badge to a user. Requires manage_options.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user_id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "user_id"
                ]
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Custom Badges"
        ],
        "summary": "Revoke a badge",
        "operationId": "revokeBadge",
        "description": "Revoke a manually-awarded badge. Requires manage_options.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user_id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "user_id"
                ]
              }
            }
          }
        }
      }
    },
    "/bookmarks": {
      "get": {
        "tags": [
          "Bookmarks"
        ],
        "summary": "List my bookmarks",
        "operationId": "listBookmarks",
        "description": "List the caller's bookmarked posts. Login required.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ]
      },
      "post": {
        "tags": [
          "Bookmarks"
        ],
        "summary": "Toggle a bookmark",
        "operationId": "toggleBookmark",
        "description": "Toggle a bookmark on a post. Login required.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookmarkResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "post_id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "post_id"
                ]
              }
            }
          }
        }
      }
    },
    "/bookmarks/{post_id}": {
      "delete": {
        "tags": [
          "Bookmarks"
        ],
        "summary": "Remove a bookmark",
        "operationId": "deleteBookmark",
        "description": "Remove a bookmark. Login required.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "parameters": [
          {
            "name": "post_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/categories": {
      "get": {
        "tags": [
          "Categories"
        ],
        "summary": "List categories",
        "operationId": "listCategories",
        "description": "List categories (nested). Public read.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CategoryCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "post": {
        "tags": [
          "Categories"
        ],
        "summary": "Create a category",
        "operationId": "createCategory",
        "description": "Create a category. Requires jetonomy_manage_categories.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Category"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CategoryCreate"
              }
            }
          }
        }
      }
    },
    "/categories/{id}": {
      "get": {
        "tags": [
          "Categories"
        ],
        "summary": "Get a category",
        "operationId": "getCategory",
        "description": "Fetch a single category. Public read.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Category"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      },
      "patch": {
        "tags": [
          "Categories"
        ],
        "summary": "Update a category",
        "operationId": "updateCategory",
        "description": "Update a category. Requires jetonomy_manage_categories.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Category"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CategoryCreate"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Categories"
        ],
        "summary": "Delete a category",
        "operationId": "deleteCategory",
        "description": "Delete a category. Requires jetonomy_manage_categories.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/conversations": {
      "get": {
        "tags": [
          "Private Messaging"
        ],
        "summary": "List conversations",
        "operationId": "listConversations",
        "description": "List the caller's conversations. Login required.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "archived",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Include archived"
          }
        ]
      },
      "post": {
        "tags": [
          "Private Messaging"
        ],
        "summary": "Start a conversation",
        "operationId": "createConversation",
        "description": "Start a new conversation. Requires trust level >= 1 (admins/mods bypass); a direct message requires a shared space and no active block.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversation"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "recipient_ids": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    }
                  },
                  "body": {
                    "type": "string"
                  }
                },
                "required": [
                  "recipient_ids",
                  "body"
                ]
              }
            }
          }
        }
      }
    },
    "/conversations/unread-count": {
      "get": {
        "tags": [
          "Private Messaging"
        ],
        "summary": "Unread message count",
        "operationId": "conversationsUnreadCount",
        "description": "Return the caller's unread conversation count (cached 30s). Login required.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CountResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/conversations/{id}": {
      "get": {
        "tags": [
          "Private Messaging"
        ],
        "summary": "Get a conversation",
        "operationId": "getConversation",
        "description": "Fetch a conversation. Requires participant.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversation"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      },
      "patch": {
        "tags": [
          "Private Messaging"
        ],
        "summary": "Mute a conversation",
        "operationId": "updateConversation",
        "description": "Update conversation state (e.g. mute). Requires participant.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversation"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "muted": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/conversations/{id}/archive": {
      "post": {
        "tags": [
          "Private Messaging"
        ],
        "summary": "Toggle archive",
        "operationId": "archiveConversation",
        "description": "Toggle archive on a conversation. Requires participant.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversation"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/conversations/{id}/block": {
      "post": {
        "tags": [
          "Private Messaging"
        ],
        "summary": "Block the other participant",
        "operationId": "blockConversation",
        "description": "Block the other side of a direct conversation. Requires participant.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversation"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/conversations/{id}/leave": {
      "post": {
        "tags": [
          "Private Messaging"
        ],
        "summary": "Leave a group conversation",
        "operationId": "leaveConversation",
        "description": "Leave a group conversation. Requires participant.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/conversations/{id}/messages": {
      "get": {
        "tags": [
          "Private Messaging"
        ],
        "summary": "List messages",
        "operationId": "listMessages",
        "description": "List messages in a conversation (cursor: before). Requires participant.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Cursor"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ]
      },
      "post": {
        "tags": [
          "Private Messaging"
        ],
        "summary": "Send a message",
        "operationId": "sendMessage",
        "description": "Send a message to a conversation. Requires participant and trust level >= 1.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "body": {
                    "type": "string"
                  }
                },
                "required": [
                  "body"
                ]
              }
            }
          }
        }
      }
    },
    "/conversations/{id}/mute": {
      "post": {
        "tags": [
          "Private Messaging"
        ],
        "summary": "Toggle mute",
        "operationId": "muteConversation",
        "description": "Toggle mute on a conversation. Requires participant.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversation"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/feed": {
      "get": {
        "tags": [
          "Feed"
        ],
        "summary": "Global home feed",
        "operationId": "getFeed",
        "description": "Global cross-space home feed. Public read (private-mode gated).",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "parameters": [
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "hot",
                "new",
                "top"
              ],
              "default": "hot"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/fields": {
      "get": {
        "tags": [
          "Custom Fields"
        ],
        "summary": "List custom fields",
        "operationId": "listFields",
        "description": "List custom field definitions. Public read.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "context",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "post",
                "profile",
                "space"
              ]
            }
          }
        ]
      },
      "post": {
        "tags": [
          "Custom Fields"
        ],
        "summary": "Create a custom field",
        "operationId": "createField",
        "description": "Create a custom field. Requires manage_options.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Field"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "slug": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "text",
                      "textarea",
                      "number",
                      "email",
                      "url",
                      "select",
                      "checkbox",
                      "radio",
                      "date"
                    ]
                  },
                  "context": {
                    "type": "string",
                    "enum": [
                      "post",
                      "profile",
                      "space"
                    ]
                  },
                  "options": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "required": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "label",
                  "type",
                  "context"
                ]
              }
            }
          }
        }
      }
    },
    "/fields/{id}": {
      "patch": {
        "tags": [
          "Custom Fields"
        ],
        "summary": "Update a custom field",
        "operationId": "updateField",
        "description": "Update a custom field. Requires manage_options.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Field"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Custom Fields"
        ],
        "summary": "Deactivate a custom field",
        "operationId": "deleteField",
        "description": "Deactivate a custom field. Requires manage_options.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/flags": {
      "post": {
        "tags": [
          "Moderation"
        ],
        "summary": "Report a post, reply, or user",
        "operationId": "createFlag",
        "description": "Files a flag into the moderation queue. Requires the jetonomy_flag capability (any member by default) plus a REST nonce. The silenced-gate runs in the handler. Rejects nonexistent targets (404 jetonomy_flag_target_missing), self-reports (400 jetonomy_flag_self), and duplicate reports by the same member on the same object (409 jetonomy_already_flagged).",
        "responses": {
          "201": {
            "description": "Flag created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "created": {
                      "type": "boolean"
                    },
                    "id": {
                      "type": "integer",
                      "description": "The new flag id"
                    }
                  },
                  "required": [
                    "created",
                    "id"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Self-report rejected (jetonomy_flag_self)"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "Target does not exist (jetonomy_flag_target_missing)"
          },
          "409": {
            "description": "Already reported by this member (jetonomy_already_flagged)"
          },
          "403": {
            "description": "Silenced members cannot report (code: silenced). Also returned for auth/capability failures."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "object_type": {
                    "type": "string",
                    "enum": [
                      "post",
                      "reply",
                      "user"
                    ]
                  },
                  "object_id": {
                    "type": "integer"
                  },
                  "reason": {
                    "type": "string",
                    "enum": [
                      "spam",
                      "offensive",
                      "off_topic",
                      "harassment",
                      "other"
                    ],
                    "description": "Why the content/user is being reported."
                  },
                  "description": {
                    "type": "string",
                    "description": "Optional free-text detail from the reporter."
                  }
                },
                "required": [
                  "object_type",
                  "object_id",
                  "reason"
                ]
              }
            }
          }
        }
      }
    },
    "/invite/{token}": {
      "get": {
        "tags": [
          "Spaces"
        ],
        "summary": "Accept an invite",
        "operationId": "acceptInvite",
        "description": "Resolve and accept a space invite token. Login required to join.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Membership"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/leaderboards": {
      "get": {
        "tags": [
          "Leaderboards"
        ],
        "summary": "Reputation ranking",
        "operationId": "getLeaderboards",
        "description": "Reputation ranking. Public read.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeaderboardResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "month",
                "week"
              ],
              "default": "all"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Default 20, capped 100"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/learnomy/course-discussion": {
      "post": {
        "tags": [
          "Learnomy"
        ],
        "summary": "Toggle a course discussion space",
        "operationId": "learnomySetCourseDiscussion",
        "description": "Turn a Learnomy course's discussion space on or off from the frontend course builder. Requires an authenticated mutation plus course ownership (site admin or the course author). Turning it off records the choice and KEEPS the space, its posts and its members. Added 1.9.1.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "course_id",
                  "enabled"
                ],
                "properties": {
                  "course_id": {
                    "type": "integer"
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/link-preview": {
      "get": {
        "tags": [
          "Posts"
        ],
        "summary": "Get link preview metadata",
        "operationId": "getLinkPreview",
        "description": "Fetch Open Graph metadata for a URL (for composer link previews). Login required.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LinkPreview"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "URL to fetch OG metadata for"
          }
        ]
      }
    },
    "/media": {
      "post": {
        "tags": [
          "Media"
        ],
        "summary": "Upload an image",
        "operationId": "uploadMedia",
        "description": "Upload an image (multipart). Requires upload_files OR jetonomy_upload_media OR jetonomy_create_posts OR jetonomy_create_replies.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaItem"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Media"
        ],
        "summary": "List media library",
        "operationId": "listMedia",
        "description": "List community media library uploads. Requires jetonomy_manage_settings.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Default 24"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/messaging/recipient-suggestions": {
      "get": {
        "tags": [
          "Private Messaging"
        ],
        "summary": "Recipient typeahead",
        "operationId": "recipientSuggestions",
        "description": "Typeahead of eligible recipients (scoped to shared spaces). Login required.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSuggestionList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Query prefix"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/moderation/approve/{type}/{id}": {
      "post": {
        "tags": [
          "Moderation"
        ],
        "summary": "Approve content",
        "operationId": "moderationApprove",
        "description": "Approve a queued item. Requires jetonomy_moderate.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModerationAction"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "post|reply"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/moderation/ban": {
      "get": {
        "tags": [
          "Moderation"
        ],
        "summary": "List restrictions",
        "operationId": "listBans",
        "description": "List active bans/silences/space-bans. Requires jetonomy_moderate.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestrictionCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ]
      },
      "post": {
        "tags": [
          "Moderation"
        ],
        "summary": "Issue a restriction",
        "operationId": "createBan",
        "description": "Issue a ban, silence, or space-ban. Requires jetonomy_moderate. Guards: cannot restrict self, a site admin, or (as a mere moderator) another moderator.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Restriction"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user_id": {
                    "type": "integer"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "ban",
                      "silence",
                      "spaceban"
                    ]
                  },
                  "space_id": {
                    "type": "integer",
                    "description": "Required for spaceban"
                  },
                  "reason": {
                    "type": "string"
                  },
                  "expires_at": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "user_id",
                  "type"
                ]
              }
            }
          }
        }
      }
    },
    "/moderation/ban/{id}": {
      "delete": {
        "tags": [
          "Moderation"
        ],
        "summary": "Lift a restriction",
        "operationId": "deleteBan",
        "description": "Lift a restriction. Requires jetonomy_moderate.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/moderation/bulk": {
      "post": {
        "tags": [
          "Moderation"
        ],
        "summary": "Bulk moderate",
        "operationId": "moderationBulk",
        "description": "Bulk approve/spam/trash queued items. Requires jetonomy_moderate.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CountResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "approve",
                      "spam",
                      "trash"
                    ]
                  },
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string"
                        },
                        "id": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                },
                "required": [
                  "action",
                  "items"
                ]
              }
            }
          }
        }
      }
    },
    "/moderation/flags": {
      "get": {
        "tags": [
          "Moderation"
        ],
        "summary": "List flags for moderation",
        "operationId": "listModerationFlags",
        "description": "List flags for the moderation dashboard. Requires jetonomy_moderate.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlagCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "resolved",
                "all"
              ],
              "default": "open"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/moderation/flags/{id}/resolve": {
      "post": {
        "tags": [
          "Moderation"
        ],
        "summary": "Resolve a flag",
        "operationId": "resolveFlag",
        "description": "Resolve a flag; a valid flag trashes the content and rewards the reporter. Requires jetonomy_moderate.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Flag"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "valid": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "valid"
                ]
              }
            }
          }
        }
      }
    },
    "/moderation/queue": {
      "get": {
        "tags": [
          "Moderation"
        ],
        "summary": "Moderation queue",
        "operationId": "moderationQueue",
        "description": "List the pending + spam queue. Requires jetonomy_moderate.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModerationQueue"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "post",
                "reply",
                "all"
              ],
              "default": "all"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/moderation/rules": {
      "get": {
        "tags": [
          "Advanced Moderation"
        ],
        "summary": "List moderation rules",
        "operationId": "listModerationRules",
        "description": "List automated moderation rules. Requires manage_options.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModerationRuleCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ]
      },
      "post": {
        "tags": [
          "Advanced Moderation"
        ],
        "summary": "Create a moderation rule",
        "operationId": "createModerationRule",
        "description": "Create an automated moderation rule. Requires manage_options.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModerationRule"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModerationRuleCreate"
              }
            }
          }
        }
      }
    },
    "/moderation/rules/{id}": {
      "patch": {
        "tags": [
          "Advanced Moderation"
        ],
        "summary": "Update a moderation rule",
        "operationId": "updateModerationRule",
        "description": "Update a moderation rule. Requires manage_options.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModerationRule"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ModerationRuleCreate"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Advanced Moderation"
        ],
        "summary": "Delete a moderation rule",
        "operationId": "deleteModerationRule",
        "description": "Delete a moderation rule. Requires manage_options.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/moderation/rules/{id}/stats": {
      "get": {
        "tags": [
          "Advanced Moderation"
        ],
        "summary": "Rule trigger stats",
        "operationId": "getModerationRuleStats",
        "description": "Trigger statistics for a moderation rule. Requires manage_options.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModerationRuleStats"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/moderation/spam/{type}/{id}": {
      "post": {
        "tags": [
          "Moderation"
        ],
        "summary": "Mark content as spam",
        "operationId": "moderationSpam",
        "description": "Mark an item as spam (applies a reputation penalty). Requires jetonomy_moderate.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModerationAction"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "post|reply"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/moderation/trash/{type}/{id}": {
      "post": {
        "tags": [
          "Moderation"
        ],
        "summary": "Trash content",
        "operationId": "moderationTrash",
        "description": "Trash an item. Requires jetonomy_moderate.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModerationAction"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "post|reply"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/notifications": {
      "get": {
        "tags": [
          "Notifications"
        ],
        "summary": "List notifications",
        "operationId": "listNotifications",
        "description": "List the caller's notifications. Login required.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "parameters": [
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "unread",
                "mentions",
                "replies",
                "votes",
                "badges"
              ],
              "default": "all"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/notifications/bulk": {
      "post": {
        "tags": [
          "Notifications"
        ],
        "summary": "Bulk mark-read/delete",
        "operationId": "bulkNotifications",
        "description": "Bulk mark-read or delete notifications. Login required.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CountResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "read",
                      "delete"
                    ]
                  },
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    }
                  }
                },
                "required": [
                  "action",
                  "ids"
                ]
              }
            }
          }
        }
      }
    },
    "/notifications/mark-all-read": {
      "post": {
        "tags": [
          "Notifications"
        ],
        "summary": "Mark all read",
        "operationId": "markAllNotificationsRead",
        "description": "Mark all of the caller's notifications as read. Login required.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CountResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/notifications/unread-count": {
      "get": {
        "tags": [
          "Notifications"
        ],
        "summary": "Unread count",
        "operationId": "notificationsUnreadCount",
        "description": "Return the caller's unread notification count (cached 15s). Login required.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CountResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/notifications/{id}": {
      "patch": {
        "tags": [
          "Notifications"
        ],
        "summary": "Mark one read",
        "operationId": "markNotificationRead",
        "description": "Mark a single notification as read. Scoped to the caller.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Notification"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "read": {
                    "type": "boolean",
                    "default": true
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Notifications"
        ],
        "summary": "Delete one",
        "operationId": "deleteNotification",
        "description": "Delete a single notification. Scoped to the caller.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/oembed": {
      "get": {
        "tags": [
          "Feed"
        ],
        "summary": "oEmbed metadata",
        "operationId": "getOembed",
        "description": "oEmbed 1.0 JSON for a forum thread URL (Slack/X/Discord unfurl). Public read.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OembedResult"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "json"
              ],
              "default": "json"
            }
          },
          {
            "name": "maxwidth",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "maxheight",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "security": []
      }
    },
    "/polls/{id}": {
      "patch": {
        "tags": [
          "Polls"
        ],
        "summary": "Close or reopen a poll",
        "operationId": "updatePoll",
        "description": "Close/reopen a poll. Requires poll creator or moderator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Poll"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "closed": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/polls/{id}/vote": {
      "post": {
        "tags": [
          "Polls"
        ],
        "summary": "Cast or switch a poll vote",
        "operationId": "votePoll",
        "description": "Cast or switch a vote. For multiple-choice, option_ids is the desired final set (idempotent reconcile). Requires jetonomy_vote.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Poll"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "option_ids": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    }
                  }
                },
                "required": [
                  "option_ids"
                ]
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Polls"
        ],
        "summary": "Remove my poll vote",
        "operationId": "unvotePoll",
        "description": "Remove the caller's poll vote.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Poll"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/posts/drafts": {
      "get": {
        "tags": [
          "Posts"
        ],
        "summary": "List my drafts",
        "operationId": "listMyDrafts",
        "description": "List the caller's own draft posts. Login required.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/posts/{id}": {
      "get": {
        "tags": [
          "Posts"
        ],
        "summary": "Get a post",
        "operationId": "getPost",
        "description": "Fetch a single post, including its 1.8.0 attachments array. Public read (private-mode gated).",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      },
      "patch": {
        "tags": [
          "Posts"
        ],
        "summary": "Update or publish a post",
        "operationId": "updatePost",
        "description": "Update a post or publish a draft. Requires author or moderator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostUpdate"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Posts"
        ],
        "summary": "Trash a post",
        "operationId": "deletePost",
        "description": "Trash a post. Requires author or moderator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/posts/{id}/close": {
      "post": {
        "tags": [
          "Posts"
        ],
        "summary": "Close or reopen a post",
        "operationId": "closePost",
        "description": "Toggle whether a post accepts new replies. Requires author or moderator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "closed": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/posts/{id}/fields": {
      "get": {
        "tags": [
          "Custom Fields"
        ],
        "summary": "Read a post's fields",
        "operationId": "getPostFields",
        "description": "Read a post's custom field values. Public read.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldValues"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      },
      "patch": {
        "tags": [
          "Custom Fields"
        ],
        "summary": "Write a post's fields",
        "operationId": "updatePostFields",
        "description": "Write a post's custom field values (raw {slug: value}; invalid values reported per-field in a 400 without blocking the rest). Requires author or moderator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldValues"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "/posts/{id}/flags": {
      "get": {
        "tags": [
          "Moderation"
        ],
        "summary": "Flags on a post",
        "operationId": "listPostFlags",
        "description": "List flags reported on a single post. Requires jetonomy_moderate.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlagCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/posts/{id}/idea-status": {
      "post": {
        "tags": [
          "Posts"
        ],
        "summary": "Set roadmap status",
        "operationId": "setIdeaStatus",
        "description": "Set the roadmap status of an idea post (Ideas spaces only). Requires space moderator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string"
                  }
                },
                "required": [
                  "status"
                ]
              }
            }
          }
        }
      }
    },
    "/posts/{id}/merge": {
      "post": {
        "tags": [
          "Posts"
        ],
        "summary": "Merge a post",
        "operationId": "mergePost",
        "description": "Merge this post's replies into another post. Requires moderator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "target_post_id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "target_post_id"
                ]
              }
            }
          }
        }
      }
    },
    "/posts/{id}/move": {
      "post": {
        "tags": [
          "Posts"
        ],
        "summary": "Move a post",
        "operationId": "movePost",
        "description": "Move a post to another space. Requires moderator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "target_space_id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "target_space_id"
                ]
              }
            }
          }
        }
      }
    },
    "/posts/{id}/pin": {
      "post": {
        "tags": [
          "Posts"
        ],
        "summary": "Pin or unpin a post",
        "operationId": "pinPost",
        "description": "Pin/unpin a post within its space (capped per space). Requires space moderator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pinned": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/posts/{id}/reactions": {
      "get": {
        "tags": [
          "Reactions"
        ],
        "summary": "Get post reaction counts",
        "operationId": "getPostReactions",
        "description": "Get reaction counts for a post. Public read (private-mode gated).",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReactionSummary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      },
      "post": {
        "tags": [
          "Reactions"
        ],
        "summary": "Toggle a post reaction",
        "operationId": "togglePostReaction",
        "description": "Toggle a reaction on a post (single-reaction-per-user; a different emoji swaps the prior one). Requires jetonomy_vote.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReactionSummary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "emoji": {
                    "type": "string"
                  }
                },
                "required": [
                  "emoji"
                ]
              }
            }
          }
        }
      }
    },
    "/posts/{id}/vote": {
      "post": {
        "tags": [
          "Posts"
        ],
        "summary": "Vote on a post",
        "operationId": "votePost",
        "description": "Cast a vote on a post. Requires jetonomy_vote.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoteResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "integer",
                    "enum": [
                      -1,
                      1
                    ],
                    "description": "Vote direction"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Posts"
        ],
        "summary": "Remove my vote from a post",
        "operationId": "unvotePost",
        "description": "Remove the caller's vote from a post.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoteResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/posts/{post_id}/poll": {
      "get": {
        "tags": [
          "Polls"
        ],
        "summary": "Get a poll",
        "operationId": "getPoll",
        "description": "Get the poll attached to a post. Public read (private-mode gated).",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Poll"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "post_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      },
      "post": {
        "tags": [
          "Polls"
        ],
        "summary": "Create a poll",
        "operationId": "createPoll",
        "description": "Create a poll on a post (one poll per post; 409 on a second create). Requires post author or moderator.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Poll"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "parameters": [
          {
            "name": "post_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "question": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "single",
                      "multiple"
                    ]
                  },
                  "options": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "closes_at": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "question",
                  "options"
                ]
              }
            }
          }
        }
      }
    },
    "/posts/{post_id}/replies": {
      "get": {
        "tags": [
          "Replies"
        ],
        "summary": "List replies",
        "operationId": "listReplies",
        "description": "List replies for a post (threaded up to 3 levels). Supports sort=oldest|newest|best.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReplyCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "post_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "oldest",
                "newest",
                "best"
              ],
              "default": "oldest"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "post": {
        "tags": [
          "Replies"
        ],
        "summary": "Create a reply",
        "operationId": "createReply",
        "description": "Create a reply on a post (optionally nested via parent_id). Requires jetonomy_create_replies.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Reply"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "post_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplyCreate"
              }
            }
          }
        }
      }
    },
    "/push/register-device": {
      "post": {
        "tags": [
          "Web Push"
        ],
        "summary": "Register a native device token",
        "operationId": "pushRegisterDevice",
        "description": "Register a native (Expo) push token. Login required.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string"
                  },
                  "platform": {
                    "type": "string",
                    "enum": [
                      "ios",
                      "android"
                    ]
                  }
                },
                "required": [
                  "token"
                ]
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Web Push"
        ],
        "summary": "Remove a native device token",
        "operationId": "pushUnregisterDevice",
        "description": "Remove a native push token. Login required.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/push/service-worker.js": {
      "get": {
        "tags": [
          "Web Push"
        ],
        "summary": "Service worker script",
        "operationId": "getServiceWorker",
        "description": "Return the push service worker script. Public read.",
        "responses": {
          "200": {
            "description": "JavaScript service worker"
          }
        },
        "security": []
      }
    },
    "/push/subscribe": {
      "post": {
        "tags": [
          "Web Push"
        ],
        "summary": "Register a browser subscription",
        "operationId": "pushSubscribe",
        "description": "Register a browser PushSubscription. Login required.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "endpoint": {
                    "type": "string"
                  },
                  "keys": {
                    "type": "object",
                    "properties": {
                      "p256dh": {
                        "type": "string"
                      },
                      "auth": {
                        "type": "string"
                      }
                    }
                  }
                },
                "required": [
                  "endpoint",
                  "keys"
                ]
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Web Push"
        ],
        "summary": "Remove a browser subscription",
        "operationId": "pushUnsubscribe",
        "description": "Remove a browser PushSubscription. Login required.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "endpoint": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/push/vapid-key": {
      "get": {
        "tags": [
          "Web Push"
        ],
        "summary": "Get VAPID public key",
        "operationId": "getVapidKey",
        "description": "Return the public VAPID key for browser push. Public read.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VapidKey"
                }
              }
            }
          }
        },
        "security": []
      }
    },
    "/replies/{id}": {
      "get": {
        "summary": "Get a reply",
        "description": "Fetch a single reply. Visibility is enforced by Visibility::rest_check, so a reply in a space the caller cannot see returns 401/404 rather than the record.",
        "tags": [
          "Replies"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The reply."
          },
          "404": {
            "description": "Not found or not visible to the caller."
          }
        }
      },
      "patch": {
        "tags": [
          "Replies"
        ],
        "summary": "Update a reply",
        "operationId": "updateReply",
        "description": "Update a reply. Requires author or moderator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Reply"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplyUpdate"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Replies"
        ],
        "summary": "Trash a reply",
        "operationId": "deleteReply",
        "description": "Trash a reply. Requires author or moderator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/replies/{id}/accept": {
      "post": {
        "tags": [
          "Replies"
        ],
        "summary": "Accept a reply as answer",
        "operationId": "acceptReply",
        "description": "Mark a reply as the accepted answer (Q&A spaces only). Requires the post author or a moderator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Reply"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      },
      "delete": {
        "tags": [
          "Replies"
        ],
        "summary": "Un-accept a reply",
        "operationId": "unacceptReply",
        "description": "Remove accepted-answer status from a reply.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Reply"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/replies/{id}/reactions": {
      "get": {
        "tags": [
          "Reactions"
        ],
        "summary": "Get reply reaction counts",
        "operationId": "getReplyReactions",
        "description": "Get reaction counts for a reply. Public read (private-mode gated).",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReactionSummary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      },
      "post": {
        "tags": [
          "Reactions"
        ],
        "summary": "Toggle a reply reaction",
        "operationId": "toggleReplyReaction",
        "description": "Toggle a reaction on a reply (single-reaction-per-user). Requires jetonomy_vote.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReactionSummary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "emoji": {
                    "type": "string"
                  }
                },
                "required": [
                  "emoji"
                ]
              }
            }
          }
        }
      }
    },
    "/replies/{id}/split": {
      "post": {
        "tags": [
          "Replies"
        ],
        "summary": "Split a reply into a new post",
        "operationId": "splitReply",
        "description": "Split a reply out into a new post. Requires moderator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "target_space_id": {
                    "type": "integer"
                  },
                  "title": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/replies/{id}/vote": {
      "post": {
        "tags": [
          "Replies"
        ],
        "summary": "Vote on a reply",
        "operationId": "voteReply",
        "description": "Cast a vote on a reply. Requires jetonomy_vote.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoteResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "integer",
                    "enum": [
                      -1,
                      1
                    ]
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Replies"
        ],
        "summary": "Remove my vote from a reply",
        "operationId": "unvoteReply",
        "description": "Remove the caller's vote from a reply.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoteResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/reply-by-email/inbound": {
      "post": {
        "tags": [
          "Reply By Email"
        ],
        "summary": "Inbound email webhook",
        "operationId": "replyByEmailInbound",
        "description": "Inbound email webhook (signature/token-verified, not a WP capability). Used by the mail provider to post replies.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Provider-specific inbound email payload"
              }
            }
          }
        },
        "security": []
      }
    },
    "/search": {
      "get": {
        "tags": [
          "Search"
        ],
        "summary": "Search content",
        "operationId": "search",
        "description": "MySQL FULLTEXT boolean-mode search. type=all returns {posts, spaces, tags} grouped; limit/offset apply to the posts group. Sets X-WP-Total/X-WP-TotalPages.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Search query"
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "post",
                "reply",
                "space",
                "tag",
                "all"
              ],
              "default": "all"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "relevance",
                "newest",
                "votes"
              ],
              "default": "relevance"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Default 20, capped 50"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/settings/white-label": {
      "get": {
        "tags": [
          "White Label"
        ],
        "summary": "Get white-label settings",
        "operationId": "getWhiteLabel",
        "description": "Read white-label branding settings. Requires manage_options.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhiteLabel"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      },
      "patch": {
        "tags": [
          "White Label"
        ],
        "summary": "Update white-label settings",
        "operationId": "updateWhiteLabel",
        "description": "Update white-label branding settings. Requires manage_options.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhiteLabel"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WhiteLabel"
              }
            }
          }
        }
      }
    },
    "/site-announcements": {
      "get": {
        "tags": [
          "Site Announcements"
        ],
        "summary": "List pinned announcements",
        "operationId": "listSiteAnnouncements",
        "description": "Admin: list pinned post IDs. Requires manage_options. Served on the jetonomy-pro/v1 namespace.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnnouncementCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "servers": [
          {
            "url": "https://your-site.com/wp-json/jetonomy-pro/v1",
            "description": "Jetonomy Pro namespace"
          }
        ]
      }
    },
    "/site-announcements/{id}": {
      "post": {
        "tags": [
          "Site Announcements"
        ],
        "summary": "Pin a post",
        "operationId": "pinAnnouncement",
        "description": "Admin: pin a post as an announcement (capped at 5). Requires manage_options. Served on jetonomy-pro/v1.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Announcement"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "servers": [
          {
            "url": "https://your-site.com/wp-json/jetonomy-pro/v1",
            "description": "Jetonomy Pro namespace"
          }
        ]
      },
      "delete": {
        "tags": [
          "Site Announcements"
        ],
        "summary": "Unpin a post",
        "operationId": "unpinAnnouncement",
        "description": "Admin: unpin an announcement. Requires manage_options. Served on jetonomy-pro/v1.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "servers": [
          {
            "url": "https://your-site.com/wp-json/jetonomy-pro/v1",
            "description": "Jetonomy Pro namespace"
          }
        ]
      }
    },
    "/spaces": {
      "get": {
        "tags": [
          "Spaces"
        ],
        "summary": "List spaces",
        "operationId": "listSpaces",
        "description": "List spaces the caller can see (visibility-filtered). Public read; in private-community mode requires login.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpaceCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Max items (default 20)"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Offset for pagination"
          },
          {
            "name": "category_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Filter by category"
          }
        ]
      },
      "post": {
        "tags": [
          "Spaces"
        ],
        "summary": "Create a space",
        "operationId": "createSpace",
        "description": "Create a sub-community. Requires manage_options OR jetonomy_create_spaces OR an opted-in WP role (Settings -> frontend_space_creation_roles).",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Space"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SpaceCreate"
              }
            }
          }
        }
      }
    },
    "/spaces/{id}": {
      "get": {
        "tags": [
          "Spaces"
        ],
        "summary": "Get a space",
        "operationId": "getSpace",
        "description": "Fetch a single space by ID. Public read (private-mode gated).",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Space"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      },
      "patch": {
        "tags": [
          "Spaces"
        ],
        "summary": "Update a space",
        "operationId": "updateSpace",
        "description": "Update space settings. Requires the caller to hold the per-space admin role or manage_options.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Space"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SpaceUpdate"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Spaces"
        ],
        "summary": "Remove a space (transfers by default)",
        "operationId": "deleteSpace",
        "description": "Remove a space. Defaults to mode=transfer, which hands the space to a successor and archives it, keeps every topic and reply, and returns deleted:false. mode=purge permanently destroys the space and all of its content and returns 202 while the work drains in the background. Purge additionally requires manage_options unless the site owner has enabled allow_space_admin_purge. Requires the per-space admin role.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Purge accepted and queued to run in the background."
          },
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/spaces/{id}/access-rules": {
      "get": {
        "tags": [
          "Access Rules"
        ],
        "summary": "List access rules",
        "operationId": "listAccessRules",
        "description": "Every rule attached to the space, by priority. Requires `jetonomy_manage_spaces`.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "post": {
        "tags": [
          "Access Rules"
        ],
        "summary": "Create an access rule",
        "operationId": "createAccessRule",
        "description": "Creates a rule. A restrictive rule (membership, role, capability, trust_level) on a PUBLIC space switches that space to Private, because a public space is always readable and the rule would otherwise silently do nothing. The response reports this via made_private. Requires `jetonomy_manage_spaces`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "rule_type"
                ],
                "properties": {
                  "rule_type": {
                    "type": "string",
                    "enum": [
                      "membership",
                      "role",
                      "capability",
                      "trust_level",
                      "logged_in",
                      "everyone"
                    ]
                  },
                  "rule_value": {
                    "type": "string"
                  },
                  "grants": {
                    "type": "string",
                    "enum": [
                      "read",
                      "participate",
                      "full"
                    ],
                    "default": "read"
                  },
                  "space_role": {
                    "type": "string",
                    "enum": [
                      "viewer",
                      "member",
                      "moderator",
                      "admin"
                    ],
                    "default": "viewer"
                  },
                  "priority": {
                    "type": "integer",
                    "default": 0
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/spaces/{id}/invite": {
      "post": {
        "tags": [
          "Spaces"
        ],
        "summary": "Generate an invite link",
        "operationId": "createSpaceInvite",
        "description": "Generate a shareable invite link/token for the space. Requires space admin.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InviteLink"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "expires_in": {
                    "type": "integer",
                    "description": "Seconds until expiry"
                  },
                  "max_uses": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/spaces/{id}/invites": {
      "get": {
        "tags": [
          "Spaces"
        ],
        "summary": "List a space's invite links",
        "operationId": "listSpaceInvites",
        "description": "List invite links for a space. Space admins only.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/spaces/{id}/invites/{invite_id}": {
      "delete": {
        "tags": [
          "Spaces"
        ],
        "summary": "Revoke a space invite link",
        "operationId": "revokeSpaceInvite",
        "description": "Revoke an invite link so it can no longer be redeemed. Space admins only.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "invite_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Revoked"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/spaces/{id}/join-requests": {
      "get": {
        "tags": [
          "Spaces"
        ],
        "summary": "List pending join requests",
        "operationId": "listJoinRequests",
        "description": "List pending join requests for the space. Requires space moderator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JoinRequestCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/spaces/{id}/join-requests/{request_id}/approve": {
      "post": {
        "tags": [
          "Spaces"
        ],
        "summary": "Approve a join request",
        "operationId": "approveJoinRequest",
        "description": "Approve a pending join request. Requires space moderator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Membership"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "request_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/spaces/{id}/join-requests/{request_id}/deny": {
      "post": {
        "tags": [
          "Spaces"
        ],
        "summary": "Deny a join request",
        "operationId": "denyJoinRequest",
        "description": "Deny a pending join request. Requires space moderator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "request_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/spaces/{id}/members": {
      "get": {
        "tags": [
          "Spaces"
        ],
        "summary": "List space members",
        "operationId": "listSpaceMembers",
        "description": "List members of a space (paginated).",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "role",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "admin",
                "moderator",
                "member"
              ]
            },
            "description": "Filter by space role"
          }
        ]
      },
      "post": {
        "tags": [
          "Spaces"
        ],
        "summary": "Join a space",
        "operationId": "joinSpace",
        "description": "Join the space (or create a join request when join_policy=request). Login required.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Membership"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/spaces/{id}/members/{user_id}": {
      "patch": {
        "tags": [
          "Spaces"
        ],
        "summary": "Change a member's role",
        "operationId": "updateSpaceMemberRole",
        "description": "Change a member's per-space role. Requires space admin.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Membership"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "role": {
                    "type": "string",
                    "enum": [
                      "admin",
                      "moderator",
                      "member"
                    ]
                  }
                },
                "required": [
                  "role"
                ]
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Spaces"
        ],
        "summary": "Leave or remove a member",
        "operationId": "removeSpaceMember",
        "description": "Leave the space (self) or remove another member (space admin).",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/spaces/{id}/moderation/flags": {
      "get": {
        "tags": [
          "Moderation"
        ],
        "summary": "Space-scoped flag queue",
        "operationId": "listSpaceFlags",
        "description": "List the space-scoped flag queue. Requires space moderator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlagCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "resolved",
                "all"
              ],
              "default": "open"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/spaces/{id}/moderation/flags/{flag_id}/resolve": {
      "post": {
        "tags": [
          "Moderation"
        ],
        "summary": "Resolve a space flag",
        "operationId": "resolveSpaceFlag",
        "description": "Resolve a space-scoped flag. Requires space moderator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Flag"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "flag_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "valid": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "valid"
                ]
              }
            }
          }
        }
      }
    },
    "/spaces/{id}/moderation/{action}/{type}/{obj_id}": {
      "post": {
        "tags": [
          "Moderation"
        ],
        "summary": "Space-scoped approve/spam/trash",
        "operationId": "spaceModerationAction",
        "description": "Approve, spam, or trash content within a space. Requires space moderator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModerationAction"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "action",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "approve|spam|trash"
          },
          {
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "post|reply"
          },
          {
            "name": "obj_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/spaces/{id}/privileged-members": {
      "get": {
        "tags": [
          "Spaces"
        ],
        "summary": "List space admins/moderators",
        "operationId": "listPrivilegedMembers",
        "description": "List the space's admins and moderators. Public read.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/spaces/{id}/seo": {
      "get": {
        "tags": [
          "SEO Pro"
        ],
        "summary": "Get space SEO",
        "operationId": "getSpaceSeo",
        "description": "Read per-space meta title/description/OG image. Requires space admin.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpaceSeo"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      },
      "patch": {
        "tags": [
          "SEO Pro"
        ],
        "summary": "Update space SEO",
        "operationId": "updateSpaceSeo",
        "description": "Update per-space meta title/description/OG image. Requires space admin.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SpaceSeo"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SpaceSeo"
              }
            }
          }
        }
      }
    },
    "/spaces/{space_id}/posts": {
      "get": {
        "tags": [
          "Posts"
        ],
        "summary": "List posts in a space",
        "operationId": "listSpacePosts",
        "description": "List posts in a space. Supports sort=latest|popular|oldest|newest|unanswered plus cursor (after/before) or offset pagination.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "space_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "latest",
                "popular",
                "oldest",
                "newest",
                "unanswered"
              ],
              "default": "latest"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Cursor for next page"
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Cursor for previous page"
          }
        ]
      },
      "post": {
        "tags": [
          "Posts"
        ],
        "summary": "Create a post",
        "operationId": "createPost",
        "description": "Create a post in a space. Requires jetonomy_create_posts and space membership per the space policy.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Post"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "space_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PostCreate"
              }
            }
          }
        }
      }
    },
    "/subscriptions": {
      "get": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "List my subscriptions",
        "operationId": "listSubscriptions",
        "description": "List the caller's subscriptions; each row includes the target's title/slug/exists (1.8.0). Login required.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SubscriptionCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ]
      },
      "post": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Subscribe",
        "operationId": "createSubscription",
        "description": "Subscribe to a space or post. Login required.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Subscription"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "object_type": {
                    "type": "string",
                    "enum": [
                      "space",
                      "post"
                    ]
                  },
                  "object_id": {
                    "type": "integer"
                  },
                  "via": {
                    "type": "string",
                    "description": "Delivery channel"
                  }
                },
                "required": [
                  "object_type",
                  "object_id"
                ]
              }
            }
          }
        }
      }
    },
    "/subscriptions/{id}": {
      "delete": {
        "tags": [
          "Subscriptions"
        ],
        "summary": "Unsubscribe",
        "operationId": "deleteSubscription",
        "description": "Remove a subscription. Scoped to the caller.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/tags": {
      "get": {
        "tags": [
          "Tags"
        ],
        "summary": "List tags",
        "operationId": "listTags",
        "description": "List post tags (read-only; no write routes). Public read.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TagCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter tags by name prefix"
          }
        ]
      },
      "post": {
        "tags": [
          "Tags"
        ],
        "summary": "Create a tag",
        "operationId": "createTag",
        "description": "Creates a tag. The slug is derived from the name when omitted. Requires `jetonomy_manage_settings`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "slug": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Name or slug empty"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Another tag already uses that slug"
          }
        }
      }
    },
    "/tags/{id}": {
      "patch": {
        "tags": [
          "Tags"
        ],
        "summary": "Rename a tag",
        "operationId": "updateTag",
        "description": "Updates a tag name and/or slug. Requires `jetonomy_manage_settings`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "slug": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Name or slug empty"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Tag not found"
          },
          "409": {
            "description": "Another tag already uses that slug"
          }
        }
      },
      "delete": {
        "tags": [
          "Tags"
        ],
        "summary": "Delete a tag",
        "operationId": "deleteTag",
        "description": "Deletes the tag and detaches it from every post. Requires `jetonomy_manage_settings`.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Name or slug empty"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Tag not found"
          },
          "409": {
            "description": "Another tag already uses that slug"
          }
        }
      }
    },
    "/updates": {
      "get": {
        "tags": [
          "Feed"
        ],
        "summary": "Poll for updates",
        "operationId": "getUpdates",
        "description": "Poll for activity since a timestamp. Public read (private-mode gated).",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdatesResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ISO 8601 / unix timestamp"
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "global",
                "space",
                "post"
              ],
              "default": "global"
            }
          },
          {
            "name": "space_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "post_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/users": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Moderator members directory",
        "operationId": "listMembers",
        "description": "Members directory for moderators: search, pagination and restriction context (ban / silence state). Requires jetonomy_moderate.",
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/users/by-login/{login}": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get a public profile by username",
        "operationId": "getUserByLogin",
        "description": "Fetch a user's public profile by username. Public read (private-mode gated).",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicProfile"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "login",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/users/me": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get my profile",
        "operationId": "getMe",
        "description": "Fetch the authenticated caller's full profile. Login required.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserProfile"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "patch": {
        "tags": [
          "Users"
        ],
        "summary": "Update my profile",
        "operationId": "updateMe",
        "description": "Update the caller's own profile. Login required.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserProfile"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserProfileUpdate"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Users"
        ],
        "summary": "Delete my account",
        "operationId": "deleteMe",
        "description": "Delete the caller's own account (Apple 5.1.1(v) / GDPR Art. 17). Rate-limited 5/hour. Allowed even for unverified accounts. By default content is anonymized; pass delete_content=true to hard-delete.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountDeletion"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "password": {
                    "type": "string"
                  },
                  "confirm": {
                    "type": "string",
                    "enum": [
                      "DELETE"
                    ]
                  },
                  "delete_content": {
                    "type": "boolean",
                    "default": false
                  }
                },
                "required": [
                  "password",
                  "confirm"
                ]
              }
            }
          }
        }
      }
    },
    "/users/me/blocks": {
      "get": {
        "tags": [
          "Blocks"
        ],
        "summary": "List blocked users",
        "operationId": "listBlocks",
        "description": "List the members the caller has blocked. Login required.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlockCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ]
      },
      "post": {
        "tags": [
          "Blocks"
        ],
        "summary": "Block a user",
        "operationId": "blockUser",
        "description": "Block another member. Login required.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Block"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "user_id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "user_id"
                ]
              }
            }
          }
        }
      }
    },
    "/users/me/blocks/{user_id}": {
      "delete": {
        "tags": [
          "Blocks"
        ],
        "summary": "Unblock a user",
        "operationId": "unblockUser",
        "description": "Unblock a member (idempotent). Login required.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/users/me/digest-preferences": {
      "get": {
        "tags": [
          "Email Digest"
        ],
        "summary": "Get digest preferences",
        "operationId": "getDigestPreferences",
        "description": "Read the caller's digest frequency + subscribed types. Login required.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DigestPreferences"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      },
      "patch": {
        "tags": [
          "Email Digest"
        ],
        "summary": "Update digest preferences",
        "operationId": "updateDigestPreferences",
        "description": "Update the caller's digest frequency + subscribed types. Login required.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DigestPreferences"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DigestPreferences"
              }
            }
          }
        }
      }
    },
    "/users/me/fields": {
      "patch": {
        "tags": [
          "Custom Fields"
        ],
        "summary": "Write my fields",
        "operationId": "updateMyFields",
        "description": "Write the caller's own profile custom field values. Login required.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldValues"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "/users/suggest": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Mention typeahead",
        "operationId": "suggestUsers",
        "description": "@mention typeahead suggestions. Login required.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserSuggestionList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        },
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Query prefix"
          },
          {
            "name": "space_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Scope suggestions to a space"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/users/{id}": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get a public profile",
        "operationId": "getUser",
        "description": "Fetch a user's public profile by ID. Public read (private-mode gated).",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicProfile"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/users/{id}/badges": {
      "get": {
        "tags": [
          "Custom Badges"
        ],
        "summary": "List a user's badges",
        "operationId": "listUserBadges",
        "description": "List a user's earned badges. Public read.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadgeCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/users/{id}/fields": {
      "get": {
        "tags": [
          "Custom Fields"
        ],
        "summary": "Read a user's fields",
        "operationId": "getUserFields",
        "description": "Read a user's profile custom field values. Public read.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldValues"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/users/{id}/posts": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "List a user's posts",
        "operationId": "listUserPosts",
        "description": "List a user's public posts. Public read (private-mode gated).",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/webhooks": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List webhooks",
        "operationId": "listWebhooks",
        "description": "List webhooks. Requires manage_options.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ]
      },
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Create a webhook",
        "operationId": "createWebhook",
        "description": "Create a webhook. Requires manage_options. Payloads are HMAC-signed (X-Jetonomy-Signature); auto-disabled after 5 consecutive failures.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookCreate"
              }
            }
          }
        }
      }
    },
    "/webhooks/{id}": {
      "patch": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Update a webhook",
        "operationId": "updateWebhook",
        "description": "Update a webhook. Requires manage_options.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookCreate"
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Delete a webhook",
        "operationId": "deleteWebhook",
        "description": "Delete a webhook. Requires manage_options.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/webhooks/{id}/deliveries": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "summary": "List webhook deliveries",
        "operationId": "listWebhookDeliveries",
        "description": "Paginated delivery log (30-day retention). Requires manage_options.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryCollection"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    },
    "/webhooks/{id}/test": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "summary": "Send a test delivery",
        "operationId": "testWebhook",
        "description": "Send a test delivery to the webhook URL. Requires manage_options.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDelivery"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "cookieAuth": {
        "type": "apiKey",
        "in": "cookie",
        "name": "wordpress_logged_in",
        "description": "WordPress logged-in session cookie (the web app)."
      },
      "nonceAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-WP-Nonce",
        "description": "wp_rest nonce, required on every mutation for cookie-authenticated requests. Refresh via GET /auth/nonce."
      },
      "appPassword": {
        "type": "http",
        "scheme": "basic",
        "description": "WordPress Application Password sent as HTTP Basic auth (mobile app + external integrations). Skips the cookie-nonce check."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "status": {
                "type": "integer"
              }
            }
          }
        },
        "required": [
          "code",
          "message"
        ]
      },
      "PaginationMeta": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer"
          },
          "has_more": {
            "type": "boolean"
          },
          "cursor_next": {
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        }
      },
      "DeletedResponse": {
        "type": "object",
        "properties": {
          "deleted": {
            "type": "boolean"
          },
          "id": {
            "type": "integer"
          }
        }
      },
      "MessageResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "success": {
            "type": "boolean"
          }
        }
      },
      "CountResponse": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer"
          }
        }
      },
      "NonceResponse": {
        "type": "object",
        "properties": {
          "nonce": {
            "type": "string"
          }
        }
      },
      "Attachment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "link_id": {
            "type": "integer"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "thumb": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "mime": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "size": {
            "type": "integer"
          },
          "type": {
            "type": "string"
          },
          "ext": {
            "type": "string"
          },
          "is_image": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "url",
          "mime",
          "name"
        ]
      },
      "AttachmentCollection": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Attachment"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        }
      },
      "Space": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "private",
              "hidden"
            ]
          },
          "join_policy": {
            "type": "string",
            "enum": [
              "open",
              "request",
              "invite"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "member_count": {
            "type": "integer"
          },
          "post_count": {
            "type": "integer"
          },
          "is_member": {
            "type": "boolean"
          },
          "viewer_role": {
            "type": [
              "string",
              "null"
            ]
          },
          "category_id": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "SpaceCreate": {
        "type": "object",
        "properties": {
          "sort_order": {
            "type": "integer",
            "minimum": 0,
            "description": "Manual position within the category. Omit on create to append to the end."
          },
          "title": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "private",
              "hidden"
            ]
          },
          "join_policy": {
            "type": "string",
            "enum": [
              "open",
              "request",
              "invite"
            ]
          },
          "description": {
            "type": "string"
          },
          "category_id": {
            "type": "integer"
          }
        },
        "required": [
          "title"
        ]
      },
      "SpaceUpdate": {
        "type": "object",
        "properties": {
          "sort_order": {
            "type": "integer",
            "minimum": 0,
            "description": "Manual position within the category. Omit on create to append to the end."
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "visibility": {
            "type": "string",
            "enum": [
              "public",
              "private",
              "hidden"
            ]
          },
          "join_policy": {
            "type": "string",
            "enum": [
              "open",
              "request",
              "invite"
            ]
          },
          "settings": {
            "type": "object"
          }
        }
      },
      "SpaceCollection": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Space"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        }
      },
      "Member": {
        "type": "object",
        "properties": {
          "user_id": {
            "type": "integer"
          },
          "login": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "avatar": {
            "type": "string",
            "format": "uri"
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "moderator",
              "member"
            ]
          },
          "joined_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MemberCollection": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Member"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        }
      },
      "Membership": {
        "type": "object",
        "properties": {
          "space_id": {
            "type": "integer"
          },
          "user_id": {
            "type": "integer"
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "moderator",
              "member"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "member",
              "pending"
            ]
          }
        }
      },
      "JoinRequest": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "space_id": {
            "type": "integer"
          },
          "user_id": {
            "type": "integer"
          },
          "message": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "JoinRequestCollection": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JoinRequest"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        }
      },
      "InviteLink": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "space_id": {
            "type": "integer"
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "max_uses": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "Author": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "login": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "avatar": {
            "type": "string",
            "format": "uri"
          },
          "trust_level": {
            "type": "integer"
          }
        }
      },
      "Post": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "space_id": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "question",
              "idea",
              "topic",
              "status"
            ]
          },
          "status": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "author": {
            "$ref": "#/components/schemas/Author"
          },
          "reply_count": {
            "type": "integer"
          },
          "vote_score": {
            "type": "integer"
          },
          "viewer_vote": {
            "type": "integer",
            "enum": [
              -1,
              0,
              1
            ]
          },
          "is_bookmarked": {
            "type": "boolean"
          },
          "is_pinned": {
            "type": "boolean"
          },
          "is_closed": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Attachment"
            }
          }
        }
      },
      "PostCreate": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "question",
              "idea",
              "topic",
              "status"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "publish",
              "draft"
            ]
          }
        },
        "required": [
          "title",
          "content"
        ]
      },
      "PostUpdate": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "publish",
              "draft"
            ]
          }
        }
      },
      "PostCollection": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Post"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        }
      },
      "Reply": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "post_id": {
            "type": "integer"
          },
          "parent_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "content": {
            "type": "string"
          },
          "author": {
            "$ref": "#/components/schemas/Author"
          },
          "vote_score": {
            "type": "integer"
          },
          "viewer_vote": {
            "type": "integer",
            "enum": [
              -1,
              0,
              1
            ]
          },
          "is_accepted": {
            "type": "boolean"
          },
          "depth": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Attachment"
            }
          }
        }
      },
      "ReplyCreate": {
        "type": "object",
        "properties": {
          "content": {
            "type": "string"
          },
          "parent_id": {
            "type": "integer"
          }
        },
        "required": [
          "content"
        ]
      },
      "ReplyUpdate": {
        "type": "object",
        "properties": {
          "content": {
            "type": "string"
          }
        },
        "required": [
          "content"
        ]
      },
      "ReplyCollection": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Reply"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        }
      },
      "VoteResult": {
        "type": "object",
        "properties": {
          "object_id": {
            "type": "integer"
          },
          "vote_score": {
            "type": "integer"
          },
          "viewer_vote": {
            "type": "integer",
            "enum": [
              -1,
              0,
              1
            ]
          }
        }
      },
      "LinkPreview": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "image": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "site_name": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "UserProfile": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "login": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "display_name": {
            "type": "string"
          },
          "bio": {
            "type": [
              "string",
              "null"
            ]
          },
          "avatar": {
            "type": "string",
            "format": "uri"
          },
          "reputation": {
            "type": "integer"
          },
          "trust_level": {
            "type": "integer"
          },
          "post_count": {
            "type": "integer"
          },
          "reply_count": {
            "type": "integer"
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "UserProfileUpdate": {
        "type": "object",
        "properties": {
          "first_name": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "nickname": {
            "type": "string",
            "description": "Feeds the display-name choices. Never rendered on its own."
          },
          "display_name": {
            "type": "string",
            "description": "Must be a name the member already owns - a permutation of their own first/last/nickname/username, or their current display name. Anything else, including a reserved name such as Administrator, is rejected with 400 jetonomy_invalid_display_name. All four name fields return 403 when the site has locked member names."
          },
          "bio": {
            "type": "string"
          },
          "avatar": {
            "type": "string"
          },
          "social": {
            "type": "object"
          }
        }
      },
      "PublicProfile": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "login": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "bio": {
            "type": [
              "string",
              "null"
            ]
          },
          "avatar": {
            "type": "string",
            "format": "uri"
          },
          "reputation": {
            "type": "integer"
          },
          "trust_level": {
            "type": "integer"
          },
          "post_count": {
            "type": "integer"
          },
          "reply_count": {
            "type": "integer"
          },
          "joined_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AccountDeletion": {
        "type": "object",
        "properties": {
          "deleted": {
            "type": "boolean"
          },
          "user_id": {
            "type": "integer"
          },
          "content_policy": {
            "type": "string",
            "enum": [
              "anonymized",
              "deleted"
            ]
          }
        }
      },
      "UserSuggestion": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "login": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "avatar": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "UserSuggestionList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserSuggestion"
            }
          }
        }
      },
      "Block": {
        "type": "object",
        "properties": {
          "user_id": {
            "type": "integer"
          },
          "login": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "blocked_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BlockCollection": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Block"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        }
      },
      "AuthResult": {
        "type": "object",
        "properties": {
          "user_id": {
            "type": "integer"
          },
          "login": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "nonce": {
            "type": "string"
          },
          "verified": {
            "type": "boolean"
          }
        }
      },
      "Notification": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "type": {
            "type": "string"
          },
          "read": {
            "type": "boolean"
          },
          "actor": {
            "$ref": "#/components/schemas/Author"
          },
          "object_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "object_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "message": {
            "type": "string"
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "NotificationCollection": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Notification"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        }
      },
      "Subscription": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "object_type": {
            "type": "string",
            "enum": [
              "space",
              "post"
            ]
          },
          "object_id": {
            "type": "integer"
          },
          "via": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "exists": {
            "type": "boolean"
          }
        }
      },
      "SubscriptionCollection": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Subscription"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        }
      },
      "Tag": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "post_count": {
            "type": "integer"
          }
        }
      },
      "TagCollection": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Tag"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        }
      },
      "Category": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "parent_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "space_count": {
            "type": "integer"
          },
          "children": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Category"
            }
          }
        }
      },
      "CategoryCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "parent_id": {
            "type": "integer"
          },
          "description": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ]
      },
      "CategoryCollection": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Category"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        }
      },
      "LeaderboardEntry": {
        "type": "object",
        "properties": {
          "rank": {
            "type": "integer"
          },
          "user_id": {
            "type": "integer"
          },
          "login": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "avatar": {
            "type": "string",
            "format": "uri"
          },
          "reputation": {
            "type": "integer"
          },
          "trust_level": {
            "type": "integer"
          }
        }
      },
      "LeaderboardResult": {
        "type": "object",
        "properties": {
          "period": {
            "type": "string",
            "enum": [
              "all",
              "month",
              "week"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LeaderboardEntry"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        }
      },
      "BookmarkResult": {
        "type": "object",
        "properties": {
          "post_id": {
            "type": "integer"
          },
          "bookmarked": {
            "type": "boolean"
          }
        }
      },
      "SearchResult": {
        "type": "object",
        "properties": {
          "posts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Post"
            }
          },
          "spaces": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Space"
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Tag"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        }
      },
      "Flag": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "object_type": {
            "type": "string",
            "enum": [
              "post",
              "reply"
            ]
          },
          "object_id": {
            "type": "integer"
          },
          "reporter_id": {
            "type": "integer"
          },
          "reason": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "resolved"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "FlagCollection": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Flag"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        }
      },
      "ModerationQueueItem": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "post",
              "reply"
            ]
          },
          "id": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "spam"
            ]
          },
          "excerpt": {
            "type": "string"
          },
          "author": {
            "$ref": "#/components/schemas/Author"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ModerationQueue": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModerationQueueItem"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        }
      },
      "ModerationAction": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "id": {
            "type": "integer"
          },
          "action": {
            "type": "string",
            "enum": [
              "approve",
              "spam",
              "trash"
            ]
          },
          "success": {
            "type": "boolean"
          }
        }
      },
      "Restriction": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "user_id": {
            "type": "integer"
          },
          "type": {
            "type": "string",
            "enum": [
              "ban",
              "silence",
              "spaceban"
            ]
          },
          "space_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RestrictionCollection": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Restriction"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        }
      },
      "MediaItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "thumb": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "mime": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "size": {
            "type": "integer"
          },
          "width": {
            "type": [
              "integer",
              "null"
            ]
          },
          "height": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "MediaCollection": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MediaItem"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        }
      },
      "AppConfig": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "logo": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "accent_color": {
            "type": [
              "string",
              "null"
            ]
          },
          "community_access": {
            "type": "string",
            "enum": [
              "public",
              "private"
            ]
          },
          "features": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            }
          },
          "app_enabled": {
            "type": "boolean"
          }
        }
      },
      "UpdatesResult": {
        "type": "object",
        "properties": {
          "since": {
            "type": "string"
          },
          "scope": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "server_time": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "OembedResult": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "author_name": {
            "type": "string"
          },
          "provider_name": {
            "type": "string"
          },
          "html": {
            "type": "string"
          }
        }
      },
      "Conversation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "type": {
            "type": "string",
            "enum": [
              "direct",
              "group"
            ]
          },
          "participants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Author"
            }
          },
          "last_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "unread_count": {
            "type": "integer"
          },
          "muted": {
            "type": "boolean"
          },
          "archived": {
            "type": "boolean"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ConversationCollection": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Conversation"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        }
      },
      "Message": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "conversation_id": {
            "type": "integer"
          },
          "sender": {
            "$ref": "#/components/schemas/Author"
          },
          "body": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MessageCollection": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Message"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        }
      },
      "ReactionSummary": {
        "type": "object",
        "properties": {
          "object_type": {
            "type": "string",
            "enum": [
              "post",
              "reply"
            ]
          },
          "object_id": {
            "type": "integer"
          },
          "counts": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "viewer_reaction": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PollOption": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "label": {
            "type": "string"
          },
          "votes": {
            "type": "integer"
          }
        }
      },
      "Poll": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "post_id": {
            "type": "integer"
          },
          "question": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "single",
              "multiple"
            ]
          },
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PollOption"
            }
          },
          "total_votes": {
            "type": "integer"
          },
          "closed": {
            "type": "boolean"
          },
          "viewer_votes": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "closes_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "Field": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "label": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "text",
              "textarea",
              "number",
              "email",
              "url",
              "select",
              "checkbox",
              "radio",
              "date"
            ]
          },
          "context": {
            "type": "string",
            "enum": [
              "post",
              "profile",
              "space"
            ]
          },
          "options": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "required": {
            "type": "boolean"
          },
          "active": {
            "type": "boolean"
          }
        }
      },
      "FieldCollection": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Field"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        }
      },
      "FieldValues": {
        "type": "object",
        "properties": {
          "values": {
            "type": "object",
            "additionalProperties": true
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "BadgeCriteria": {
        "type": "object",
        "properties": {
          "metric": {
            "type": "string",
            "enum": [
              "post_count",
              "reply_count",
              "reputation",
              "trust_level",
              "vote_received",
              "days_active",
              "accepted_answers",
              "spaces_joined"
            ]
          },
          "operator": {
            "type": "string"
          },
          "value": {
            "type": "integer"
          }
        }
      },
      "Badge": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "icon": {
            "type": [
              "string",
              "null"
            ]
          },
          "tier": {
            "type": "string",
            "enum": [
              "bronze",
              "silver",
              "gold"
            ]
          },
          "match_mode": {
            "type": "string",
            "enum": [
              "all",
              "any"
            ]
          },
          "criteria": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BadgeCriteria"
            }
          },
          "earned_count": {
            "type": "integer"
          },
          "active": {
            "type": "boolean"
          }
        }
      },
      "BadgeCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "icon": {
            "type": "string"
          },
          "tier": {
            "type": "string",
            "enum": [
              "bronze",
              "silver",
              "gold"
            ]
          },
          "match_mode": {
            "type": "string",
            "enum": [
              "all",
              "any"
            ]
          },
          "criteria": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BadgeCriteria"
            }
          }
        },
        "required": [
          "name"
        ]
      },
      "BadgeCollection": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Badge"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        }
      },
      "Webhook": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "post.created",
                "post.updated",
                "post.deleted",
                "reply.created",
                "reply.updated",
                "reply.deleted",
                "user.registered",
                "user.trust_level_changed",
                "vote.cast",
                "flag.created",
                "flag.resolved",
                "space.member_joined",
                "space.member_left"
              ]
            }
          },
          "active": {
            "type": "boolean"
          },
          "failure_count": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WebhookCreate": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "post.created",
                "post.updated",
                "post.deleted",
                "reply.created",
                "reply.updated",
                "reply.deleted",
                "user.registered",
                "user.trust_level_changed",
                "vote.cast",
                "flag.created",
                "flag.resolved",
                "space.member_joined",
                "space.member_left"
              ]
            }
          },
          "secret": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          }
        },
        "required": [
          "url",
          "events"
        ]
      },
      "WebhookCollection": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Webhook"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        }
      },
      "WebhookDelivery": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "webhook_id": {
            "type": "integer"
          },
          "event": {
            "type": "string"
          },
          "response_code": {
            "type": [
              "integer",
              "null"
            ]
          },
          "success": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WebhookDeliveryCollection": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookDelivery"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        }
      },
      "WhiteLabel": {
        "type": "object",
        "properties": {
          "brand_name": {
            "type": "string"
          },
          "logo_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "primary_color": {
            "type": [
              "string",
              "null"
            ]
          },
          "hide_powered_by": {
            "type": "boolean"
          },
          "custom_css": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Announcement": {
        "type": "object",
        "properties": {
          "post_id": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "pinned_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AnnouncementCollection": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Announcement"
            }
          }
        }
      },
      "VapidKey": {
        "type": "object",
        "properties": {
          "public_key": {
            "type": "string"
          }
        }
      },
      "AiUsage": {
        "type": "object",
        "properties": {
          "period": {
            "type": "string"
          },
          "total_requests": {
            "type": "integer"
          },
          "total_tokens": {
            "type": "integer"
          },
          "estimated_cost": {
            "type": "number"
          }
        }
      },
      "AiUsageSummary": {
        "type": "object",
        "properties": {
          "providers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "provider": {
                  "type": "string"
                },
                "requests": {
                  "type": "integer"
                },
                "tokens": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "AiSuggestion": {
        "type": "object",
        "properties": {
          "post_id": {
            "type": "integer"
          },
          "suggestion": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "tokens": {
            "type": "integer"
          }
        }
      },
      "ModerationRule": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "action": {
            "type": "string",
            "enum": [
              "flag",
              "hold",
              "spam",
              "trash"
            ]
          },
          "conditions": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "active": {
            "type": "boolean"
          },
          "trigger_count": {
            "type": "integer"
          }
        }
      },
      "ModerationRuleCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "action": {
            "type": "string",
            "enum": [
              "flag",
              "hold",
              "spam",
              "trash"
            ]
          },
          "conditions": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "active": {
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "action"
        ]
      },
      "ModerationRuleCollection": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModerationRule"
            }
          },
          "meta": {
            "$ref": "#/components/schemas/PaginationMeta"
          }
        }
      },
      "ModerationRuleStats": {
        "type": "object",
        "properties": {
          "rule_id": {
            "type": "integer"
          },
          "trigger_count": {
            "type": "integer"
          },
          "last_triggered": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "DigestPreferences": {
        "type": "object",
        "properties": {
          "frequency": {
            "type": "string",
            "enum": [
              "off",
              "daily",
              "weekly"
            ]
          },
          "types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "DigestStats": {
        "type": "object",
        "properties": {
          "sent": {
            "type": "integer"
          },
          "opened": {
            "type": "integer"
          },
          "last_run": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "SpaceSeo": {
        "type": "object",
        "properties": {
          "meta_title": {
            "type": [
              "string",
              "null"
            ]
          },
          "meta_description": {
            "type": [
              "string",
              "null"
            ]
          },
          "og_image": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          }
        }
      },
      "AnonymousReveal": {
        "type": "object",
        "properties": {
          "object_type": {
            "type": "string"
          },
          "object_id": {
            "type": "integer"
          },
          "author_id": {
            "type": "integer"
          },
          "author_login": {
            "type": "string"
          }
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Bad request / validation error (invalid or missing parameters).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Authentication required, or community is in private mode (401 community_private) for a logged-out read.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Authenticated but not permitted (e.g. jetonomy_forbidden, jetonomy_user_banned, jetonomy_pending_verification, rest_cookie_invalid_nonce).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "The requested resource does not exist.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Conflict": {
        "description": "Conflict with current state (e.g. a poll already exists, or the announcement pin cap is reached).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Too many requests - IP rate limit exceeded (429 jetonomy_rate_limited).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  }
}
