{
  "openapi": "3.1.0",
  "info": {
    "title": "Cloudy API",
    "version": "1",
    "description": "Generated from packages/contract. Auth: `Authorization: Bearer <token>`. Errors: non-2xx with { error: { code, message } }."
  },
  "servers": [
    {
      "url": "https://api.cloudtifact.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "security": [
    {
      "bearer": []
    }
  ],
  "paths": {
    "/v1/auth/dev-login": {
      "post": {
        "summary": "TESTS ONLY: 404 unless DEV_AUTH=true (never in production)",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string"
                    },
                    "user": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "handle": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "avatarUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "handle",
                        "name"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "token",
                    "user"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "handle": {
                    "type": "string",
                    "pattern": "^[a-z0-9](?:[a-z0-9-]{0,37}[a-z0-9])?$"
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "email": {
                    "type": "string",
                    "maxLength": 200,
                    "format": "email",
                    "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                  },
                  "label": {
                    "default": "cli",
                    "type": "string",
                    "enum": [
                      "cli",
                      "web"
                    ]
                  }
                },
                "required": [
                  "handle"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/auth/embed-token": {
      "post": {
        "summary": "website sign-in only; a one-hour token for the comment panel on published pages, good only for GET /v1/me, GET /v1/spaces/:id, GET/POST /v1/spaces/:id/comments, POST /v1/spaces/:id/comment-images, GET /v1/spaces/:id/mention-people and PUT/DELETE /v1/comments/:id/reactions/:emoji",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "token",
                    "expiresAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/visitor-link": {
      "post": {
        "summary": "website sign-in only; a two-minute ticket for the published-pages address (/_ct/link), which ties that browser's visitor cookie to you (your views of published pages show your name)",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "token",
                    "expiresAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/carry": {
      "post": {
        "summary": "website sign-in only; keeps this browser's sign-ins for two minutes under a one-use ticket, so a move to our new web address keeps you signed in",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "ticket": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "ticket",
                    "expiresAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "state": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 4096
                  }
                },
                "required": [
                  "state"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/auth/carry/redeem": {
      "post": {
        "summary": "anonymous; swaps a carry ticket for the sign-ins it holds, once; 404 bad, used or expired ticket",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "state": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "state"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ticket": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "required": [
                  "ticket"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/sessions": {
      "post": {
        "summary": "the bearer is a Clerk session token (401 otherwise); swaps it for a browser sign-in (returned once; ends 30 days after last use; not counted toward the device limit) and ends the Clerk session; announced like any new sign-in; 409 when that Clerk session was already swapped (a session becomes one sign-in). `token`: this browser's sign-in for the same account, kept and marked as just confirmed instead",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "number"
                    },
                    "user": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "handle": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "avatarUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "handle",
                        "name"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "token",
                    "expiresAt",
                    "user"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "maxLength": 200
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/review-sign-in": {
      "get": {
        "summary": "anonymous; 204 while App Review's sign-in is on, 404 otherwise",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "204": {
            "description": "No content"
          }
        }
      },
      "post": {
        "summary": "anonymous; App Review's sign-in for the Cloudy app: only the accounts REVIEW_SIGN_IN_USERS names, with the REVIEW_SIGN_IN_CODE secret (404 when either isn't set); makes the account on first use; the token is an app sign-in; 401 wrong username or code; 429 past 10 tries a minute",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string"
                    },
                    "user": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "handle": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "avatarUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "handle",
                        "name"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "token",
                    "user"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "username": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "code": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  }
                },
                "required": [
                  "username",
                  "code"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/auth/cli/start": {
      "post": {
        "summary": "anonymous; begins a device sign-in (CLI, app or MCP); kind \"mcp\" only from apps/mcp (else 403); 429 past 10 pending per IP (or 500 overall)",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "deviceCode": {
                      "type": "string"
                    },
                    "userCode": {
                      "type": "string"
                    },
                    "verificationUrl": {
                      "type": "string"
                    },
                    "expiresIn": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "interval": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "deviceCode",
                    "userCode",
                    "verificationUrl",
                    "expiresIn",
                    "interval"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string",
                    "maxLength": 60
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "cli",
                      "app",
                      "mcp"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/cli/requests/{userCode}": {
      "get": {
        "summary": "website only (a Clerk session or a browser sign-in); what's being approved, where from, and its kind; 404 sign_in_unknown; 429 past 30 lookups a minute per user",
        "tags": [
          "Auth API"
        ],
        "parameters": [
          {
            "name": "userCode",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "userCode": {
                      "type": "string"
                    },
                    "label": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "number"
                    },
                    "expiresAt": {
                      "type": "number"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "approved",
                        "denied",
                        "expired"
                      ]
                    },
                    "requestedFrom": {
                      "default": null,
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "city": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "country": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "city",
                            "country"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "userAgent": {
                      "default": null,
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "kind": {
                      "default": null,
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "cli",
                            "app",
                            "mcp"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "approverCountry": {
                      "default": null,
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "limit": {
                      "default": null,
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "group": {
                              "type": "string",
                              "enum": [
                                "devices",
                                "apps"
                              ]
                            },
                            "max": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "used": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "group",
                            "max",
                            "used"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "userCode",
                    "label",
                    "createdAt",
                    "expiresAt",
                    "status",
                    "requestedFrom",
                    "userAgent",
                    "kind",
                    "approverCountry",
                    "limit"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/cli/decide": {
      "post": {
        "summary": "website only (device tokens: 403); approve or deny; 410 sign_in_expired, 404 sign_in_unknown, 429 as above; 409 sign_in_limit when approving would go past 5 devices (terminals and the app) or 10 AI apps",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "204": {
            "description": "No content"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "userCode": {
                    "type": "string"
                  },
                  "approve": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "userCode",
                  "approve"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/auth/cli/poll": {
      "post": {
        "summary": "anonymous; 202 pending, 403 sign_in_denied, 410 sign_in_expired (gone once collected), 404 sign_in_unknown",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "const": "pending"
                        }
                      },
                      "required": [
                        "status"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "const": "approved"
                        },
                        "token": {
                          "type": "string"
                        },
                        "user": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "handle": {
                              "type": "string"
                            },
                            "name": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "avatarUrl": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "handle",
                            "name"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "status",
                        "token",
                        "user"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "deviceCode": {
                    "type": "string"
                  }
                },
                "required": [
                  "deviceCode"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/me": {
      "get": {
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "user": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "handle": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "avatarUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "handle",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "workspaces": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "slug": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string",
                            "enum": [
                              "owner",
                              "admin",
                              "member",
                              "viewer"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "slug",
                          "name",
                          "role"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "invites": {
                      "default": [],
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "slug": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string",
                            "enum": [
                              "owner",
                              "admin",
                              "member",
                              "viewer"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "slug",
                          "name",
                          "role"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "preferences": {
                      "default": {
                        "developerMode": false
                      },
                      "type": "object",
                      "properties": {
                        "developerMode": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "developerMode"
                      ],
                      "additionalProperties": false
                    },
                    "blocked": {
                      "default": [],
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "deletion": {
                      "default": null,
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "at": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "at"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "user",
                    "workspaces",
                    "invites",
                    "preferences",
                    "blocked",
                    "deletion"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "from the website or the Cloudy app only (CLI and MCP tokens: 403); asks for your account to be deleted in 7 days (GET /v1/me deletion.at), with an email to cancel; then workspaces only you are in (with their live spaces and data), your tokens and sign-ins go; shared workspaces you own pass to the earliest other member; your chat messages show as \"Deleted user\"",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "204": {
            "description": "No content"
          }
        }
      }
    },
    "/v1/me/deletion/cancel": {
      "post": {
        "summary": "cancels a pending deletion (any sign-in)",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "204": {
            "description": "No content"
          }
        }
      }
    },
    "/v1/auth/cancel-deletion": {
      "post": {
        "summary": "anonymous; the deletion email's link: cancels it; 404 bad or expired link",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "204": {
            "description": "No content"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ticket": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  }
                },
                "required": [
                  "ticket"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/me/blocks": {
      "post": {
        "summary": "idempotent; 400 yourself, 404 unknown user; their live space chat stops reaching you from your next connect",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "204": {
            "description": "No content"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "userId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  }
                },
                "required": [
                  "userId"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/me/blocks/{userId}": {
      "delete": {
        "summary": "idempotent",
        "tags": [
          "Auth API"
        ],
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        }
      }
    },
    "/v1/comments/{id}/report": {
      "post": {
        "summary": "signed in, can see the comment; keeps a copy and tells staff (Discord, REPORTS_EMAIL); 400 your own comment",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "enum": [
                      "spam",
                      "abuse",
                      "other"
                    ]
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 1000
                  }
                },
                "required": [
                  "reason"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/report": {
      "post": {
        "summary": "signed in, can see the space; keeps a copy of its name and tells staff",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "enum": [
                      "spam",
                      "abuse",
                      "other"
                    ]
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 1000
                  }
                },
                "required": [
                  "reason"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/me/push-devices": {
      "post": {
        "summary": "idempotent; this phone gets push notifications for you, as well as for other accounts signed in on it (each alert then starts with \"@handle · \"; every push's data has the account's userId); ending the sign-in that registered it stops them",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "204": {
            "description": "No content"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "pattern": "^[0-9a-fA-F]{32,200}$"
                  },
                  "environment": {
                    "type": "string",
                    "enum": [
                      "sandbox",
                      "production"
                    ]
                  }
                },
                "required": [
                  "token",
                  "environment"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/me/push-devices/{token}": {
      "delete": {
        "summary": "idempotent; on signing out of this account: the phone's other accounts keep theirs",
        "tags": [
          "Auth API"
        ],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        }
      }
    },
    "/v1/me/notifications": {
      "get": {
        "summary": "push on or off, quiet hours, your time zone, and the spaces you muted",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "push": {
                      "type": "boolean"
                    },
                    "devices": {
                      "type": "number"
                    },
                    "quietHours": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "start": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 1439
                            },
                            "end": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 1439
                            }
                          },
                          "required": [
                            "start",
                            "end"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "timeZone": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "muted": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "workspace": {
                            "type": "object",
                            "properties": {
                              "slug": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "slug",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "mutedAt": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "workspace",
                          "mutedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "workspaces": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "slug": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "level": {
                            "type": "string",
                            "enum": [
                              "all",
                              "participating",
                              "none"
                            ]
                          }
                        },
                        "required": [
                          "slug",
                          "name",
                          "level"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "push",
                    "devices",
                    "quietHours",
                    "timeZone",
                    "muted",
                    "workspaces"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "400 unknown time zone or a workspace you're not in; `workspaces` sets each one's level (all, participating, none)",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "push": {
                      "type": "boolean"
                    },
                    "devices": {
                      "type": "number"
                    },
                    "quietHours": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "start": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 1439
                            },
                            "end": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 1439
                            }
                          },
                          "required": [
                            "start",
                            "end"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "timeZone": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "muted": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "workspace": {
                            "type": "object",
                            "properties": {
                              "slug": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "slug",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "mutedAt": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "workspace",
                          "mutedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "workspaces": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "slug": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "level": {
                            "type": "string",
                            "enum": [
                              "all",
                              "participating",
                              "none"
                            ]
                          }
                        },
                        "required": [
                          "slug",
                          "name",
                          "level"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "push",
                    "devices",
                    "quietHours",
                    "timeZone",
                    "muted",
                    "workspaces"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "push": {
                    "type": "boolean"
                  },
                  "quietHours": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "start": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 1439
                          },
                          "end": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 1439
                          }
                        },
                        "required": [
                          "start",
                          "end"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "timeZone": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "workspaces": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "string",
                      "enum": [
                        "all",
                        "participating",
                        "none"
                      ]
                    }
                  }
                },
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/v1/me/space-reads": {
      "get": {
        "summary": "?spaces=a,b (at most 50): when you last read each one's comments, anywhere",
        "tags": [
          "Auth API"
        ],
        "parameters": [
          {
            "name": "spaces",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 2000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "reads": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": "number"
                      }
                    }
                  },
                  "required": [
                    "reads"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/me/preferences": {
      "patch": {
        "summary": "your own view settings (developer mode)",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "developerMode": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "developerMode"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "developerMode": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/me/email-preferences": {
      "get": {
        "summary": "which optional emails you get (invitations, comments, product news); account and billing emails are always sent",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "email": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "categories": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "enum": [
                              "invites",
                              "activity",
                              "product"
                            ]
                          },
                          "label": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "enabled": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "label",
                          "description",
                          "enabled"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "email",
                    "categories"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "turn categories on or off; product news is off until you turn it on",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "email": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "categories": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "enum": [
                              "invites",
                              "activity",
                              "product"
                            ]
                          },
                          "label": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "enabled": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "label",
                          "description",
                          "enabled"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "email",
                    "categories"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "invites": {
                    "type": "boolean"
                  },
                  "activity": {
                    "type": "boolean"
                  },
                  "product": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/v1/me/at-link": {
      "get": {
        "summary": "the public space cloudy.page/@handle serves (null: /@handle 301s to /u/handle), and the spaces you may pick",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "spaceId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "choices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "searchIndexed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "spaceId",
                    "choices"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "a person only (website or app); spaceId one of choices, or null; 400 otherwise; searchIndexed: show your profile in search engines",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "spaceId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "choices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "searchIndexed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "spaceId",
                    "choices"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "spaceId": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "searchIndexed": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/me/handle": {
      "patch": {
        "summary": "400 reserved, 409 taken; your personal workspace's slug (and name, if unchanged) follow when it matched the old handle and the new one is free",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "handle": {
                      "type": "string"
                    },
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "avatarUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "handle",
                    "name"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "handle": {
                    "type": "string",
                    "pattern": "^[a-z0-9](?:[a-z0-9-]{0,37}[a-z0-9])?$"
                  }
                },
                "required": [
                  "handle"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/me/avatar": {
      "put": {
        "summary": "your profile picture: WebP or JPEG by magic bytes, exactly 256 x 256, 256 KB, still, no EXIF/XMP; 20 changes a day (429); the old one is deleted",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "handle": {
                      "type": "string"
                    },
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "avatarUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "handle",
                    "name"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "description": "Request: raw image bytes"
      },
      "delete": {
        "summary": "back to initials; counts toward the 20 a day",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "handle": {
                      "type": "string"
                    },
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "avatarUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "handle",
                    "name"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/tokens": {
      "get": {
        "summary": "your device sign-ins: CLI, app and MCP (no hashes); current = this request's token; kind = which client",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "tokens": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "name": {
                            "default": null,
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "number"
                          },
                          "lastUsedAt": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "expiresAt": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "current": {
                            "type": "boolean"
                          },
                          "kind": {
                            "default": null,
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "cli",
                                  "app",
                                  "mcp"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "label",
                          "name",
                          "createdAt",
                          "lastUsedAt",
                          "expiresAt",
                          "current",
                          "kind"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "tokens"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/tokens/current": {
      "delete": {
        "summary": "revokes the token making the request (400 with a Clerk session)",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "204": {
            "description": "No content"
          }
        }
      }
    },
    "/v1/tokens/{id}": {
      "delete": {
        "summary": "revokes one of your own tokens; 404 otherwise; any but the caller's own: website or app only (CLI and MCP tokens: 403)",
        "tags": [
          "Auth API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        }
      }
    },
    "/v1/sign-ins": {
      "get": {
        "summary": "every place you're signed in: browsers, CLI, app and MCP; current first; isNew = under a day old",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "signIns": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "web",
                              "cli",
                              "app",
                              "mcp"
                            ]
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "city": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "country": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "number"
                          },
                          "lastUsedAt": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "expiresAt": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "current": {
                            "type": "boolean"
                          },
                          "isNew": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "type",
                          "name",
                          "city",
                          "country",
                          "createdAt",
                          "lastUsedAt",
                          "expiresAt",
                          "current",
                          "isNew"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "settledAt": {
                      "type": "number"
                    },
                    "idleDays": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "signIns",
                    "settledAt",
                    "idleDays"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/sign-ins/{id}": {
      "delete": {
        "summary": "signs one out (yours only, 404 otherwise); another than the caller: website or app only, and 403 sign_in_too_new from a sign-in under a day old unless that one is unused for 30 days",
        "tags": [
          "Auth API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        }
      }
    },
    "/v1/sign-ins/sign-out-others": {
      "post": {
        "summary": "signs out every other sign-in; website or app only; 403 sign_in_too_new from a sign-in under a day old",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "signedOut": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "signedOut"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/not-me/preview": {
      "post": {
        "summary": "anonymous; the sign-in a new sign-in email's \"This wasn't me\" link is about (null once ended); 404 bad or expired link",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "signIn": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "web",
                                "cli",
                                "app",
                                "mcp"
                              ]
                            },
                            "name": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "city": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "country": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "createdAt": {
                              "type": "number"
                            },
                            "lastUsedAt": {
                              "type": [
                                "number",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "type",
                            "name",
                            "city",
                            "country",
                            "createdAt",
                            "lastUsedAt"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "signIn"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ticket": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  }
                },
                "required": [
                  "ticket"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/auth/not-me": {
      "post": {
        "summary": "anonymous; ends that one sign-in; 404 bad or expired link",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "204": {
            "description": "No content"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "ticket": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  }
                },
                "required": [
                  "ticket"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/workspaces": {
      "get": {
        "summary": "yours (accepted), oldest first",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "slug": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "role": {
                        "type": "string",
                        "enum": [
                          "owner",
                          "admin",
                          "member",
                          "viewer"
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "slug",
                      "name",
                      "role"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "you become owner",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string",
                      "enum": [
                        "owner",
                        "admin",
                        "member",
                        "viewer"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "slug",
                    "name",
                    "role"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "slug": {
                    "type": "string",
                    "pattern": "^[a-z0-9](?:[a-z0-9-]{0,37}[a-z0-9])?$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  }
                },
                "required": [
                  "slug",
                  "name"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{slug}": {
      "get": {
        "summary": "members only (404 otherwise)",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string",
                      "enum": [
                        "owner",
                        "admin",
                        "member",
                        "viewer"
                      ]
                    },
                    "members": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "user": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "handle": {
                                "type": "string"
                              },
                              "name": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "avatarUrl": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "handle",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "role": {
                            "type": "string",
                            "enum": [
                              "owner",
                              "admin",
                              "member",
                              "viewer"
                            ]
                          },
                          "pending": {
                            "type": "boolean"
                          },
                          "joinedAt": {
                            "type": [
                              "number",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "user",
                          "role",
                          "pending",
                          "joinedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "spaceCount": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "createdAt": {
                      "type": "number"
                    },
                    "seats": {
                      "type": "object",
                      "properties": {
                        "used": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "limit": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "used",
                        "limit"
                      ],
                      "additionalProperties": false
                    },
                    "publicPage": {
                      "type": "boolean"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "topic": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "searchIndexed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "id",
                    "slug",
                    "name",
                    "role",
                    "members",
                    "spaceCount",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "admin+; slug must stay unique; publicPage, description, topic, searchIndexed (400 without the public page): cloudy.page/u/:slug; 409 when the slug is a person's handle",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string",
                      "enum": [
                        "owner",
                        "admin",
                        "member",
                        "viewer"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "slug",
                    "name",
                    "role"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "slug": {
                    "type": "string",
                    "pattern": "^[a-z0-9](?:[a-z0-9-]{0,37}[a-z0-9])?$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "publicPage": {
                    "type": "boolean"
                  },
                  "description": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 160
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "topic": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 40
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "searchIndexed": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{slug}/members": {
      "post": {
        "summary": "admin+ invites by handle (pending until accepted); only owners add owners",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "handle": {
                    "type": "string",
                    "pattern": "^[a-z0-9](?:[a-z0-9-]{0,37}[a-z0-9])?$"
                  },
                  "role": {
                    "default": "member",
                    "type": "string",
                    "enum": [
                      "owner",
                      "admin",
                      "member",
                      "viewer"
                    ]
                  }
                },
                "required": [
                  "handle"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{slug}/members/{handle}": {
      "patch": {
        "summary": "admin+; only owners change owners; keeps >= 1 owner",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "role": {
                    "type": "string",
                    "enum": [
                      "owner",
                      "admin",
                      "member",
                      "viewer"
                    ]
                  }
                },
                "required": [
                  "role"
                ]
              }
            }
          }
        }
      },
      "delete": {
        "summary": "admin+ (or yourself, to leave); keeps >= 1 owner",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        }
      }
    },
    "/v1/workspaces/{slug}/invites": {
      "get": {
        "summary": "admin+; live invite links (not revoked, expired or used up)",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "invites": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string",
                            "enum": [
                              "owner",
                              "admin",
                              "member",
                              "viewer"
                            ]
                          },
                          "email": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "maxUses": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "uses": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "expiresAt": {
                            "type": "number"
                          },
                          "createdAt": {
                            "type": "number"
                          },
                          "createdBy": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "handle": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "avatarUrl": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "handle",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "role",
                          "email",
                          "maxUses",
                          "uses",
                          "expiresAt",
                          "createdAt",
                          "createdBy"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "invites"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "admin+; the link is returned once (stored hashed); only owners make owner links",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "invite": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "role": {
                          "type": "string",
                          "enum": [
                            "owner",
                            "admin",
                            "member",
                            "viewer"
                          ]
                        },
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "maxUses": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "uses": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "expiresAt": {
                          "type": "number"
                        },
                        "createdAt": {
                          "type": "number"
                        },
                        "createdBy": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "handle": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "avatarUrl": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "handle",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "role",
                        "email",
                        "maxUses",
                        "uses",
                        "expiresAt",
                        "createdAt",
                        "createdBy"
                      ],
                      "additionalProperties": false
                    },
                    "url": {
                      "type": "string"
                    },
                    "emailed": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "invite",
                    "url",
                    "emailed"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "role": {
                    "default": "member",
                    "type": "string",
                    "enum": [
                      "owner",
                      "admin",
                      "member",
                      "viewer"
                    ]
                  },
                  "email": {
                    "type": "string",
                    "maxLength": 200,
                    "format": "email",
                    "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                  },
                  "maxUses": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 1000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "expiresInDays": {
                    "default": 7,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 30
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{slug}/invites/{id}": {
      "delete": {
        "summary": "admin+; turns the link off",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        }
      }
    },
    "/v1/workspaces/{slug}/domains": {
      "get": {
        "summary": "admin+; the workspace's own domains (ai.acme.com), and whether this server can add them",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "available": {
                      "type": "boolean"
                    },
                    "limit": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "domains": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "hostname": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "pending",
                              "live",
                              "failed"
                            ]
                          },
                          "records": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "type",
                                "name",
                                "value"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "error": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "url": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "number"
                          },
                          "checkedAt": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "liveAt": {
                            "type": [
                              "number",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "hostname",
                          "status",
                          "records",
                          "error",
                          "url",
                          "createdAt",
                          "checkedAt",
                          "liveAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "available",
                    "limit",
                    "domains"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "admin+; one on paid plans (PLANS customDomains), more on Enterprise; 409 taken or not set up here",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "hostname": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "live",
                        "failed"
                      ]
                    },
                    "records": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "type",
                          "name",
                          "value"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "url": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "number"
                    },
                    "checkedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "liveAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "hostname",
                    "status",
                    "records",
                    "error",
                    "url",
                    "createdAt",
                    "checkedAt",
                    "liveAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "hostname": {
                    "type": "string",
                    "maxLength": 300
                  }
                },
                "required": [
                  "hostname"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{slug}/domains/{hostname}/check": {
      "post": {
        "summary": "admin+; checks the DNS record and certificate again: pending, live or failed",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hostname",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "hostname": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "live",
                        "failed"
                      ]
                    },
                    "records": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "type",
                          "name",
                          "value"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "url": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "number"
                    },
                    "checkedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "liveAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "hostname",
                    "status",
                    "records",
                    "error",
                    "url",
                    "createdAt",
                    "checkedAt",
                    "liveAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{slug}/domains/{hostname}": {
      "delete": {
        "summary": "admin+; stops serving it and releases the hostname",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hostname",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        }
      }
    },
    "/v1/workspace-invites/preview": {
      "post": {
        "summary": "anyone with the link; 404 unknown, 410 revoked/expired/used up",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "workspace": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "slug",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "role": {
                      "type": "string",
                      "enum": [
                        "owner",
                        "admin",
                        "member",
                        "viewer"
                      ]
                    },
                    "invitedBy": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "handle": {
                              "type": "string"
                            },
                            "name": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "avatarUrl": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "handle",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "memberCount": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "expiresAt": {
                      "type": "number"
                    },
                    "alreadyMember": {
                      "type": "boolean"
                    },
                    "email": {
                      "default": null,
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "wrongAccount": {
                      "default": false,
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "workspace",
                    "role",
                    "invitedBy",
                    "memberCount",
                    "expiresAt",
                    "alreadyMember",
                    "email",
                    "wrongAccount"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "minLength": 10,
                    "maxLength": 200
                  }
                },
                "required": [
                  "token"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/workspace-invites/accept": {
      "post": {
        "summary": "signed in; joins with the link's role; 403 past the seat limit or wrong email",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "workspace": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "role": {
                          "type": "string",
                          "enum": [
                            "owner",
                            "admin",
                            "member",
                            "viewer"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "slug",
                        "name",
                        "role"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "workspace"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "minLength": 10,
                    "maxLength": 200
                  }
                },
                "required": [
                  "token"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{slug}/accept": {
      "post": {
        "summary": "accept your pending invite; 403 past the seat limit",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        }
      }
    },
    "/v1/workspaces/{slug}/decline": {
      "post": {
        "summary": "decline your pending invite",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        }
      }
    },
    "/v1/workspaces/{slug}/audit": {
      "get": {
        "summary": "admin+; newest first: members, invites, billing, sharing, going live",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            }
          },
          {
            "name": "beforeId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "action": {
                            "type": "string",
                            "enum": [
                              "workspace.updated",
                              "member.invited",
                              "member.joined",
                              "member.declined",
                              "member.role_changed",
                              "member.removed",
                              "member.left",
                              "invite_link.created",
                              "invite_link.revoked",
                              "billing.checkout",
                              "space.created",
                              "space.updated",
                              "space.moved",
                              "space.deleted",
                              "space.archived",
                              "space.unarchived",
                              "space.trashed",
                              "space.restored",
                              "page.added",
                              "space.filed",
                              "folder.created",
                              "folder.renamed",
                              "folder.moved",
                              "folder.deleted",
                              "folder.restored",
                              "space.merged",
                              "space.link_changed",
                              "space.person_added",
                              "space.person_changed",
                              "space.person_removed",
                              "app.went_live",
                              "app.updated_live",
                              "app.rolled_back",
                              "app.deleted",
                              "discord.connected",
                              "discord.changed",
                              "discord.disconnected",
                              "domain.added",
                              "domain.removed",
                              "rule.created",
                              "rule.updated",
                              "rule.deleted"
                            ]
                          },
                          "actor": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "handle": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "avatarUrl": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "handle",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "targetId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "targetLabel": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "detail": {
                            "anyOf": [
                              {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {}
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "via": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "id",
                          "action",
                          "actor",
                          "targetId",
                          "targetLabel",
                          "detail",
                          "via",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "nextId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "events",
                    "next"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{slug}/activity": {
      "get": {
        "summary": "members; changes to the spaces you can see, newest first, each with canUndo; v=2 adds the folder events",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "person",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            }
          },
          {
            "name": "beforeId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "v",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "action": {
                            "type": "string",
                            "enum": [
                              "space.created",
                              "space.archived",
                              "space.unarchived",
                              "space.trashed",
                              "space.restored",
                              "page.added",
                              "space.filed",
                              "folder.created",
                              "folder.renamed",
                              "folder.moved",
                              "folder.deleted",
                              "folder.restored",
                              "space.merged"
                            ]
                          },
                          "actor": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "handle": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "avatarUrl": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "handle",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "via": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "space": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "page": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "path": {
                                    "type": "string"
                                  },
                                  "title": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "path",
                                  "title"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "folder": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "from": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "to": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "undoes": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "canUndo": {
                            "type": "boolean"
                          },
                          "undone": {
                            "type": "boolean"
                          },
                          "createdAt": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "id",
                          "action",
                          "actor",
                          "via",
                          "space",
                          "page",
                          "undoes",
                          "canUndo",
                          "undone",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "next": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "nextId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "events",
                    "next",
                    "nextId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{slug}/activity/{id}/undo": {
      "post": {
        "summary": "does the opposite; 409 when it no longer applies; moving to the Trash and removing a folder: people only",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "event": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "action": {
                          "type": "string",
                          "enum": [
                            "space.created",
                            "space.archived",
                            "space.unarchived",
                            "space.trashed",
                            "space.restored",
                            "page.added",
                            "space.filed",
                            "folder.created",
                            "folder.renamed",
                            "folder.moved",
                            "folder.deleted",
                            "folder.restored",
                            "space.merged"
                          ]
                        },
                        "actor": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "handle": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "avatarUrl": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "handle",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "via": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "space": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "page": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "path": {
                                  "type": "string"
                                },
                                "title": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "path",
                                "title"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "folder": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "from": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "to": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "undoes": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "canUndo": {
                          "type": "boolean"
                        },
                        "undone": {
                          "type": "boolean"
                        },
                        "createdAt": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "id",
                        "action",
                        "actor",
                        "via",
                        "space",
                        "page",
                        "undoes",
                        "canUndo",
                        "undone",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "event"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{slug}/folders": {
      "get": {
        "summary": "members; the sidebar's folders, any depth, parents first, each with its path and space count",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "folders": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "parentId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "icon": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "path": {
                            "type": "string"
                          },
                          "spaces": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "createdAt": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "id",
                          "parentId",
                          "name",
                          "description",
                          "path",
                          "spaces",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "folders"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "members who can edit (agents too); 409 when a sibling has the name",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "parentId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "icon": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "path": {
                      "type": "string"
                    },
                    "spaces": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "createdAt": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "id",
                    "parentId",
                    "name",
                    "description",
                    "path",
                    "spaces",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "parentId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "description": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 300
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{slug}/rules": {
      "get": {
        "summary": "members; the workspace's agent rules (every space gets them). `enabled: false` and none while the feature is off",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean"
                    },
                    "rules": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "scope": {
                            "type": "string",
                            "enum": [
                              "workspace",
                              "space"
                            ]
                          },
                          "when": {
                            "type": "string"
                          },
                          "do": {
                            "type": "string"
                          },
                          "skill": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "mine": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "replaced": {
                            "type": "boolean"
                          },
                          "version": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "updatedAt": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "scope",
                          "when",
                          "do",
                          "skill",
                          "enabled",
                          "mine",
                          "replaced",
                          "version",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "enabled",
                    "rules"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "admins; 409 when the name is taken; 404 while the feature is off",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean"
                    },
                    "rules": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "scope": {
                            "type": "string",
                            "enum": [
                              "workspace",
                              "space"
                            ]
                          },
                          "when": {
                            "type": "string"
                          },
                          "do": {
                            "type": "string"
                          },
                          "skill": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "mine": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "replaced": {
                            "type": "boolean"
                          },
                          "version": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "updatedAt": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "scope",
                          "when",
                          "do",
                          "skill",
                          "enabled",
                          "mine",
                          "replaced",
                          "version",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "enabled",
                    "rules"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9-]{0,39}$"
                  },
                  "when": {
                    "default": "",
                    "type": "string",
                    "maxLength": 500
                  },
                  "do": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "skill": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[a-z0-9][a-z0-9-]{0,39}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "do"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{slug}/rules/{name}": {
      "patch": {
        "summary": "admins",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean"
                    },
                    "rules": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "scope": {
                            "type": "string",
                            "enum": [
                              "workspace",
                              "space"
                            ]
                          },
                          "when": {
                            "type": "string"
                          },
                          "do": {
                            "type": "string"
                          },
                          "skill": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "mine": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "replaced": {
                            "type": "boolean"
                          },
                          "version": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "updatedAt": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "scope",
                          "when",
                          "do",
                          "skill",
                          "enabled",
                          "mine",
                          "replaced",
                          "version",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "enabled",
                    "rules"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "when": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "do": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "skill": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[a-z0-9][a-z0-9-]{0,39}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "admins",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean"
                    },
                    "rules": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "scope": {
                            "type": "string",
                            "enum": [
                              "workspace",
                              "space"
                            ]
                          },
                          "when": {
                            "type": "string"
                          },
                          "do": {
                            "type": "string"
                          },
                          "skill": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "mine": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "replaced": {
                            "type": "boolean"
                          },
                          "version": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "updatedAt": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "scope",
                          "when",
                          "do",
                          "skill",
                          "enabled",
                          "mine",
                          "replaced",
                          "version",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "enabled",
                    "rules"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{slug}/folders/{id}": {
      "patch": {
        "summary": "members who can edit (agents too); rename, describe, change the icon, or move (parentId; never inside itself)",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "parentId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "icon": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "path": {
                      "type": "string"
                    },
                    "spaces": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "createdAt": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "id",
                    "parentId",
                    "name",
                    "description",
                    "path",
                    "spaces",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "description": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 300
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "icon": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 16
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "parentId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "a person only; what was in it moves up a level; Undo in Activity brings it back",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        }
      }
    },
    "/v1/workspaces/{slug}/tidy": {
      "get": {
        "summary": "members; your own look-alike spaces (to merge) and finished ones (to archive)",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "lookAlikes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "topic": {
                            "type": "string"
                          },
                          "into": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "latestVersion": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "updatedAt": {
                                "type": "number"
                              },
                              "canMerge": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "latestVersion",
                              "updatedAt",
                              "canMerge"
                            ],
                            "additionalProperties": false
                          },
                          "spaces": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "latestVersion": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "updatedAt": {
                                  "type": "number"
                                },
                                "canMerge": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "id",
                                "name",
                                "latestVersion",
                                "updatedAt",
                                "canMerge"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "topic",
                          "into",
                          "spaces"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "finished": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "space": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "latestVersion": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "updatedAt": {
                                "type": "number"
                              },
                              "canMerge": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "latestVersion",
                              "updatedAt",
                              "canMerge"
                            ],
                            "additionalProperties": false
                          },
                          "why": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "space",
                          "why"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "lookAlikes",
                    "finished"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{slug}/discord": {
      "get": {
        "summary": "members; the Discord channels that follow this workspace",
        "tags": [
          "Discord API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "channels": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "channelId": {
                            "type": "string"
                          },
                          "guildId": {
                            "type": "string"
                          },
                          "guildName": {
                            "type": "string"
                          },
                          "channelName": {
                            "type": "string"
                          },
                          "spaces": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "spaceIds": {
                            "anyOf": [
                              {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "totalSpaces": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "addedBy": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "handle": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "avatarUrl": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "handle",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "createdAt": {
                            "type": "number"
                          },
                          "lastUsedAt": {
                            "type": [
                              "number",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "channelId",
                          "guildId",
                          "guildName",
                          "channelName",
                          "spaces",
                          "totalSpaces",
                          "addedBy",
                          "createdAt",
                          "lastUsedAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "spaces": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "visibility": {
                            "type": "string",
                            "enum": [
                              "public",
                              "members"
                            ]
                          },
                          "passwordProtected": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "visibility",
                          "passwordProtected"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "channels"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{slug}/discord/{channelId}": {
      "put": {
        "summary": "admin+; changes what the channel follows in this workspace",
        "tags": [
          "Discord API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "spaceIds": {
                    "anyOf": [
                      {
                        "minItems": 1,
                        "maxItems": 500,
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "spaceIds"
                ]
              }
            }
          }
        }
      },
      "delete": {
        "summary": "admin+; the channel stops following this workspace",
        "tags": [
          "Discord API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        }
      }
    },
    "/v1/discord/connects/{userCode}": {
      "get": {
        "summary": "Clerk session only; a /cloudtifact request from a Discord channel, and your workspaces to share with it",
        "tags": [
          "Discord API"
        ],
        "parameters": [
          {
            "name": "userCode",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "userCode": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "approved",
                        "denied",
                        "expired"
                      ]
                    },
                    "expiresAt": {
                      "type": "number"
                    },
                    "guildName": {
                      "type": "string"
                    },
                    "channelName": {
                      "type": "string"
                    },
                    "askedBy": {
                      "type": "string"
                    },
                    "workspaces": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "slug": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "canShare": {
                            "type": "boolean"
                          },
                          "following": {
                            "anyOf": [
                              {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "suggested": {
                            "type": "boolean"
                          },
                          "spaces": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "visibility": {
                                  "type": "string",
                                  "enum": [
                                    "public",
                                    "members"
                                  ]
                                },
                                "passwordProtected": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "id",
                                "name",
                                "visibility",
                                "passwordProtected"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "slug",
                          "name",
                          "canShare",
                          "suggested",
                          "spaces"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "others": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "sharedBy": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "name",
                          "sharedBy"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "userCode",
                    "status",
                    "expiresAt",
                    "guildName",
                    "channelName",
                    "askedBy",
                    "workspaces",
                    "others"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/discord/connects/{userCode}/decide": {
      "post": {
        "summary": "Clerk session only; approving sets what the channel follows in the workspaces you administer",
        "tags": [
          "Discord API"
        ],
        "parameters": [
          {
            "name": "userCode",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "approve": {
                    "type": "boolean"
                  },
                  "workspaces": {
                    "default": [],
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "slug": {
                          "type": "string"
                        },
                        "spaceIds": {
                          "anyOf": [
                            {
                              "maxItems": 500,
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "slug",
                        "spaceIds"
                      ]
                    }
                  }
                },
                "required": [
                  "approve"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/discord/connects": {
      "post": {
        "summary": "bot only (DISCORD_BOT_HEADER; 404 without it)",
        "tags": [
          "Discord API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "userCode": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "expiresIn": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "userCode",
                    "url",
                    "expiresIn"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "guildId": {
                    "type": "string",
                    "pattern": "^\\d{5,25}$"
                  },
                  "guildName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "channelId": {
                    "type": "string",
                    "pattern": "^\\d{5,25}$"
                  },
                  "channelName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "user": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^\\d{5,25}$"
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ]
                  }
                },
                "required": [
                  "guildId",
                  "guildName",
                  "channelId",
                  "channelName",
                  "user"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/discord/channels/{channelId}": {
      "get": {
        "summary": "bot only",
        "tags": [
          "Discord API"
        ],
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "connected": {
                      "type": "boolean"
                    },
                    "workspaces": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "slug": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "spaces": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "totalSpaces": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "main": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "slug",
                          "name",
                          "spaces",
                          "totalSpaces",
                          "main"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "connected",
                    "workspaces"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "bot only; disconnects the channel from everything",
        "tags": [
          "Discord API"
        ],
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "user": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^\\d{5,25}$"
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ]
                  }
                },
                "required": [
                  "user"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/discord/channels/{channelId}/spaces": {
      "get": {
        "summary": "bot only; the spaces the channel follows, newest version first",
        "tags": [
          "Discord API"
        ],
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 100
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 25,
              "type": "integer",
              "minimum": 1,
              "maximum": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "spaces": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "workspace": {
                            "type": "object",
                            "properties": {
                              "slug": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "slug",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "latestVersion": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "openComments": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "url": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "workspace",
                          "latestVersion",
                          "openComments",
                          "url"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "spaces"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "bot only; makes an empty members-only space in the channel's first workspace, with the thread linked as its home (20 a day per channel). A thread that already has a space gets that one back, with existing: true",
        "tags": [
          "Discord API"
        ],
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "space": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "url"
                      ],
                      "additionalProperties": false
                    },
                    "existing": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "space",
                    "existing"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "threadId": {
                    "type": "string",
                    "pattern": "^\\d{5,25}$"
                  },
                  "threadName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "user": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^\\d{5,25}$"
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ]
                  }
                },
                "required": [
                  "name",
                  "threadId",
                  "threadName",
                  "user"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/discord/channels/{channelId}/spaces/{id}/threads": {
      "get": {
        "summary": "bot only; a followed space's open threads, and its home",
        "tags": [
          "Discord API"
        ],
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "space": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "workspace": {
                          "type": "object",
                          "properties": {
                            "slug": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "slug",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        "latestVersion": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "openComments": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "url": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "workspace",
                        "latestVersion",
                        "openComments",
                        "url"
                      ],
                      "additionalProperties": false
                    },
                    "linked": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "home": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "channelId": {
                              "type": "string"
                            },
                            "threadId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "channelId",
                            "threadId"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "threads": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "author": {
                            "type": "string"
                          },
                          "body": {
                            "type": "string"
                          },
                          "quote": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "replies": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "createdAt": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "id",
                          "author",
                          "body",
                          "quote",
                          "replies",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "space",
                    "linked",
                    "home",
                    "threads"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/discord/channels/{channelId}/spaces/{id}/home": {
      "post": {
        "summary": "bot only; the followed space's news goes to this channel only",
        "tags": [
          "Discord API"
        ],
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "space": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "url"
                      ],
                      "additionalProperties": false
                    },
                    "previous": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "channelId": {
                              "type": "string"
                            },
                            "threadId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "channelId",
                            "threadId"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "space",
                    "previous"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "user": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^\\d{5,25}$"
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ]
                  }
                },
                "required": [
                  "user"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/discord/channels/{channelId}/main": {
      "post": {
        "summary": "bot only; the main channel of every workspace it follows: spaces without a home post here",
        "tags": [
          "Discord API"
        ],
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "workspaces": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "workspaces"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "user": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^\\d{5,25}$"
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ]
                  }
                },
                "required": [
                  "user"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/discord/channels/{channelId}/info": {
      "get": {
        "summary": "bot only; the spaces linked to a thread, the spaces that post in this channel, and how many post elsewhere",
        "tags": [
          "Discord API"
        ],
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "threadId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{5,25}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "thread": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "space": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "url": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "url"
                            ],
                            "additionalProperties": false
                          },
                          "home": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "channelId": {
                                    "type": "string"
                                  },
                                  "threadId": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "channelId",
                                  "threadId"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "space",
                          "home"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "here": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "space": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "url": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "url"
                            ],
                            "additionalProperties": false
                          },
                          "threadId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "space",
                          "threadId"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "hereTotal": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "main": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "elsewhere": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "thread",
                    "here",
                    "hereTotal",
                    "main",
                    "elsewhere"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/discord/channels/{channelId}/comments": {
      "post": {
        "summary": "bot only; a comment written in Discord, as a guest named after the Discord user, via \"discord\"",
        "tags": [
          "Discord API"
        ],
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "threadId": {
                      "type": "string"
                    },
                    "spaceId": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "threadId",
                    "spaceId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "spaceId": {
                    "type": "string"
                  },
                  "parentId": {
                    "type": "string"
                  },
                  "body": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 10000
                  },
                  "author": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^\\d{5,25}$"
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ]
                  }
                },
                "required": [
                  "spaceId",
                  "body",
                  "author"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/discord/channels/{channelId}/comments/{id}/resolve": {
      "post": {
        "summary": "bot only; resolves a thread on a followed space",
        "tags": [
          "Discord API"
        ],
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "user": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^\\d{5,25}$"
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ]
                  }
                },
                "required": [
                  "user"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/discord/channels/{channelId}/links": {
      "post": {
        "summary": "bot only; links a thread (or the channel) to a followed space and makes it the space's home",
        "tags": [
          "Discord API"
        ],
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "space": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "url"
                      ],
                      "additionalProperties": false
                    },
                    "previous": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "channelId": {
                              "type": "string"
                            },
                            "threadId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "channelId",
                            "threadId"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "space",
                    "previous"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "spaceId": {
                    "type": "string"
                  },
                  "threadId": {
                    "type": "string",
                    "pattern": "^\\d{5,25}$"
                  },
                  "threadName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "user": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^\\d{5,25}$"
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ]
                  }
                },
                "required": [
                  "spaceId",
                  "threadId",
                  "threadName",
                  "user"
                ]
              }
            }
          }
        }
      },
      "delete": {
        "summary": "bot only; unlinks it; if it was the space's home, the space posts in the main channel again",
        "tags": [
          "Discord API"
        ],
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "spaceId": {
                    "type": "string"
                  },
                  "threadId": {
                    "type": "string",
                    "pattern": "^\\d{5,25}$"
                  },
                  "threadName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "user": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^\\d{5,25}$"
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ]
                  }
                },
                "required": [
                  "spaceId",
                  "threadId",
                  "threadName",
                  "user"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/discord": {
      "get": {
        "summary": "push access; the Discord threads linked to this space",
        "tags": [
          "Discord API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "links": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "threadId": {
                            "type": "string"
                          },
                          "channelId": {
                            "type": "string"
                          },
                          "guildName": {
                            "type": "string"
                          },
                          "channelName": {
                            "type": "string"
                          },
                          "threadName": {
                            "type": "string"
                          },
                          "isChannel": {
                            "type": "boolean"
                          },
                          "linkedBy": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "number"
                          },
                          "url": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "threadId",
                          "channelId",
                          "guildName",
                          "channelName",
                          "threadName",
                          "isChannel",
                          "linkedBy",
                          "createdAt",
                          "url"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "links"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/discord/{threadId}": {
      "get": {
        "summary": "push access; the linked thread's messages, read from Discord now and not stored; + liveUrl",
        "tags": [
          "Discord API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "threadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "all",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1",
                "true"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "link": {
                      "type": "object",
                      "properties": {
                        "threadId": {
                          "type": "string"
                        },
                        "channelId": {
                          "type": "string"
                        },
                        "guildName": {
                          "type": "string"
                        },
                        "channelName": {
                          "type": "string"
                        },
                        "threadName": {
                          "type": "string"
                        },
                        "isChannel": {
                          "type": "boolean"
                        },
                        "linkedBy": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "number"
                        },
                        "url": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "threadId",
                        "channelId",
                        "guildName",
                        "channelName",
                        "threadName",
                        "isChannel",
                        "linkedBy",
                        "createdAt",
                        "url"
                      ],
                      "additionalProperties": false
                    },
                    "messages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "author": {
                            "type": "string"
                          },
                          "body": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "number"
                          },
                          "edited": {
                            "type": "boolean"
                          },
                          "attachments": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "url": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "name",
                                "url"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "id",
                          "author",
                          "body",
                          "createdAt",
                          "edited",
                          "attachments"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "more": {
                      "type": "boolean"
                    },
                    "liveUrl": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "link",
                    "messages",
                    "more"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "push access; unlinks the thread; if it was the space's home, the space posts in the main channel again",
        "tags": [
          "Discord API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "threadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        }
      }
    },
    "/v1/spaces": {
      "get": {
        "summary": "?workspace=<slug>: that workspace's spaces you can see (unknown slug: empty); else all you can push to. ?status=active (default, no archived), archived, or trash (what you may restore); each with your favorite and openedAt",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9](?:[a-z0-9-]{0,37}[a-z0-9])?$"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "default": "active",
              "type": "string",
              "enum": [
                "active",
                "archived",
                "trash"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "spaces": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "pattern": "^[0-9a-z]{10}$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "workspace": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "slug": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "slug",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "visibility": {
                            "type": "string",
                            "enum": [
                              "public",
                              "members"
                            ]
                          },
                          "guestComments": {
                            "type": "boolean"
                          },
                          "guestWrites": {
                            "type": "boolean"
                          },
                          "viewers": {
                            "type": "object",
                            "properties": {
                              "files": {
                                "type": "boolean"
                              },
                              "history": {
                                "type": "boolean"
                              },
                              "data": {
                                "type": "boolean"
                              },
                              "dbRead": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "files",
                              "history",
                              "data",
                              "dbRead"
                            ],
                            "additionalProperties": false
                          },
                          "passwordProtected": {
                            "default": false,
                            "type": "boolean"
                          },
                          "latestVersion": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "path": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "shareUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "slug": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "searchIndexed": {
                            "type": "boolean"
                          },
                          "kind": {
                            "default": "repo",
                            "type": "string",
                            "enum": [
                              "repo",
                              "live",
                              "app"
                            ]
                          },
                          "permissions": {
                            "type": "object",
                            "properties": {
                              "canView": {
                                "type": "boolean"
                              },
                              "canPush": {
                                "type": "boolean"
                              },
                              "canComment": {
                                "type": "boolean"
                              },
                              "canAdmin": {
                                "type": "boolean"
                              },
                              "canGuestComment": {
                                "type": "boolean"
                              },
                              "canGuestWrite": {
                                "type": "boolean"
                              },
                              "canSeeFiles": {
                                "type": "boolean"
                              },
                              "canSeeHistory": {
                                "type": "boolean"
                              },
                              "canSeeData": {
                                "type": "boolean"
                              },
                              "canReadDb": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "canView",
                              "canPush",
                              "canComment",
                              "canAdmin",
                              "canGuestComment",
                              "canGuestWrite",
                              "canSeeFiles",
                              "canSeeHistory",
                              "canSeeData",
                              "canReadDb"
                            ],
                            "additionalProperties": false
                          },
                          "createdAt": {
                            "type": "number"
                          },
                          "createdBy": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "snapshotUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "archivedAt": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "project": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "deletedAt": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "favorite": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "openedAt": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "icon": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "folderId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "mergedInto": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "page": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "page"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "workspace",
                          "visibility",
                          "guestComments",
                          "guestWrites",
                          "viewers",
                          "passwordProtected",
                          "latestVersion",
                          "path",
                          "url",
                          "shareUrl",
                          "kind",
                          "permissions",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "spaces"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Spaces API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[0-9a-z]{10}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "workspace": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "slug",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "visibility": {
                      "type": "string",
                      "enum": [
                        "public",
                        "members"
                      ]
                    },
                    "guestComments": {
                      "type": "boolean"
                    },
                    "guestWrites": {
                      "type": "boolean"
                    },
                    "viewers": {
                      "type": "object",
                      "properties": {
                        "files": {
                          "type": "boolean"
                        },
                        "history": {
                          "type": "boolean"
                        },
                        "data": {
                          "type": "boolean"
                        },
                        "dbRead": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "files",
                        "history",
                        "data",
                        "dbRead"
                      ],
                      "additionalProperties": false
                    },
                    "passwordProtected": {
                      "default": false,
                      "type": "boolean"
                    },
                    "latestVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "path": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "shareUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "slug": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "searchIndexed": {
                      "type": "boolean"
                    },
                    "kind": {
                      "default": "repo",
                      "type": "string",
                      "enum": [
                        "repo",
                        "live",
                        "app"
                      ]
                    },
                    "permissions": {
                      "type": "object",
                      "properties": {
                        "canView": {
                          "type": "boolean"
                        },
                        "canPush": {
                          "type": "boolean"
                        },
                        "canComment": {
                          "type": "boolean"
                        },
                        "canAdmin": {
                          "type": "boolean"
                        },
                        "canGuestComment": {
                          "type": "boolean"
                        },
                        "canGuestWrite": {
                          "type": "boolean"
                        },
                        "canSeeFiles": {
                          "type": "boolean"
                        },
                        "canSeeHistory": {
                          "type": "boolean"
                        },
                        "canSeeData": {
                          "type": "boolean"
                        },
                        "canReadDb": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "canView",
                        "canPush",
                        "canComment",
                        "canAdmin",
                        "canGuestComment",
                        "canGuestWrite",
                        "canSeeFiles",
                        "canSeeHistory",
                        "canSeeData",
                        "canReadDb"
                      ],
                      "additionalProperties": false
                    },
                    "createdAt": {
                      "type": "number"
                    },
                    "createdBy": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "snapshotUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "archivedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "project": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "deletedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "favorite": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "openedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "icon": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "folderId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "mergedInto": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "page": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "page"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "workspace",
                    "visibility",
                    "guestComments",
                    "guestWrites",
                    "viewers",
                    "passwordProtected",
                    "latestVersion",
                    "path",
                    "url",
                    "shareUrl",
                    "kind",
                    "permissions",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "workspace": {
                    "type": "string",
                    "pattern": "^[a-z0-9](?:[a-z0-9-]{0,37}[a-z0-9])?$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "visibility": {
                    "default": "members",
                    "type": "string",
                    "enum": [
                      "public",
                      "members"
                    ]
                  },
                  "folderId": {
                    "type": "string",
                    "maxLength": 64
                  }
                },
                "required": [
                  "workspace",
                  "name"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/spaces/find": {
      "get": {
        "summary": "?q=<words>&workspace=<slug>&status=active archived: spaces you can see (active by default) whose name or page titles match, best first; strong = close enough to publish into (topicMatch); page/pagePath = the page whose title matched at least as well as the name",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9](?:[a-z0-9-]{0,37}[a-z0-9])?$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 10,
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "default": "active",
              "type": "string",
              "enum": [
                "active",
                "archived"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "spaces": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "pattern": "^[0-9a-z]{10}$"
                          },
                          "name": {
                            "type": "string"
                          },
                          "workspace": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "slug": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "slug",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "visibility": {
                            "type": "string",
                            "enum": [
                              "public",
                              "members"
                            ]
                          },
                          "guestComments": {
                            "type": "boolean"
                          },
                          "guestWrites": {
                            "type": "boolean"
                          },
                          "viewers": {
                            "type": "object",
                            "properties": {
                              "files": {
                                "type": "boolean"
                              },
                              "history": {
                                "type": "boolean"
                              },
                              "data": {
                                "type": "boolean"
                              },
                              "dbRead": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "files",
                              "history",
                              "data",
                              "dbRead"
                            ],
                            "additionalProperties": false
                          },
                          "passwordProtected": {
                            "default": false,
                            "type": "boolean"
                          },
                          "latestVersion": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "path": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "shareUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "slug": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "searchIndexed": {
                            "type": "boolean"
                          },
                          "kind": {
                            "default": "repo",
                            "type": "string",
                            "enum": [
                              "repo",
                              "live",
                              "app"
                            ]
                          },
                          "permissions": {
                            "type": "object",
                            "properties": {
                              "canView": {
                                "type": "boolean"
                              },
                              "canPush": {
                                "type": "boolean"
                              },
                              "canComment": {
                                "type": "boolean"
                              },
                              "canAdmin": {
                                "type": "boolean"
                              },
                              "canGuestComment": {
                                "type": "boolean"
                              },
                              "canGuestWrite": {
                                "type": "boolean"
                              },
                              "canSeeFiles": {
                                "type": "boolean"
                              },
                              "canSeeHistory": {
                                "type": "boolean"
                              },
                              "canSeeData": {
                                "type": "boolean"
                              },
                              "canReadDb": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "canView",
                              "canPush",
                              "canComment",
                              "canAdmin",
                              "canGuestComment",
                              "canGuestWrite",
                              "canSeeFiles",
                              "canSeeHistory",
                              "canSeeData",
                              "canReadDb"
                            ],
                            "additionalProperties": false
                          },
                          "createdAt": {
                            "type": "number"
                          },
                          "createdBy": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "snapshotUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "archivedAt": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "project": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "deletedAt": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "favorite": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "openedAt": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "icon": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "folderId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "mergedInto": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "page": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "id",
                                  "page"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "pages": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "score": {
                            "type": "number"
                          },
                          "strong": {
                            "type": "boolean"
                          },
                          "page": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pagePath": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "workspace",
                          "visibility",
                          "guestComments",
                          "guestWrites",
                          "viewers",
                          "passwordProtected",
                          "latestVersion",
                          "path",
                          "url",
                          "shareUrl",
                          "kind",
                          "permissions",
                          "createdAt",
                          "pages",
                          "score",
                          "strong",
                          "page"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "spaces"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}": {
      "get": {
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[0-9a-z]{10}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "workspace": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "slug",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "visibility": {
                      "type": "string",
                      "enum": [
                        "public",
                        "members"
                      ]
                    },
                    "guestComments": {
                      "type": "boolean"
                    },
                    "guestWrites": {
                      "type": "boolean"
                    },
                    "viewers": {
                      "type": "object",
                      "properties": {
                        "files": {
                          "type": "boolean"
                        },
                        "history": {
                          "type": "boolean"
                        },
                        "data": {
                          "type": "boolean"
                        },
                        "dbRead": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "files",
                        "history",
                        "data",
                        "dbRead"
                      ],
                      "additionalProperties": false
                    },
                    "passwordProtected": {
                      "default": false,
                      "type": "boolean"
                    },
                    "latestVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "path": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "shareUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "slug": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "searchIndexed": {
                      "type": "boolean"
                    },
                    "kind": {
                      "default": "repo",
                      "type": "string",
                      "enum": [
                        "repo",
                        "live",
                        "app"
                      ]
                    },
                    "permissions": {
                      "type": "object",
                      "properties": {
                        "canView": {
                          "type": "boolean"
                        },
                        "canPush": {
                          "type": "boolean"
                        },
                        "canComment": {
                          "type": "boolean"
                        },
                        "canAdmin": {
                          "type": "boolean"
                        },
                        "canGuestComment": {
                          "type": "boolean"
                        },
                        "canGuestWrite": {
                          "type": "boolean"
                        },
                        "canSeeFiles": {
                          "type": "boolean"
                        },
                        "canSeeHistory": {
                          "type": "boolean"
                        },
                        "canSeeData": {
                          "type": "boolean"
                        },
                        "canReadDb": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "canView",
                        "canPush",
                        "canComment",
                        "canAdmin",
                        "canGuestComment",
                        "canGuestWrite",
                        "canSeeFiles",
                        "canSeeHistory",
                        "canSeeData",
                        "canReadDb"
                      ],
                      "additionalProperties": false
                    },
                    "createdAt": {
                      "type": "number"
                    },
                    "createdBy": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "snapshotUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "archivedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "project": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "deletedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "favorite": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "openedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "icon": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "folderId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "mergedInto": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "page": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "page"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "workspace",
                    "visibility",
                    "guestComments",
                    "guestWrites",
                    "viewers",
                    "passwordProtected",
                    "latestVersion",
                    "path",
                    "url",
                    "shareUrl",
                    "kind",
                    "permissions",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "slug: 2-60 lowercase letters, numbers and single dashes; 409 when another space has it now or had it before; the old link (cloudy.page/<old>/) 301s to the new one, or to the id link; a new slug (custom link) where the space had none: 403 plan_limit when the workspace is at its custom-link cap (default 1, staff raise it per workspace); renaming or removing one is never capped",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[0-9a-z]{10}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "workspace": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "slug",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "visibility": {
                      "type": "string",
                      "enum": [
                        "public",
                        "members"
                      ]
                    },
                    "guestComments": {
                      "type": "boolean"
                    },
                    "guestWrites": {
                      "type": "boolean"
                    },
                    "viewers": {
                      "type": "object",
                      "properties": {
                        "files": {
                          "type": "boolean"
                        },
                        "history": {
                          "type": "boolean"
                        },
                        "data": {
                          "type": "boolean"
                        },
                        "dbRead": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "files",
                        "history",
                        "data",
                        "dbRead"
                      ],
                      "additionalProperties": false
                    },
                    "passwordProtected": {
                      "default": false,
                      "type": "boolean"
                    },
                    "latestVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "path": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "shareUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "slug": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "searchIndexed": {
                      "type": "boolean"
                    },
                    "kind": {
                      "default": "repo",
                      "type": "string",
                      "enum": [
                        "repo",
                        "live",
                        "app"
                      ]
                    },
                    "permissions": {
                      "type": "object",
                      "properties": {
                        "canView": {
                          "type": "boolean"
                        },
                        "canPush": {
                          "type": "boolean"
                        },
                        "canComment": {
                          "type": "boolean"
                        },
                        "canAdmin": {
                          "type": "boolean"
                        },
                        "canGuestComment": {
                          "type": "boolean"
                        },
                        "canGuestWrite": {
                          "type": "boolean"
                        },
                        "canSeeFiles": {
                          "type": "boolean"
                        },
                        "canSeeHistory": {
                          "type": "boolean"
                        },
                        "canSeeData": {
                          "type": "boolean"
                        },
                        "canReadDb": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "canView",
                        "canPush",
                        "canComment",
                        "canAdmin",
                        "canGuestComment",
                        "canGuestWrite",
                        "canSeeFiles",
                        "canSeeHistory",
                        "canSeeData",
                        "canReadDb"
                      ],
                      "additionalProperties": false
                    },
                    "createdAt": {
                      "type": "number"
                    },
                    "createdBy": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "snapshotUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "archivedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "project": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "deletedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "favorite": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "openedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "icon": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "folderId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "mergedInto": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "page": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "page"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "workspace",
                    "visibility",
                    "guestComments",
                    "guestWrites",
                    "viewers",
                    "passwordProtected",
                    "latestVersion",
                    "path",
                    "url",
                    "shareUrl",
                    "kind",
                    "permissions",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "icon": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 16
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "visibility": {
                    "type": "string",
                    "enum": [
                      "public",
                      "members"
                    ]
                  },
                  "guestComments": {
                    "type": "boolean"
                  },
                  "guestWrites": {
                    "type": "boolean"
                  },
                  "viewers": {
                    "type": "object",
                    "properties": {
                      "files": {
                        "type": "boolean"
                      },
                      "history": {
                        "type": "boolean"
                      },
                      "data": {
                        "type": "boolean"
                      },
                      "dbRead": {
                        "type": "boolean"
                      }
                    }
                  },
                  "password": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 4,
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "slug": {
                    "type": [
                      "null",
                      "string"
                    ]
                  },
                  "searchIndexed": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "a person only (the website or the app; CLI, MCP and agents: 403, they archive instead); admin of its workspace, a live space owner, or its maker; moves it to the Trash for TRASH_DAYS (its link stops working), then it's deleted for good with its apps; forever=1 on a space in the Trash deletes it now; 400 for an app preview",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        },
        "description": "Request: ?forever=1"
      }
    },
    "/v1/spaces/{id}/custom-links": {
      "get": {
        "summary": "admin; the workspace's custom links on the pages host: used and cap (null = no cap)",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "used": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "cap": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "used",
                    "cap"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/restore": {
      "post": {
        "summary": "whoever may delete it (agents too); out of the Trash as it was; 404 for anyone else",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[0-9a-z]{10}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "workspace": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "slug",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "visibility": {
                      "type": "string",
                      "enum": [
                        "public",
                        "members"
                      ]
                    },
                    "guestComments": {
                      "type": "boolean"
                    },
                    "guestWrites": {
                      "type": "boolean"
                    },
                    "viewers": {
                      "type": "object",
                      "properties": {
                        "files": {
                          "type": "boolean"
                        },
                        "history": {
                          "type": "boolean"
                        },
                        "data": {
                          "type": "boolean"
                        },
                        "dbRead": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "files",
                        "history",
                        "data",
                        "dbRead"
                      ],
                      "additionalProperties": false
                    },
                    "passwordProtected": {
                      "default": false,
                      "type": "boolean"
                    },
                    "latestVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "path": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "shareUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "slug": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "searchIndexed": {
                      "type": "boolean"
                    },
                    "kind": {
                      "default": "repo",
                      "type": "string",
                      "enum": [
                        "repo",
                        "live",
                        "app"
                      ]
                    },
                    "permissions": {
                      "type": "object",
                      "properties": {
                        "canView": {
                          "type": "boolean"
                        },
                        "canPush": {
                          "type": "boolean"
                        },
                        "canComment": {
                          "type": "boolean"
                        },
                        "canAdmin": {
                          "type": "boolean"
                        },
                        "canGuestComment": {
                          "type": "boolean"
                        },
                        "canGuestWrite": {
                          "type": "boolean"
                        },
                        "canSeeFiles": {
                          "type": "boolean"
                        },
                        "canSeeHistory": {
                          "type": "boolean"
                        },
                        "canSeeData": {
                          "type": "boolean"
                        },
                        "canReadDb": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "canView",
                        "canPush",
                        "canComment",
                        "canAdmin",
                        "canGuestComment",
                        "canGuestWrite",
                        "canSeeFiles",
                        "canSeeHistory",
                        "canSeeData",
                        "canReadDb"
                      ],
                      "additionalProperties": false
                    },
                    "createdAt": {
                      "type": "number"
                    },
                    "createdBy": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "snapshotUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "archivedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "project": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "deletedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "favorite": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "openedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "icon": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "folderId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "mergedInto": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "page": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "page"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "workspace",
                    "visibility",
                    "guestComments",
                    "guestWrites",
                    "viewers",
                    "passwordProtected",
                    "latestVersion",
                    "path",
                    "url",
                    "shareUrl",
                    "kind",
                    "permissions",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/archive": {
      "post": {
        "summary": "push (agents too); out of every list, the link keeps working; a new version brings it back",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[0-9a-z]{10}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "workspace": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "slug",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "visibility": {
                      "type": "string",
                      "enum": [
                        "public",
                        "members"
                      ]
                    },
                    "guestComments": {
                      "type": "boolean"
                    },
                    "guestWrites": {
                      "type": "boolean"
                    },
                    "viewers": {
                      "type": "object",
                      "properties": {
                        "files": {
                          "type": "boolean"
                        },
                        "history": {
                          "type": "boolean"
                        },
                        "data": {
                          "type": "boolean"
                        },
                        "dbRead": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "files",
                        "history",
                        "data",
                        "dbRead"
                      ],
                      "additionalProperties": false
                    },
                    "passwordProtected": {
                      "default": false,
                      "type": "boolean"
                    },
                    "latestVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "path": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "shareUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "slug": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "searchIndexed": {
                      "type": "boolean"
                    },
                    "kind": {
                      "default": "repo",
                      "type": "string",
                      "enum": [
                        "repo",
                        "live",
                        "app"
                      ]
                    },
                    "permissions": {
                      "type": "object",
                      "properties": {
                        "canView": {
                          "type": "boolean"
                        },
                        "canPush": {
                          "type": "boolean"
                        },
                        "canComment": {
                          "type": "boolean"
                        },
                        "canAdmin": {
                          "type": "boolean"
                        },
                        "canGuestComment": {
                          "type": "boolean"
                        },
                        "canGuestWrite": {
                          "type": "boolean"
                        },
                        "canSeeFiles": {
                          "type": "boolean"
                        },
                        "canSeeHistory": {
                          "type": "boolean"
                        },
                        "canSeeData": {
                          "type": "boolean"
                        },
                        "canReadDb": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "canView",
                        "canPush",
                        "canComment",
                        "canAdmin",
                        "canGuestComment",
                        "canGuestWrite",
                        "canSeeFiles",
                        "canSeeHistory",
                        "canSeeData",
                        "canReadDb"
                      ],
                      "additionalProperties": false
                    },
                    "createdAt": {
                      "type": "number"
                    },
                    "createdBy": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "snapshotUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "archivedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "project": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "deletedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "favorite": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "openedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "icon": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "folderId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "mergedInto": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "page": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "page"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "workspace",
                    "visibility",
                    "guestComments",
                    "guestWrites",
                    "viewers",
                    "passwordProtected",
                    "latestVersion",
                    "path",
                    "url",
                    "shareUrl",
                    "kind",
                    "permissions",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/unarchive": {
      "post": {
        "summary": "push",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[0-9a-z]{10}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "workspace": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "slug",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "visibility": {
                      "type": "string",
                      "enum": [
                        "public",
                        "members"
                      ]
                    },
                    "guestComments": {
                      "type": "boolean"
                    },
                    "guestWrites": {
                      "type": "boolean"
                    },
                    "viewers": {
                      "type": "object",
                      "properties": {
                        "files": {
                          "type": "boolean"
                        },
                        "history": {
                          "type": "boolean"
                        },
                        "data": {
                          "type": "boolean"
                        },
                        "dbRead": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "files",
                        "history",
                        "data",
                        "dbRead"
                      ],
                      "additionalProperties": false
                    },
                    "passwordProtected": {
                      "default": false,
                      "type": "boolean"
                    },
                    "latestVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "path": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "shareUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "slug": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "searchIndexed": {
                      "type": "boolean"
                    },
                    "kind": {
                      "default": "repo",
                      "type": "string",
                      "enum": [
                        "repo",
                        "live",
                        "app"
                      ]
                    },
                    "permissions": {
                      "type": "object",
                      "properties": {
                        "canView": {
                          "type": "boolean"
                        },
                        "canPush": {
                          "type": "boolean"
                        },
                        "canComment": {
                          "type": "boolean"
                        },
                        "canAdmin": {
                          "type": "boolean"
                        },
                        "canGuestComment": {
                          "type": "boolean"
                        },
                        "canGuestWrite": {
                          "type": "boolean"
                        },
                        "canSeeFiles": {
                          "type": "boolean"
                        },
                        "canSeeHistory": {
                          "type": "boolean"
                        },
                        "canSeeData": {
                          "type": "boolean"
                        },
                        "canReadDb": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "canView",
                        "canPush",
                        "canComment",
                        "canAdmin",
                        "canGuestComment",
                        "canGuestWrite",
                        "canSeeFiles",
                        "canSeeHistory",
                        "canSeeData",
                        "canReadDb"
                      ],
                      "additionalProperties": false
                    },
                    "createdAt": {
                      "type": "number"
                    },
                    "createdBy": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "snapshotUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "archivedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "project": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "deletedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "favorite": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "openedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "icon": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "folderId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "mergedInto": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "page": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "page"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "workspace",
                    "visibility",
                    "guestComments",
                    "guestWrites",
                    "viewers",
                    "passwordProtected",
                    "latestVersion",
                    "path",
                    "url",
                    "shareUrl",
                    "kind",
                    "permissions",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/favorite": {
      "put": {
        "summary": "view; adds it to the end of your favorites",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        }
      },
      "delete": {
        "summary": "signed in; takes it off your favorites",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        }
      }
    },
    "/v1/me/favorites": {
      "put": {
        "summary": "your favorites in this order (others after, as they were)",
        "tags": [
          "Auth API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "spaces": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[0-9a-z]{10}$"
                      }
                    }
                  },
                  "required": [
                    "spaces"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "spaces": {
                    "maxItems": 500,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-z]{10}$"
                    }
                  }
                },
                "required": [
                  "spaces"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/opened": {
      "post": {
        "summary": "view; you opened it (your Recent); ignored for CLI, MCP and agents",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        }
      }
    },
    "/v1/spaces/{id}/folder": {
      "put": {
        "summary": "view + edit the workspace (agents too); lists it in a folder (null: the top level); never changes its link or who can open it",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[0-9a-z]{10}$"
                    },
                    "name": {
                      "type": "string"
                    },
                    "workspace": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "slug",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "visibility": {
                      "type": "string",
                      "enum": [
                        "public",
                        "members"
                      ]
                    },
                    "guestComments": {
                      "type": "boolean"
                    },
                    "guestWrites": {
                      "type": "boolean"
                    },
                    "viewers": {
                      "type": "object",
                      "properties": {
                        "files": {
                          "type": "boolean"
                        },
                        "history": {
                          "type": "boolean"
                        },
                        "data": {
                          "type": "boolean"
                        },
                        "dbRead": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "files",
                        "history",
                        "data",
                        "dbRead"
                      ],
                      "additionalProperties": false
                    },
                    "passwordProtected": {
                      "default": false,
                      "type": "boolean"
                    },
                    "latestVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "path": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "shareUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "slug": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "searchIndexed": {
                      "type": "boolean"
                    },
                    "kind": {
                      "default": "repo",
                      "type": "string",
                      "enum": [
                        "repo",
                        "live",
                        "app"
                      ]
                    },
                    "permissions": {
                      "type": "object",
                      "properties": {
                        "canView": {
                          "type": "boolean"
                        },
                        "canPush": {
                          "type": "boolean"
                        },
                        "canComment": {
                          "type": "boolean"
                        },
                        "canAdmin": {
                          "type": "boolean"
                        },
                        "canGuestComment": {
                          "type": "boolean"
                        },
                        "canGuestWrite": {
                          "type": "boolean"
                        },
                        "canSeeFiles": {
                          "type": "boolean"
                        },
                        "canSeeHistory": {
                          "type": "boolean"
                        },
                        "canSeeData": {
                          "type": "boolean"
                        },
                        "canReadDb": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "canView",
                        "canPush",
                        "canComment",
                        "canAdmin",
                        "canGuestComment",
                        "canGuestWrite",
                        "canSeeFiles",
                        "canSeeHistory",
                        "canSeeData",
                        "canReadDb"
                      ],
                      "additionalProperties": false
                    },
                    "createdAt": {
                      "type": "number"
                    },
                    "createdBy": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "snapshotUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "archivedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "project": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "deletedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "favorite": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "openedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "icon": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "folderId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "mergedInto": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "page": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "page"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "workspace",
                    "visibility",
                    "guestComments",
                    "guestWrites",
                    "viewers",
                    "passwordProtected",
                    "latestVersion",
                    "path",
                    "url",
                    "shareUrl",
                    "kind",
                    "permissions",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "folderId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "folderId"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/merge": {
      "post": {
        "summary": "push on both (agents too); it becomes a page of `into` and is archived, its links open the page; 409 with comments, uploads or data",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "space": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^[0-9a-z]{10}$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "workspace": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "slug": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "slug",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        "visibility": {
                          "type": "string",
                          "enum": [
                            "public",
                            "members"
                          ]
                        },
                        "guestComments": {
                          "type": "boolean"
                        },
                        "guestWrites": {
                          "type": "boolean"
                        },
                        "viewers": {
                          "type": "object",
                          "properties": {
                            "files": {
                              "type": "boolean"
                            },
                            "history": {
                              "type": "boolean"
                            },
                            "data": {
                              "type": "boolean"
                            },
                            "dbRead": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "files",
                            "history",
                            "data",
                            "dbRead"
                          ],
                          "additionalProperties": false
                        },
                        "passwordProtected": {
                          "default": false,
                          "type": "boolean"
                        },
                        "latestVersion": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "path": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        },
                        "shareUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "slug": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "searchIndexed": {
                          "type": "boolean"
                        },
                        "kind": {
                          "default": "repo",
                          "type": "string",
                          "enum": [
                            "repo",
                            "live",
                            "app"
                          ]
                        },
                        "permissions": {
                          "type": "object",
                          "properties": {
                            "canView": {
                              "type": "boolean"
                            },
                            "canPush": {
                              "type": "boolean"
                            },
                            "canComment": {
                              "type": "boolean"
                            },
                            "canAdmin": {
                              "type": "boolean"
                            },
                            "canGuestComment": {
                              "type": "boolean"
                            },
                            "canGuestWrite": {
                              "type": "boolean"
                            },
                            "canSeeFiles": {
                              "type": "boolean"
                            },
                            "canSeeHistory": {
                              "type": "boolean"
                            },
                            "canSeeData": {
                              "type": "boolean"
                            },
                            "canReadDb": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "canView",
                            "canPush",
                            "canComment",
                            "canAdmin",
                            "canGuestComment",
                            "canGuestWrite",
                            "canSeeFiles",
                            "canSeeHistory",
                            "canSeeData",
                            "canReadDb"
                          ],
                          "additionalProperties": false
                        },
                        "createdAt": {
                          "type": "number"
                        },
                        "createdBy": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "snapshotUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "archivedAt": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "project": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "deletedAt": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "favorite": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "openedAt": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "icon": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "folderId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "mergedInto": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "page": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "page"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "workspace",
                        "visibility",
                        "guestComments",
                        "guestWrites",
                        "viewers",
                        "passwordProtected",
                        "latestVersion",
                        "path",
                        "url",
                        "shareUrl",
                        "kind",
                        "permissions",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "page": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "space",
                    "page"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "into": {
                    "type": "string",
                    "maxLength": 64
                  }
                },
                "required": [
                  "into"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/move": {
      "post": {
        "summary": "owner of both workspaces; a live space takes its apps along; links don't change; 400 for an app preview",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "space": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^[0-9a-z]{10}$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "workspace": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "slug": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "slug",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        "visibility": {
                          "type": "string",
                          "enum": [
                            "public",
                            "members"
                          ]
                        },
                        "guestComments": {
                          "type": "boolean"
                        },
                        "guestWrites": {
                          "type": "boolean"
                        },
                        "viewers": {
                          "type": "object",
                          "properties": {
                            "files": {
                              "type": "boolean"
                            },
                            "history": {
                              "type": "boolean"
                            },
                            "data": {
                              "type": "boolean"
                            },
                            "dbRead": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "files",
                            "history",
                            "data",
                            "dbRead"
                          ],
                          "additionalProperties": false
                        },
                        "passwordProtected": {
                          "default": false,
                          "type": "boolean"
                        },
                        "latestVersion": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "path": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        },
                        "shareUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "slug": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "searchIndexed": {
                          "type": "boolean"
                        },
                        "kind": {
                          "default": "repo",
                          "type": "string",
                          "enum": [
                            "repo",
                            "live",
                            "app"
                          ]
                        },
                        "permissions": {
                          "type": "object",
                          "properties": {
                            "canView": {
                              "type": "boolean"
                            },
                            "canPush": {
                              "type": "boolean"
                            },
                            "canComment": {
                              "type": "boolean"
                            },
                            "canAdmin": {
                              "type": "boolean"
                            },
                            "canGuestComment": {
                              "type": "boolean"
                            },
                            "canGuestWrite": {
                              "type": "boolean"
                            },
                            "canSeeFiles": {
                              "type": "boolean"
                            },
                            "canSeeHistory": {
                              "type": "boolean"
                            },
                            "canSeeData": {
                              "type": "boolean"
                            },
                            "canReadDb": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "canView",
                            "canPush",
                            "canComment",
                            "canAdmin",
                            "canGuestComment",
                            "canGuestWrite",
                            "canSeeFiles",
                            "canSeeHistory",
                            "canSeeData",
                            "canReadDb"
                          ],
                          "additionalProperties": false
                        },
                        "createdAt": {
                          "type": "number"
                        },
                        "createdBy": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "snapshotUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "archivedAt": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "project": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "deletedAt": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "favorite": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "openedAt": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "icon": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "folderId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "mergedInto": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "page": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "page"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "workspace",
                        "visibility",
                        "guestComments",
                        "guestWrites",
                        "viewers",
                        "passwordProtected",
                        "latestVersion",
                        "path",
                        "url",
                        "shareUrl",
                        "kind",
                        "permissions",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "moved": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[0-9a-z]{10}$"
                      }
                    }
                  },
                  "required": [
                    "space",
                    "moved"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "workspace": {
                    "type": "string",
                    "pattern": "^[a-z0-9](?:[a-z0-9-]{0,37}[a-z0-9])?$"
                  }
                },
                "required": [
                  "workspace"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/head": {
      "get": {
        "summary": "+ liveUrl",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "latestVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "commentsUpdatedAt": {
                      "type": "number"
                    },
                    "reactions": {
                      "default": 0,
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "reactionsUpdatedAt": {
                      "default": 0,
                      "type": "number"
                    },
                    "uploads": {
                      "default": 0,
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "uploadsUpdatedAt": {
                      "default": 0,
                      "type": "number"
                    },
                    "liveUrl": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "latestVersion",
                    "commentsUpdatedAt",
                    "reactions",
                    "reactionsUpdatedAt",
                    "uploads",
                    "uploadsUpdatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/page": {
      "get": {
        "summary": "view; the website's space page in one read: me, the space, head, folders, and with ?path= that page (its file, comments, linked Discord threads)",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          },
          {
            "name": "v",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "me": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "user": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "handle": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "avatarUrl": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "handle",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            "workspaces": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "slug": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "role": {
                                    "type": "string",
                                    "enum": [
                                      "owner",
                                      "admin",
                                      "member",
                                      "viewer"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "slug",
                                  "name",
                                  "role"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "invites": {
                              "default": [],
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "slug": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "role": {
                                    "type": "string",
                                    "enum": [
                                      "owner",
                                      "admin",
                                      "member",
                                      "viewer"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "slug",
                                  "name",
                                  "role"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "preferences": {
                              "default": {
                                "developerMode": false
                              },
                              "type": "object",
                              "properties": {
                                "developerMode": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "developerMode"
                              ],
                              "additionalProperties": false
                            },
                            "blocked": {
                              "default": [],
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "deletion": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "at": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "at"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "user",
                            "workspaces",
                            "invites",
                            "preferences",
                            "blocked",
                            "deletion"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "space": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "pattern": "^[0-9a-z]{10}$"
                        },
                        "name": {
                          "type": "string"
                        },
                        "workspace": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "slug": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "slug",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        "visibility": {
                          "type": "string",
                          "enum": [
                            "public",
                            "members"
                          ]
                        },
                        "guestComments": {
                          "type": "boolean"
                        },
                        "guestWrites": {
                          "type": "boolean"
                        },
                        "viewers": {
                          "type": "object",
                          "properties": {
                            "files": {
                              "type": "boolean"
                            },
                            "history": {
                              "type": "boolean"
                            },
                            "data": {
                              "type": "boolean"
                            },
                            "dbRead": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "files",
                            "history",
                            "data",
                            "dbRead"
                          ],
                          "additionalProperties": false
                        },
                        "passwordProtected": {
                          "default": false,
                          "type": "boolean"
                        },
                        "latestVersion": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "path": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        },
                        "shareUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "slug": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "searchIndexed": {
                          "type": "boolean"
                        },
                        "kind": {
                          "default": "repo",
                          "type": "string",
                          "enum": [
                            "repo",
                            "live",
                            "app"
                          ]
                        },
                        "permissions": {
                          "type": "object",
                          "properties": {
                            "canView": {
                              "type": "boolean"
                            },
                            "canPush": {
                              "type": "boolean"
                            },
                            "canComment": {
                              "type": "boolean"
                            },
                            "canAdmin": {
                              "type": "boolean"
                            },
                            "canGuestComment": {
                              "type": "boolean"
                            },
                            "canGuestWrite": {
                              "type": "boolean"
                            },
                            "canSeeFiles": {
                              "type": "boolean"
                            },
                            "canSeeHistory": {
                              "type": "boolean"
                            },
                            "canSeeData": {
                              "type": "boolean"
                            },
                            "canReadDb": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "canView",
                            "canPush",
                            "canComment",
                            "canAdmin",
                            "canGuestComment",
                            "canGuestWrite",
                            "canSeeFiles",
                            "canSeeHistory",
                            "canSeeData",
                            "canReadDb"
                          ],
                          "additionalProperties": false
                        },
                        "createdAt": {
                          "type": "number"
                        },
                        "createdBy": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "snapshotUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "archivedAt": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "project": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "deletedAt": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "favorite": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "openedAt": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "icon": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "folderId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "mergedInto": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "page": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "id",
                                "page"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "workspace",
                        "visibility",
                        "guestComments",
                        "guestWrites",
                        "viewers",
                        "passwordProtected",
                        "latestVersion",
                        "path",
                        "url",
                        "shareUrl",
                        "kind",
                        "permissions",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "head": {
                      "type": "object",
                      "properties": {
                        "latestVersion": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "commentsUpdatedAt": {
                          "type": "number"
                        },
                        "reactions": {
                          "default": 0,
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "reactionsUpdatedAt": {
                          "default": 0,
                          "type": "number"
                        },
                        "uploads": {
                          "default": 0,
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "uploadsUpdatedAt": {
                          "default": 0,
                          "type": "number"
                        },
                        "liveUrl": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "latestVersion",
                        "commentsUpdatedAt",
                        "reactions",
                        "reactionsUpdatedAt",
                        "uploads",
                        "uploadsUpdatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "folders": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "parentId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "icon": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "path": {
                            "type": "string"
                          },
                          "spaces": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "createdAt": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "id",
                          "parentId",
                          "name",
                          "description",
                          "path",
                          "spaces",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "doc": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "v": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "versionNumber": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "files": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "path": {
                                    "type": "string"
                                  },
                                  "sha256": {
                                    "type": "string"
                                  },
                                  "size": {
                                    "type": "number"
                                  },
                                  "kind": {
                                    "type": "string",
                                    "enum": [
                                      "markdown",
                                      "html",
                                      "asset"
                                    ]
                                  },
                                  "title": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "path",
                                  "sha256",
                                  "size",
                                  "kind",
                                  "title"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "file": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "versionNumber": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    "file": {
                                      "type": "object",
                                      "properties": {
                                        "path": {
                                          "type": "string"
                                        },
                                        "sha256": {
                                          "type": "string"
                                        },
                                        "size": {
                                          "type": "number"
                                        },
                                        "kind": {
                                          "type": "string",
                                          "enum": [
                                            "markdown",
                                            "html",
                                            "asset"
                                          ]
                                        },
                                        "title": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "path",
                                        "sha256",
                                        "size",
                                        "kind",
                                        "title"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "content": {
                                      "type": "string"
                                    },
                                    "rawUrl": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "versionNumber",
                                    "file",
                                    "content",
                                    "rawUrl"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "threads": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "path": {
                                    "type": "string"
                                  },
                                  "versionNumber": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "parentId": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "replyToId": {
                                    "default": null,
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "author": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "handle": {
                                        "type": "string"
                                      },
                                      "name": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "avatarUrl": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "handle",
                                      "name"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "guestName": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "origin": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "ip": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "maxLength": 64
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "country": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "maxLength": 8
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "region": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "maxLength": 120
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "city": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "maxLength": 120
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "colo": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "maxLength": 8
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "asn": {
                                            "anyOf": [
                                              {
                                                "type": "integer",
                                                "minimum": -9007199254740991,
                                                "maximum": 9007199254740991
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "userAgent": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "maxLength": 200
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "ip",
                                          "country",
                                          "region",
                                          "city",
                                          "colo",
                                          "asn",
                                          "userAgent"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "body": {
                                    "type": "string"
                                  },
                                  "images": {
                                    "default": [],
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string"
                                        },
                                        "url": {
                                          "type": "string"
                                        },
                                        "contentType": {
                                          "type": "string"
                                        },
                                        "size": {
                                          "type": "integer",
                                          "minimum": -9007199254740991,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "url",
                                        "contentType",
                                        "size"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "quote": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "anchor": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "exact": {
                                            "type": "string",
                                            "minLength": 1,
                                            "maxLength": 2000
                                          },
                                          "prefix": {
                                            "type": "string",
                                            "maxLength": 64
                                          },
                                          "suffix": {
                                            "type": "string",
                                            "maxLength": 64
                                          },
                                          "start": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "required": [
                                          "exact",
                                          "prefix",
                                          "suffix",
                                          "start"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "via": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "resolvedAt": {
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  },
                                  "resolvedBy": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "handle": {
                                            "type": "string"
                                          },
                                          "name": {
                                            "type": [
                                              "string",
                                              "null"
                                            ]
                                          },
                                          "avatarUrl": {
                                            "type": [
                                              "string",
                                              "null"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "handle",
                                          "name"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "resolvedVia": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "resolvedVersion": {
                                    "default": null,
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  },
                                  "editedAt": {
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  },
                                  "editedBy": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "handle": {
                                            "type": "string"
                                          },
                                          "name": {
                                            "type": [
                                              "string",
                                              "null"
                                            ]
                                          },
                                          "avatarUrl": {
                                            "type": [
                                              "string",
                                              "null"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "handle",
                                          "name"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "editedVia": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "revisions": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "reactions": {
                                    "default": [],
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "emoji": {
                                          "type": "string"
                                        },
                                        "count": {
                                          "type": "integer",
                                          "minimum": -9007199254740991,
                                          "maximum": 9007199254740991
                                        },
                                        "mine": {
                                          "type": "boolean"
                                        },
                                        "people": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string"
                                              },
                                              "handle": {
                                                "type": "string"
                                              },
                                              "name": {
                                                "type": [
                                                  "string",
                                                  "null"
                                                ]
                                              },
                                              "avatarUrl": {
                                                "type": [
                                                  "string",
                                                  "null"
                                                ]
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "handle",
                                              "name"
                                            ],
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "required": [
                                        "emoji",
                                        "count",
                                        "mine",
                                        "people"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "createdAt": {
                                    "type": "number"
                                  },
                                  "replies": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string"
                                        },
                                        "path": {
                                          "type": "string"
                                        },
                                        "versionNumber": {
                                          "type": "integer",
                                          "minimum": -9007199254740991,
                                          "maximum": 9007199254740991
                                        },
                                        "parentId": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        },
                                        "replyToId": {
                                          "default": null,
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        },
                                        "author": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string"
                                            },
                                            "handle": {
                                              "type": "string"
                                            },
                                            "name": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "avatarUrl": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "handle",
                                            "name"
                                          ],
                                          "additionalProperties": false
                                        },
                                        "guestName": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        },
                                        "origin": {
                                          "anyOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "ip": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "maxLength": 64
                                                    },
                                                    {
                                                      "type": "null"
                                                    }
                                                  ]
                                                },
                                                "country": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "maxLength": 8
                                                    },
                                                    {
                                                      "type": "null"
                                                    }
                                                  ]
                                                },
                                                "region": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "maxLength": 120
                                                    },
                                                    {
                                                      "type": "null"
                                                    }
                                                  ]
                                                },
                                                "city": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "maxLength": 120
                                                    },
                                                    {
                                                      "type": "null"
                                                    }
                                                  ]
                                                },
                                                "colo": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "maxLength": 8
                                                    },
                                                    {
                                                      "type": "null"
                                                    }
                                                  ]
                                                },
                                                "asn": {
                                                  "anyOf": [
                                                    {
                                                      "type": "integer",
                                                      "minimum": -9007199254740991,
                                                      "maximum": 9007199254740991
                                                    },
                                                    {
                                                      "type": "null"
                                                    }
                                                  ]
                                                },
                                                "userAgent": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "maxLength": 200
                                                    },
                                                    {
                                                      "type": "null"
                                                    }
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "ip",
                                                "country",
                                                "region",
                                                "city",
                                                "colo",
                                                "asn",
                                                "userAgent"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "body": {
                                          "type": "string"
                                        },
                                        "images": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "id": {
                                                "type": "string"
                                              },
                                              "url": {
                                                "type": "string"
                                              },
                                              "contentType": {
                                                "type": "string"
                                              },
                                              "size": {
                                                "type": "integer",
                                                "minimum": -9007199254740991,
                                                "maximum": 9007199254740991
                                              }
                                            },
                                            "required": [
                                              "id",
                                              "url",
                                              "contentType",
                                              "size"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "quote": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        },
                                        "anchor": {
                                          "anyOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "exact": {
                                                  "type": "string",
                                                  "minLength": 1,
                                                  "maxLength": 2000
                                                },
                                                "prefix": {
                                                  "type": "string",
                                                  "maxLength": 64
                                                },
                                                "suffix": {
                                                  "type": "string",
                                                  "maxLength": 64
                                                },
                                                "start": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 9007199254740991
                                                }
                                              },
                                              "required": [
                                                "exact",
                                                "prefix",
                                                "suffix",
                                                "start"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "via": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        },
                                        "resolvedAt": {
                                          "type": [
                                            "number",
                                            "null"
                                          ]
                                        },
                                        "resolvedBy": {
                                          "anyOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string"
                                                },
                                                "handle": {
                                                  "type": "string"
                                                },
                                                "name": {
                                                  "type": [
                                                    "string",
                                                    "null"
                                                  ]
                                                },
                                                "avatarUrl": {
                                                  "type": [
                                                    "string",
                                                    "null"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "handle",
                                                "name"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "resolvedVia": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        },
                                        "resolvedVersion": {
                                          "default": null,
                                          "type": [
                                            "number",
                                            "null"
                                          ]
                                        },
                                        "editedAt": {
                                          "type": [
                                            "number",
                                            "null"
                                          ]
                                        },
                                        "editedBy": {
                                          "anyOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string"
                                                },
                                                "handle": {
                                                  "type": "string"
                                                },
                                                "name": {
                                                  "type": [
                                                    "string",
                                                    "null"
                                                  ]
                                                },
                                                "avatarUrl": {
                                                  "type": [
                                                    "string",
                                                    "null"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "handle",
                                                "name"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "editedVia": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        },
                                        "revisions": {
                                          "type": "integer",
                                          "minimum": -9007199254740991,
                                          "maximum": 9007199254740991
                                        },
                                        "reactions": {
                                          "default": [],
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "emoji": {
                                                "type": "string"
                                              },
                                              "count": {
                                                "type": "integer",
                                                "minimum": -9007199254740991,
                                                "maximum": 9007199254740991
                                              },
                                              "mine": {
                                                "type": "boolean"
                                              },
                                              "people": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "properties": {
                                                    "id": {
                                                      "type": "string"
                                                    },
                                                    "handle": {
                                                      "type": "string"
                                                    },
                                                    "name": {
                                                      "type": [
                                                        "string",
                                                        "null"
                                                      ]
                                                    },
                                                    "avatarUrl": {
                                                      "type": [
                                                        "string",
                                                        "null"
                                                      ]
                                                    }
                                                  },
                                                  "required": [
                                                    "id",
                                                    "handle",
                                                    "name"
                                                  ],
                                                  "additionalProperties": false
                                                }
                                              }
                                            },
                                            "required": [
                                              "emoji",
                                              "count",
                                              "mine",
                                              "people"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "createdAt": {
                                          "type": "number"
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "path",
                                        "versionNumber",
                                        "parentId",
                                        "replyToId",
                                        "author",
                                        "guestName",
                                        "origin",
                                        "body",
                                        "images",
                                        "quote",
                                        "anchor",
                                        "via",
                                        "resolvedAt",
                                        "resolvedBy",
                                        "resolvedVia",
                                        "resolvedVersion",
                                        "editedAt",
                                        "editedBy",
                                        "editedVia",
                                        "revisions",
                                        "reactions",
                                        "createdAt"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "id",
                                  "path",
                                  "versionNumber",
                                  "parentId",
                                  "replyToId",
                                  "author",
                                  "guestName",
                                  "origin",
                                  "body",
                                  "images",
                                  "quote",
                                  "anchor",
                                  "via",
                                  "resolvedAt",
                                  "resolvedBy",
                                  "resolvedVia",
                                  "resolvedVersion",
                                  "editedAt",
                                  "editedBy",
                                  "editedVia",
                                  "revisions",
                                  "reactions",
                                  "createdAt",
                                  "replies"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "revisions": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "number": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    "body": {
                                      "type": "string"
                                    },
                                    "author": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string"
                                        },
                                        "handle": {
                                          "type": "string"
                                        },
                                        "name": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        },
                                        "avatarUrl": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "handle",
                                        "name"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "via": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "createdAt": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "number",
                                    "body",
                                    "author",
                                    "via",
                                    "createdAt"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "discord": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "threadId": {
                                    "type": "string"
                                  },
                                  "channelId": {
                                    "type": "string"
                                  },
                                  "guildName": {
                                    "type": "string"
                                  },
                                  "channelName": {
                                    "type": "string"
                                  },
                                  "threadName": {
                                    "type": "string"
                                  },
                                  "isChannel": {
                                    "type": "boolean"
                                  },
                                  "linkedBy": {
                                    "type": "string"
                                  },
                                  "createdAt": {
                                    "type": "number"
                                  },
                                  "url": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "threadId",
                                  "channelId",
                                  "guildName",
                                  "channelName",
                                  "threadName",
                                  "isChannel",
                                  "linkedBy",
                                  "createdAt",
                                  "url"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "muted": {
                              "type": [
                                "boolean",
                                "null"
                              ]
                            },
                            "mentionPeople": {
                              "anyOf": [
                                {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "handle": {
                                        "type": "string"
                                      },
                                      "name": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "avatarUrl": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "handle",
                                      "name"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "pagePictures": {
                              "type": "object",
                              "propertyNames": {
                                "type": "string"
                              },
                              "additionalProperties": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "v",
                            "versionNumber",
                            "files",
                            "file",
                            "threads",
                            "revisions",
                            "discord"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "me",
                    "space",
                    "head",
                    "folders",
                    "doc"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/capabilities": {
      "get": {
        "summary": "view; what pages can do here (packages/contract/src/capabilities.ts) and whether each is on",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "capabilities": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "enum": [
                              "database",
                              "guest_writes",
                              "files",
                              "comments",
                              "multiplayer",
                              "decide"
                            ]
                          },
                          "name": {
                            "type": "string"
                          },
                          "outcome": {
                            "type": "string"
                          },
                          "summary": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "live",
                              "preview"
                            ]
                          },
                          "control": {
                            "type": "string",
                            "enum": [
                              "always",
                              "setting",
                              "switch"
                            ]
                          },
                          "on": {
                            "type": "boolean"
                          },
                          "available": {
                            "type": "boolean"
                          },
                          "canChange": {
                            "type": "boolean"
                          },
                          "docs": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "outcome",
                          "summary",
                          "status",
                          "control",
                          "on",
                          "available",
                          "canChange",
                          "docs"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "capabilities"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/capabilities/{capability}": {
      "put": {
        "summary": "admin; switch capabilities only (others: PATCH /v1/spaces/:id); 403 for a preview not turned on for the space",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "capability",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "capabilities": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "enum": [
                              "database",
                              "guest_writes",
                              "files",
                              "comments",
                              "multiplayer",
                              "decide"
                            ]
                          },
                          "name": {
                            "type": "string"
                          },
                          "outcome": {
                            "type": "string"
                          },
                          "summary": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "live",
                              "preview"
                            ]
                          },
                          "control": {
                            "type": "string",
                            "enum": [
                              "always",
                              "setting",
                              "switch"
                            ]
                          },
                          "on": {
                            "type": "boolean"
                          },
                          "available": {
                            "type": "boolean"
                          },
                          "canChange": {
                            "type": "boolean"
                          },
                          "docs": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "outcome",
                          "summary",
                          "status",
                          "control",
                          "on",
                          "available",
                          "canChange",
                          "docs"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "capabilities"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "on": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "on"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/rules": {
      "get": {
        "summary": "view; the agent rules for this space: its own and its workspace's, with your own switch. `enabled: false` and none while the feature is off for the workspace",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean"
                    },
                    "rules": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "scope": {
                            "type": "string",
                            "enum": [
                              "workspace",
                              "space"
                            ]
                          },
                          "when": {
                            "type": "string"
                          },
                          "do": {
                            "type": "string"
                          },
                          "skill": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "mine": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "replaced": {
                            "type": "boolean"
                          },
                          "version": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "updatedAt": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "scope",
                          "when",
                          "do",
                          "skill",
                          "enabled",
                          "mine",
                          "replaced",
                          "version",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "enabled",
                    "rules"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "push (agents too); a rule for this space; 409 when the name is taken; 404 while the feature is off",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean"
                    },
                    "rules": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "scope": {
                            "type": "string",
                            "enum": [
                              "workspace",
                              "space"
                            ]
                          },
                          "when": {
                            "type": "string"
                          },
                          "do": {
                            "type": "string"
                          },
                          "skill": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "mine": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "replaced": {
                            "type": "boolean"
                          },
                          "version": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "updatedAt": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "scope",
                          "when",
                          "do",
                          "skill",
                          "enabled",
                          "mine",
                          "replaced",
                          "version",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "enabled",
                    "rules"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9-]{0,39}$"
                  },
                  "when": {
                    "default": "",
                    "type": "string",
                    "maxLength": 500
                  },
                  "do": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "skill": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[a-z0-9][a-z0-9-]{0,39}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "do"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/rules/{name}": {
      "patch": {
        "summary": "push (agents too); a new wording starts a new version",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean"
                    },
                    "rules": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "scope": {
                            "type": "string",
                            "enum": [
                              "workspace",
                              "space"
                            ]
                          },
                          "when": {
                            "type": "string"
                          },
                          "do": {
                            "type": "string"
                          },
                          "skill": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "mine": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "replaced": {
                            "type": "boolean"
                          },
                          "version": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "updatedAt": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "scope",
                          "when",
                          "do",
                          "skill",
                          "enabled",
                          "mine",
                          "replaced",
                          "version",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "enabled",
                    "rules"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "when": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "do": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "skill": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[a-z0-9][a-z0-9-]{0,39}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "push (agents too)",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean"
                    },
                    "rules": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "scope": {
                            "type": "string",
                            "enum": [
                              "workspace",
                              "space"
                            ]
                          },
                          "when": {
                            "type": "string"
                          },
                          "do": {
                            "type": "string"
                          },
                          "skill": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "mine": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "replaced": {
                            "type": "boolean"
                          },
                          "version": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "updatedAt": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "scope",
                          "when",
                          "do",
                          "skill",
                          "enabled",
                          "mine",
                          "replaced",
                          "version",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "enabled",
                    "rules"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/rules/{ruleId}/me": {
      "put": {
        "summary": "view, signed in; your own switch for a space or workspace rule (null: follow the space)",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ruleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean"
                    },
                    "rules": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "scope": {
                            "type": "string",
                            "enum": [
                              "workspace",
                              "space"
                            ]
                          },
                          "when": {
                            "type": "string"
                          },
                          "do": {
                            "type": "string"
                          },
                          "skill": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "mine": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          },
                          "replaced": {
                            "type": "boolean"
                          },
                          "version": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "updatedAt": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "scope",
                          "when",
                          "do",
                          "skill",
                          "enabled",
                          "mine",
                          "replaced",
                          "version",
                          "updatedAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "enabled",
                    "rules"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  }
                },
                "required": [
                  "enabled"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/rules/stats": {
      "post": {
        "summary": "view, signed in; counts from one session (the CLI's hook): sent, fit, followed, corrected, tokens; never any words",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "rows": {
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "ruleId": {
                          "type": "string"
                        },
                        "version": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 9007199254740991
                        },
                        "sent": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 1000
                        },
                        "fit": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 1000
                        },
                        "followed": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 1000
                        },
                        "corrected": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 1000
                        },
                        "tokens": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 1000000
                        }
                      },
                      "required": [
                        "ruleId",
                        "version",
                        "sent",
                        "fit",
                        "followed",
                        "corrected",
                        "tokens"
                      ]
                    }
                  },
                  "session": {
                    "type": "object",
                    "properties": {
                      "tokens": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 200000
                      }
                    },
                    "required": [
                      "tokens"
                    ]
                  }
                },
                "required": [
                  "rows"
                ]
              }
            }
          }
        }
      },
      "get": {
        "summary": "view; per rule and per day for ?days= (1-90, default 7); `people` lists everyone for admins, only you for others",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "default": 7,
              "type": "integer",
              "minimum": 1,
              "maximum": 90
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "enabled": {
                      "type": "boolean"
                    },
                    "days": {
                      "type": "number"
                    },
                    "sessions": {
                      "type": "number"
                    },
                    "sessionTokens": {
                      "type": "number"
                    },
                    "rules": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "version": {
                            "type": "number"
                          },
                          "sent": {
                            "type": "number"
                          },
                          "fit": {
                            "type": "number"
                          },
                          "followed": {
                            "type": "number"
                          },
                          "corrected": {
                            "type": "number"
                          },
                          "tokens": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "version",
                          "sent",
                          "fit",
                          "followed",
                          "corrected",
                          "tokens"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "daily": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "day": {
                            "type": "string"
                          },
                          "sessions": {
                            "type": "number"
                          },
                          "sent": {
                            "type": "number"
                          },
                          "fit": {
                            "type": "number"
                          },
                          "followed": {
                            "type": "number"
                          },
                          "corrected": {
                            "type": "number"
                          },
                          "tokens": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "day",
                          "sessions",
                          "sent",
                          "fit",
                          "followed",
                          "corrected",
                          "tokens"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "people": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "handle": {
                            "type": "string"
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "sessions": {
                            "type": "number"
                          },
                          "sent": {
                            "type": "number"
                          },
                          "fit": {
                            "type": "number"
                          },
                          "followed": {
                            "type": "number"
                          },
                          "corrected": {
                            "type": "number"
                          },
                          "tokens": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "handle",
                          "name",
                          "sessions",
                          "sent",
                          "fit",
                          "followed",
                          "corrected",
                          "tokens"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "enabled",
                    "days",
                    "sessions",
                    "sessionTokens",
                    "rules",
                    "daily",
                    "people"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/unlock": {
      "post": {
        "summary": "public space with a password; 401 wrong, 429 too many tries (PRD 013)",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string"
                    },
                    "exp": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "token",
                    "exp"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "password": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "required": [
                  "password"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/views": {
      "post": {
        "summary": "view; the app's beacon; not counted for people who can push",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "path": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "version": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "referrer": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 2000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "path"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/seen": {
      "post": {
        "summary": "view; the website's page view: the view (with path), your Recent and your read of the comments, written after it answers",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "path": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "version": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "referrer": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 2000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/visitors": {
      "get": {
        "summary": "push; views, visitors, people, last 90 days max",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "schema": {
              "default": 30,
              "type": "integer",
              "minimum": 1,
              "maximum": 90
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "days": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "views": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "visitors": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "returning": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "signedIn": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "daily": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "day": {
                            "type": "string"
                          },
                          "views": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "visitors": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "day",
                          "views",
                          "visitors"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "countries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "country": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "views": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "country",
                          "views"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "referrers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "referrer": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "views": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "referrer",
                          "views"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "path": {
                            "type": "string"
                          },
                          "views": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "path",
                          "views"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "people": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "user": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "handle": {
                                "type": "string"
                              },
                              "name": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "avatarUrl": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "handle",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "views": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "days": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "firstSeen": {
                            "type": "number"
                          },
                          "lastSeen": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "user",
                          "views",
                          "days",
                          "firstSeen",
                          "lastSeen"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "guests": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "number": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "views": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "days": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "firstSeen": {
                            "type": "number"
                          },
                          "lastSeen": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "name",
                          "number",
                          "views",
                          "days",
                          "firstSeen",
                          "lastSeen"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "recent": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "at": {
                            "type": "number"
                          },
                          "user": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "handle": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "avatarUrl": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "handle",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "number": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "returning": {
                            "type": "boolean"
                          },
                          "path": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string",
                            "enum": [
                              "app",
                              "link"
                            ]
                          },
                          "country": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "city": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "browser": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "os": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "device": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "referrer": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "at",
                          "user",
                          "name",
                          "number",
                          "returning",
                          "path",
                          "source",
                          "country",
                          "city",
                          "browser",
                          "os",
                          "device",
                          "referrer"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "days",
                    "views",
                    "visitors",
                    "returning",
                    "signedIn",
                    "daily",
                    "countries",
                    "referrers",
                    "pages",
                    "people",
                    "guests",
                    "recent"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/push/plan": {
      "post": {
        "summary": "prefix: the files replace only that folder (adding a page); the rest of the latest version stays",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "baseVersion": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "missing": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[0-9a-f]{64}$"
                      }
                    },
                    "diff": {
                      "type": "object",
                      "properties": {
                        "added": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "changed": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "removed": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "added",
                        "changed",
                        "removed"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "baseVersion",
                    "missing",
                    "diff"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "files": {
                    "maxItems": 5000,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "path": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "sha256": {
                          "type": "string",
                          "pattern": "^[0-9a-f]{64}$"
                        },
                        "size": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 16777216
                        }
                      },
                      "required": [
                        "path",
                        "sha256",
                        "size"
                      ]
                    }
                  },
                  "prefix": {
                    "type": "string",
                    "maxLength": 100,
                    "pattern": "^[a-z0-9][a-z0-9._-]*(\\/[a-z0-9][a-z0-9._-]*)*\\/$"
                  }
                },
                "required": [
                  "files"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/blobs/{sha256}": {
      "put": {
        "summary": "server verifies the hash",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sha256",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        },
        "description": "Request: raw file bytes"
      }
    },
    "/v1/spaces/{id}/versions": {
      "post": {
        "summary": "409 if a listed blob is missing; prefix as in push/plan",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "version": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "number": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "message": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "pushedBy": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "handle": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "avatarUrl": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "handle",
                                "name"
                              ],
                              "additionalProperties": false
                            },
                            "via": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "project": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "added": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "changed": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "removed": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            "createdAt": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "number",
                            "message",
                            "pushedBy",
                            "added",
                            "changed",
                            "removed",
                            "createdAt"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "diff": {
                      "type": "object",
                      "properties": {
                        "added": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "changed": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "removed": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "added",
                        "changed",
                        "removed"
                      ],
                      "additionalProperties": false
                    },
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "version",
                    "diff",
                    "url"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "files": {
                    "maxItems": 5000,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "path": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 512
                        },
                        "sha256": {
                          "type": "string",
                          "pattern": "^[0-9a-f]{64}$"
                        },
                        "size": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 16777216
                        }
                      },
                      "required": [
                        "path",
                        "sha256",
                        "size"
                      ]
                    }
                  },
                  "message": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "baseVersion": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "prefix": {
                    "type": "string",
                    "maxLength": 100,
                    "pattern": "^[a-z0-9][a-z0-9._-]*(\\/[a-z0-9][a-z0-9._-]*)*\\/$"
                  },
                  "project": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  }
                },
                "required": [
                  "files"
                ]
              }
            }
          }
        }
      },
      "get": {
        "summary": "newest first",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "versions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "number": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "message": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pushedBy": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "handle": {
                                "type": "string"
                              },
                              "name": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "avatarUrl": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "handle",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "via": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "project": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "added": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "changed": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "removed": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "createdAt": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "number",
                          "message",
                          "pushedBy",
                          "added",
                          "changed",
                          "removed",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "versions"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/versions/{n}": {
      "get": {
        "summary": "n = number or \"latest\"",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "n",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "version": {
                      "type": "object",
                      "properties": {
                        "number": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "message": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "pushedBy": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "handle": {
                              "type": "string"
                            },
                            "name": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "avatarUrl": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "handle",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        "via": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "project": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "added": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "changed": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "removed": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "createdAt": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "number",
                        "message",
                        "pushedBy",
                        "added",
                        "changed",
                        "removed",
                        "createdAt"
                      ],
                      "additionalProperties": false
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "path": {
                            "type": "string"
                          },
                          "sha256": {
                            "type": "string"
                          },
                          "size": {
                            "type": "number"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "markdown",
                              "html",
                              "asset"
                            ]
                          },
                          "title": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "path",
                          "sha256",
                          "size",
                          "kind",
                          "title"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "diff": {
                      "type": "object",
                      "properties": {
                        "added": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "changed": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "removed": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "added",
                        "changed",
                        "removed"
                      ],
                      "additionalProperties": false
                    },
                    "pagePictures": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "version",
                    "files",
                    "diff"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/files/{path}": {
      "get": {
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "versionNumber": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "file": {
                      "type": "object",
                      "properties": {
                        "path": {
                          "type": "string"
                        },
                        "sha256": {
                          "type": "string"
                        },
                        "size": {
                          "type": "number"
                        },
                        "kind": {
                          "type": "string",
                          "enum": [
                            "markdown",
                            "html",
                            "asset"
                          ]
                        },
                        "title": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "path",
                        "sha256",
                        "size",
                        "kind",
                        "title"
                      ],
                      "additionalProperties": false
                    },
                    "content": {
                      "type": "string"
                    },
                    "rawUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "versionNumber",
                    "file",
                    "content",
                    "rawUrl"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "description": "Request: ?v=<n>"
      }
    },
    "/v1/spaces/{id}/history/{path}": {
      "get": {
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "entries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "versionNumber": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "change": {
                            "type": "string",
                            "enum": [
                              "added",
                              "changed",
                              "removed"
                            ]
                          },
                          "sha256": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "pushedBy": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "handle": {
                                "type": "string"
                              },
                              "name": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "avatarUrl": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "handle",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "via": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "versionNumber",
                          "change",
                          "sha256",
                          "pushedBy",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "entries"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/download/{path}": {
      "get": {
        "summary": "view; attachment (PRD 012)",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "file bytes"
          }
        },
        "description": "Request: ?v=<n>"
      }
    },
    "/v1/spaces/{id}/download-link/{path}": {
      "get": {
        "summary": "view; 5-minute /dl/<ticket> link for browsers",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "url",
                    "expiresAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "description": "Request: ?v=<n>"
      }
    },
    "/v1/spaces/{id}/uploads": {
      "get": {
        "summary": "canSeeFiles; newest first (PRD 012)",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "uploads": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "size": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "sha256": {
                            "type": "string"
                          },
                          "contentType": {
                            "type": "string"
                          },
                          "uploadedBy": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "handle": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "avatarUrl": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "handle",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "createdAt": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "size",
                          "sha256",
                          "contentType",
                          "uploadedBy",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "uploads"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "push; Content-Length required, MAX_UPLOAD_BYTES; streamed to our storage",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "size": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "sha256": {
                      "type": "string"
                    },
                    "contentType": {
                      "type": "string"
                    },
                    "uploadedBy": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "handle": {
                              "type": "string"
                            },
                            "name": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "avatarUrl": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "handle",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "size",
                    "sha256",
                    "contentType",
                    "uploadedBy",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "description": "Request: raw bytes, ?name="
      }
    },
    "/v1/spaces/{id}/uploads/{uploadId}/raw": {
      "get": {
        "summary": "canSeeFiles; attachment, nosniff, sandbox CSP, x-content-sha256",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "uploadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "file bytes"
          }
        }
      }
    },
    "/v1/spaces/{id}/uploads/{uploadId}/link": {
      "get": {
        "summary": "canSeeFiles; 5-minute /dl/<ticket> link for browsers",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "uploadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "url",
                    "expiresAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/uploads/{uploadId}": {
      "delete": {
        "summary": "push",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "uploadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        }
      }
    },
    "/v1/workspaces/{slug}/waiting": {
      "get": {
        "summary": "members only; open threads you wrote in, were @mentioned in, or on spaces you started, where someone else spoke last; newest first; ?before= pages",
        "tags": [
          "Workspaces API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            }
          },
          {
            "name": "beforeId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 20,
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "threads": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "thread": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "path": {
                                "type": "string"
                              },
                              "versionNumber": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "parentId": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "replyToId": {
                                "default": null,
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "author": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "handle": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "avatarUrl": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "handle",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              "guestName": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "origin": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "ip": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "maxLength": 64
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "country": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "maxLength": 8
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "region": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "maxLength": 120
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "city": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "maxLength": 120
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "colo": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "maxLength": 8
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "asn": {
                                        "anyOf": [
                                          {
                                            "type": "integer",
                                            "minimum": -9007199254740991,
                                            "maximum": 9007199254740991
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "userAgent": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "maxLength": 200
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "ip",
                                      "country",
                                      "region",
                                      "city",
                                      "colo",
                                      "asn",
                                      "userAgent"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "body": {
                                "type": "string"
                              },
                              "images": {
                                "default": [],
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    },
                                    "url": {
                                      "type": "string"
                                    },
                                    "contentType": {
                                      "type": "string"
                                    },
                                    "size": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "url",
                                    "contentType",
                                    "size"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "quote": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "anchor": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "exact": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 2000
                                      },
                                      "prefix": {
                                        "type": "string",
                                        "maxLength": 64
                                      },
                                      "suffix": {
                                        "type": "string",
                                        "maxLength": 64
                                      },
                                      "start": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      }
                                    },
                                    "required": [
                                      "exact",
                                      "prefix",
                                      "suffix",
                                      "start"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "via": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "resolvedAt": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "resolvedBy": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "handle": {
                                        "type": "string"
                                      },
                                      "name": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "avatarUrl": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "handle",
                                      "name"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "resolvedVia": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "resolvedVersion": {
                                "default": null,
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "editedAt": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "editedBy": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "handle": {
                                        "type": "string"
                                      },
                                      "name": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "avatarUrl": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "handle",
                                      "name"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "editedVia": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "revisions": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "reactions": {
                                "default": [],
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "emoji": {
                                      "type": "string"
                                    },
                                    "count": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    "mine": {
                                      "type": "boolean"
                                    },
                                    "people": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "handle": {
                                            "type": "string"
                                          },
                                          "name": {
                                            "type": [
                                              "string",
                                              "null"
                                            ]
                                          },
                                          "avatarUrl": {
                                            "type": [
                                              "string",
                                              "null"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "handle",
                                          "name"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "emoji",
                                    "count",
                                    "mine",
                                    "people"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "createdAt": {
                                "type": "number"
                              },
                              "replies": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    },
                                    "path": {
                                      "type": "string"
                                    },
                                    "versionNumber": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    "parentId": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "replyToId": {
                                      "default": null,
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "author": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string"
                                        },
                                        "handle": {
                                          "type": "string"
                                        },
                                        "name": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        },
                                        "avatarUrl": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "handle",
                                        "name"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "guestName": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "origin": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "ip": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 64
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            "country": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 8
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            "region": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 120
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            "city": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 120
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            "colo": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 8
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            "asn": {
                                              "anyOf": [
                                                {
                                                  "type": "integer",
                                                  "minimum": -9007199254740991,
                                                  "maximum": 9007199254740991
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            "userAgent": {
                                              "anyOf": [
                                                {
                                                  "type": "string",
                                                  "maxLength": 200
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            }
                                          },
                                          "required": [
                                            "ip",
                                            "country",
                                            "region",
                                            "city",
                                            "colo",
                                            "asn",
                                            "userAgent"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "body": {
                                      "type": "string"
                                    },
                                    "images": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string"
                                          },
                                          "url": {
                                            "type": "string"
                                          },
                                          "contentType": {
                                            "type": "string"
                                          },
                                          "size": {
                                            "type": "integer",
                                            "minimum": -9007199254740991,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "url",
                                          "contentType",
                                          "size"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "quote": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "anchor": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "exact": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 2000
                                            },
                                            "prefix": {
                                              "type": "string",
                                              "maxLength": 64
                                            },
                                            "suffix": {
                                              "type": "string",
                                              "maxLength": 64
                                            },
                                            "start": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "required": [
                                            "exact",
                                            "prefix",
                                            "suffix",
                                            "start"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "via": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "resolvedAt": {
                                      "type": [
                                        "number",
                                        "null"
                                      ]
                                    },
                                    "resolvedBy": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string"
                                            },
                                            "handle": {
                                              "type": "string"
                                            },
                                            "name": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "avatarUrl": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "handle",
                                            "name"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "resolvedVia": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "resolvedVersion": {
                                      "default": null,
                                      "type": [
                                        "number",
                                        "null"
                                      ]
                                    },
                                    "editedAt": {
                                      "type": [
                                        "number",
                                        "null"
                                      ]
                                    },
                                    "editedBy": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string"
                                            },
                                            "handle": {
                                              "type": "string"
                                            },
                                            "name": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "avatarUrl": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "handle",
                                            "name"
                                          ],
                                          "additionalProperties": false
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "editedVia": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "revisions": {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    "reactions": {
                                      "default": [],
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "emoji": {
                                            "type": "string"
                                          },
                                          "count": {
                                            "type": "integer",
                                            "minimum": -9007199254740991,
                                            "maximum": 9007199254740991
                                          },
                                          "mine": {
                                            "type": "boolean"
                                          },
                                          "people": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string"
                                                },
                                                "handle": {
                                                  "type": "string"
                                                },
                                                "name": {
                                                  "type": [
                                                    "string",
                                                    "null"
                                                  ]
                                                },
                                                "avatarUrl": {
                                                  "type": [
                                                    "string",
                                                    "null"
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "handle",
                                                "name"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "emoji",
                                          "count",
                                          "mine",
                                          "people"
                                        ],
                                        "additionalProperties": false
                                      }
                                    },
                                    "createdAt": {
                                      "type": "number"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "path",
                                    "versionNumber",
                                    "parentId",
                                    "replyToId",
                                    "author",
                                    "guestName",
                                    "origin",
                                    "body",
                                    "images",
                                    "quote",
                                    "anchor",
                                    "via",
                                    "resolvedAt",
                                    "resolvedBy",
                                    "resolvedVia",
                                    "resolvedVersion",
                                    "editedAt",
                                    "editedBy",
                                    "editedVia",
                                    "revisions",
                                    "reactions",
                                    "createdAt"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "id",
                              "path",
                              "versionNumber",
                              "parentId",
                              "replyToId",
                              "author",
                              "guestName",
                              "origin",
                              "body",
                              "images",
                              "quote",
                              "anchor",
                              "via",
                              "resolvedAt",
                              "resolvedBy",
                              "resolvedVia",
                              "resolvedVersion",
                              "editedAt",
                              "editedBy",
                              "editedVia",
                              "revisions",
                              "reactions",
                              "createdAt",
                              "replies"
                            ],
                            "additionalProperties": false
                          },
                          "space": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "path": {
                                "type": "string"
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "repo",
                                  "live",
                                  "app"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "path",
                              "kind"
                            ],
                            "additionalProperties": false
                          },
                          "reason": {
                            "type": "string",
                            "enum": [
                              "participant",
                              "owner"
                            ]
                          },
                          "mentioned": {
                            "default": false,
                            "type": "boolean"
                          },
                          "lastAt": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "thread",
                          "space",
                          "reason",
                          "mentioned",
                          "lastAt"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "total": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "spaces": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "next": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "nextId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "threads",
                    "total",
                    "spaces",
                    "next"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/notifications": {
      "get": {
        "summary": "view; whether you muted the space",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "muted": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "muted"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "view; muted: no push and no comment email from it, except comments that @mention you",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "muted": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "muted"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "muted": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "muted"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/comments": {
      "get": {
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "default": "open",
              "type": "string",
              "enum": [
                "open",
                "resolved",
                "all"
              ]
            }
          },
          {
            "name": "peek",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "const": "1"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "threads": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "path": {
                            "type": "string"
                          },
                          "versionNumber": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "parentId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "replyToId": {
                            "default": null,
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "author": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "handle": {
                                "type": "string"
                              },
                              "name": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "avatarUrl": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "handle",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "guestName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "origin": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "ip": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 64
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "country": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 8
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "region": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 120
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "city": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 120
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "colo": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 8
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "asn": {
                                    "anyOf": [
                                      {
                                        "type": "integer",
                                        "minimum": -9007199254740991,
                                        "maximum": 9007199254740991
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "userAgent": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 200
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "ip",
                                  "country",
                                  "region",
                                  "city",
                                  "colo",
                                  "asn",
                                  "userAgent"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "body": {
                            "type": "string"
                          },
                          "images": {
                            "default": [],
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "url": {
                                  "type": "string"
                                },
                                "contentType": {
                                  "type": "string"
                                },
                                "size": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "id",
                                "url",
                                "contentType",
                                "size"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "quote": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "anchor": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "exact": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 2000
                                  },
                                  "prefix": {
                                    "type": "string",
                                    "maxLength": 64
                                  },
                                  "suffix": {
                                    "type": "string",
                                    "maxLength": 64
                                  },
                                  "start": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": [
                                  "exact",
                                  "prefix",
                                  "suffix",
                                  "start"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "via": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "resolvedAt": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "resolvedBy": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "handle": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "avatarUrl": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "handle",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "resolvedVia": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "resolvedVersion": {
                            "default": null,
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "editedAt": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "editedBy": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "handle": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "avatarUrl": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "handle",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "editedVia": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "revisions": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "reactions": {
                            "default": [],
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "emoji": {
                                  "type": "string"
                                },
                                "count": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "mine": {
                                  "type": "boolean"
                                },
                                "people": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "handle": {
                                        "type": "string"
                                      },
                                      "name": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "avatarUrl": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "handle",
                                      "name"
                                    ],
                                    "additionalProperties": false
                                  }
                                }
                              },
                              "required": [
                                "emoji",
                                "count",
                                "mine",
                                "people"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "createdAt": {
                            "type": "number"
                          },
                          "replies": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "path": {
                                  "type": "string"
                                },
                                "versionNumber": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "parentId": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "replyToId": {
                                  "default": null,
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "author": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    },
                                    "handle": {
                                      "type": "string"
                                    },
                                    "name": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "avatarUrl": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "handle",
                                    "name"
                                  ],
                                  "additionalProperties": false
                                },
                                "guestName": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "origin": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "ip": {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "maxLength": 64
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "country": {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "maxLength": 8
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "region": {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "maxLength": 120
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "city": {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "maxLength": 120
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "colo": {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "maxLength": 8
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "asn": {
                                          "anyOf": [
                                            {
                                              "type": "integer",
                                              "minimum": -9007199254740991,
                                              "maximum": 9007199254740991
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "userAgent": {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "maxLength": 200
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "ip",
                                        "country",
                                        "region",
                                        "city",
                                        "colo",
                                        "asn",
                                        "userAgent"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "body": {
                                  "type": "string"
                                },
                                "images": {
                                  "default": [],
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "url": {
                                        "type": "string"
                                      },
                                      "contentType": {
                                        "type": "string"
                                      },
                                      "size": {
                                        "type": "integer",
                                        "minimum": -9007199254740991,
                                        "maximum": 9007199254740991
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "url",
                                      "contentType",
                                      "size"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "quote": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "anchor": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "exact": {
                                          "type": "string",
                                          "minLength": 1,
                                          "maxLength": 2000
                                        },
                                        "prefix": {
                                          "type": "string",
                                          "maxLength": 64
                                        },
                                        "suffix": {
                                          "type": "string",
                                          "maxLength": 64
                                        },
                                        "start": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        }
                                      },
                                      "required": [
                                        "exact",
                                        "prefix",
                                        "suffix",
                                        "start"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "via": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "resolvedAt": {
                                  "type": [
                                    "number",
                                    "null"
                                  ]
                                },
                                "resolvedBy": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string"
                                        },
                                        "handle": {
                                          "type": "string"
                                        },
                                        "name": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        },
                                        "avatarUrl": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "handle",
                                        "name"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "resolvedVia": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "resolvedVersion": {
                                  "default": null,
                                  "type": [
                                    "number",
                                    "null"
                                  ]
                                },
                                "editedAt": {
                                  "type": [
                                    "number",
                                    "null"
                                  ]
                                },
                                "editedBy": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string"
                                        },
                                        "handle": {
                                          "type": "string"
                                        },
                                        "name": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        },
                                        "avatarUrl": {
                                          "type": [
                                            "string",
                                            "null"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "handle",
                                        "name"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "editedVia": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "revisions": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "reactions": {
                                  "default": [],
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "emoji": {
                                        "type": "string"
                                      },
                                      "count": {
                                        "type": "integer",
                                        "minimum": -9007199254740991,
                                        "maximum": 9007199254740991
                                      },
                                      "mine": {
                                        "type": "boolean"
                                      },
                                      "people": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "id": {
                                              "type": "string"
                                            },
                                            "handle": {
                                              "type": "string"
                                            },
                                            "name": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            },
                                            "avatarUrl": {
                                              "type": [
                                                "string",
                                                "null"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "id",
                                            "handle",
                                            "name"
                                          ],
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "required": [
                                      "emoji",
                                      "count",
                                      "mine",
                                      "people"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "createdAt": {
                                  "type": "number"
                                }
                              },
                              "required": [
                                "id",
                                "path",
                                "versionNumber",
                                "parentId",
                                "replyToId",
                                "author",
                                "guestName",
                                "origin",
                                "body",
                                "images",
                                "quote",
                                "anchor",
                                "via",
                                "resolvedAt",
                                "resolvedBy",
                                "resolvedVia",
                                "resolvedVersion",
                                "editedAt",
                                "editedBy",
                                "editedVia",
                                "revisions",
                                "reactions",
                                "createdAt"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "id",
                          "path",
                          "versionNumber",
                          "parentId",
                          "replyToId",
                          "author",
                          "guestName",
                          "origin",
                          "body",
                          "images",
                          "quote",
                          "anchor",
                          "via",
                          "resolvedAt",
                          "resolvedBy",
                          "resolvedVia",
                          "resolvedVersion",
                          "editedAt",
                          "editedBy",
                          "editedVia",
                          "revisions",
                          "reactions",
                          "createdAt",
                          "replies"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "threads"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "signed in + canComment, or a `guest` when the space allows guest comments (20 per ip per 10 min); `images` attaches up to 4 uploaded images; @handles tell those people if they can see the space (not from guests); an `id` the client picked makes a repeat return the comment already made; `parentId` may be a reply, which the new one nests under (`replyToId`)",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "path": {
                      "type": "string"
                    },
                    "versionNumber": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "parentId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "replyToId": {
                      "default": null,
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "author": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "handle": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "avatarUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "handle",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "guestName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "origin": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "ip": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 64
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "country": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 8
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "region": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 120
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "city": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 120
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "colo": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 8
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "asn": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "userAgent": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 200
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "ip",
                            "country",
                            "region",
                            "city",
                            "colo",
                            "asn",
                            "userAgent"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "body": {
                      "type": "string"
                    },
                    "images": {
                      "default": [],
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "contentType": {
                            "type": "string"
                          },
                          "size": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "id",
                          "url",
                          "contentType",
                          "size"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "quote": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "anchor": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "exact": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 2000
                            },
                            "prefix": {
                              "type": "string",
                              "maxLength": 64
                            },
                            "suffix": {
                              "type": "string",
                              "maxLength": 64
                            },
                            "start": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "exact",
                            "prefix",
                            "suffix",
                            "start"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "via": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "resolvedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "resolvedBy": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "handle": {
                              "type": "string"
                            },
                            "name": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "avatarUrl": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "handle",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "resolvedVia": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "resolvedVersion": {
                      "default": null,
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "editedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "editedBy": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "handle": {
                              "type": "string"
                            },
                            "name": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "avatarUrl": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "handle",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "editedVia": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "revisions": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "reactions": {
                      "default": [],
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "emoji": {
                            "type": "string"
                          },
                          "count": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "mine": {
                            "type": "boolean"
                          },
                          "people": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "handle": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "avatarUrl": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "handle",
                                "name"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "emoji",
                          "count",
                          "mine",
                          "people"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "createdAt": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "id",
                    "path",
                    "versionNumber",
                    "parentId",
                    "replyToId",
                    "author",
                    "guestName",
                    "origin",
                    "body",
                    "images",
                    "quote",
                    "anchor",
                    "via",
                    "resolvedAt",
                    "resolvedBy",
                    "resolvedVia",
                    "resolvedVersion",
                    "editedAt",
                    "editedBy",
                    "editedVia",
                    "revisions",
                    "reactions",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[0-9a-z]{16}$"
                  },
                  "path": {
                    "type": "string",
                    "minLength": 1
                  },
                  "body": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 10000
                  },
                  "quote": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "anchor": {
                    "type": "object",
                    "properties": {
                      "exact": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 2000
                      },
                      "prefix": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "suffix": {
                        "type": "string",
                        "maxLength": 64
                      },
                      "start": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "exact",
                      "prefix",
                      "suffix",
                      "start"
                    ]
                  },
                  "parentId": {
                    "type": "string"
                  },
                  "versionNumber": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "images": {
                    "maxItems": 4,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-f]{32}$"
                    }
                  },
                  "guest": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 40
                      },
                      "key": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{22,64}$"
                      }
                    },
                    "required": [
                      "name",
                      "key"
                    ]
                  }
                },
                "required": [
                  "path",
                  "body"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/mention-people": {
      "get": {
        "summary": "signed in + canComment; up to 8 people who can see the space: workspace members and commenters (only commenters for someone outside the workspace)",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "default": "",
              "type": "string",
              "maxLength": 39
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "people": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "handle": {
                            "type": "string"
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "avatarUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "handle",
                          "name"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "people"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/comment-images": {
      "post": {
        "summary": "canComment, or a guest (key in x-cloudtifact-guest-key) where guest comments are on; PNG/JPEG/GIF/WebP by magic bytes, 2 MB, at most 4096 px a side, 20 per hour per ip and per uploader",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "contentType": {
                      "type": "string"
                    },
                    "size": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "url",
                    "contentType",
                    "size"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "description": "Request: raw image bytes"
      }
    },
    "/v1/spaces/{id}/comment-images/{imageId}": {
      "get": {
        "summary": "no auth: the random id is the grant; sniffed Content-Type, immutable, nosniff, sandbox CSP",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "imageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "image bytes"
          }
        }
      }
    },
    "/v1/comments/{id}": {
      "patch": {
        "summary": "author only (a guest: with their key); old text kept as a revision; only newly @mentioned people are told",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "path": {
                      "type": "string"
                    },
                    "versionNumber": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "parentId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "replyToId": {
                      "default": null,
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "author": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "handle": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "avatarUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "handle",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "guestName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "origin": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "ip": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 64
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "country": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 8
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "region": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 120
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "city": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 120
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "colo": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 8
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "asn": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "userAgent": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 200
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "ip",
                            "country",
                            "region",
                            "city",
                            "colo",
                            "asn",
                            "userAgent"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "body": {
                      "type": "string"
                    },
                    "images": {
                      "default": [],
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "contentType": {
                            "type": "string"
                          },
                          "size": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "id",
                          "url",
                          "contentType",
                          "size"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "quote": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "anchor": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "exact": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 2000
                            },
                            "prefix": {
                              "type": "string",
                              "maxLength": 64
                            },
                            "suffix": {
                              "type": "string",
                              "maxLength": 64
                            },
                            "start": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "exact",
                            "prefix",
                            "suffix",
                            "start"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "via": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "resolvedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "resolvedBy": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "handle": {
                              "type": "string"
                            },
                            "name": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "avatarUrl": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "handle",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "resolvedVia": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "resolvedVersion": {
                      "default": null,
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "editedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "editedBy": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "handle": {
                              "type": "string"
                            },
                            "name": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "avatarUrl": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "handle",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "editedVia": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "revisions": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "reactions": {
                      "default": [],
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "emoji": {
                            "type": "string"
                          },
                          "count": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "mine": {
                            "type": "boolean"
                          },
                          "people": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "handle": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "avatarUrl": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "handle",
                                "name"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "emoji",
                          "count",
                          "mine",
                          "people"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "createdAt": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "id",
                    "path",
                    "versionNumber",
                    "parentId",
                    "replyToId",
                    "author",
                    "guestName",
                    "origin",
                    "body",
                    "images",
                    "quote",
                    "anchor",
                    "via",
                    "resolvedAt",
                    "resolvedBy",
                    "resolvedVia",
                    "resolvedVersion",
                    "editedAt",
                    "editedBy",
                    "editedVia",
                    "revisions",
                    "reactions",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "body": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 10000
                  },
                  "guest": {
                    "type": "object",
                    "properties": {
                      "key": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{22,64}$"
                      }
                    },
                    "required": [
                      "key"
                    ]
                  }
                },
                "required": [
                  "body"
                ]
              }
            }
          }
        }
      },
      "delete": {
        "summary": "author (a guest: with their key), or canPush; a thread goes with its replies; a reply's answers move up to what it answered",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "guest": {
                    "type": "object",
                    "properties": {
                      "key": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{22,64}$"
                      }
                    },
                    "required": [
                      "key"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/comments/{id}/revisions": {
      "get": {
        "summary": "every version, oldest first (empty if never edited)",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "revisions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "number": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "body": {
                            "type": "string"
                          },
                          "author": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "handle": {
                                "type": "string"
                              },
                              "name": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "avatarUrl": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "handle",
                              "name"
                            ],
                            "additionalProperties": false
                          },
                          "via": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "number",
                          "body",
                          "author",
                          "via",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "revisions"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/comments/{id}/resolve": {
      "post": {
        "summary": "thread author, or canPush on the space (403 otherwise)",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "path": {
                      "type": "string"
                    },
                    "versionNumber": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "parentId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "replyToId": {
                      "default": null,
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "author": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "handle": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "avatarUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "handle",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "guestName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "origin": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "ip": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 64
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "country": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 8
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "region": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 120
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "city": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 120
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "colo": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 8
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "asn": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "userAgent": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 200
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "ip",
                            "country",
                            "region",
                            "city",
                            "colo",
                            "asn",
                            "userAgent"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "body": {
                      "type": "string"
                    },
                    "images": {
                      "default": [],
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "contentType": {
                            "type": "string"
                          },
                          "size": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "id",
                          "url",
                          "contentType",
                          "size"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "quote": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "anchor": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "exact": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 2000
                            },
                            "prefix": {
                              "type": "string",
                              "maxLength": 64
                            },
                            "suffix": {
                              "type": "string",
                              "maxLength": 64
                            },
                            "start": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "exact",
                            "prefix",
                            "suffix",
                            "start"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "via": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "resolvedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "resolvedBy": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "handle": {
                              "type": "string"
                            },
                            "name": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "avatarUrl": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "handle",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "resolvedVia": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "resolvedVersion": {
                      "default": null,
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "editedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "editedBy": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "handle": {
                              "type": "string"
                            },
                            "name": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "avatarUrl": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "handle",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "editedVia": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "revisions": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "reactions": {
                      "default": [],
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "emoji": {
                            "type": "string"
                          },
                          "count": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "mine": {
                            "type": "boolean"
                          },
                          "people": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "handle": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "avatarUrl": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "handle",
                                "name"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "emoji",
                          "count",
                          "mine",
                          "people"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "createdAt": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "id",
                    "path",
                    "versionNumber",
                    "parentId",
                    "replyToId",
                    "author",
                    "guestName",
                    "origin",
                    "body",
                    "images",
                    "quote",
                    "anchor",
                    "via",
                    "resolvedAt",
                    "resolvedBy",
                    "resolvedVia",
                    "resolvedVersion",
                    "editedAt",
                    "editedBy",
                    "editedVia",
                    "revisions",
                    "reactions",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/comments/{id}/unresolve": {
      "post": {
        "summary": "thread author, or canPush on the space (403 otherwise)",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "path": {
                      "type": "string"
                    },
                    "versionNumber": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "parentId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "replyToId": {
                      "default": null,
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "author": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "handle": {
                          "type": "string"
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "avatarUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "handle",
                        "name"
                      ],
                      "additionalProperties": false
                    },
                    "guestName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "origin": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "ip": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 64
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "country": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 8
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "region": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 120
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "city": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 120
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "colo": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 8
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "asn": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "userAgent": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 200
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "ip",
                            "country",
                            "region",
                            "city",
                            "colo",
                            "asn",
                            "userAgent"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "body": {
                      "type": "string"
                    },
                    "images": {
                      "default": [],
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "contentType": {
                            "type": "string"
                          },
                          "size": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "id",
                          "url",
                          "contentType",
                          "size"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "quote": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "anchor": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "exact": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 2000
                            },
                            "prefix": {
                              "type": "string",
                              "maxLength": 64
                            },
                            "suffix": {
                              "type": "string",
                              "maxLength": 64
                            },
                            "start": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "exact",
                            "prefix",
                            "suffix",
                            "start"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "via": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "resolvedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "resolvedBy": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "handle": {
                              "type": "string"
                            },
                            "name": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "avatarUrl": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "handle",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "resolvedVia": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "resolvedVersion": {
                      "default": null,
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "editedAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "editedBy": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "handle": {
                              "type": "string"
                            },
                            "name": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "avatarUrl": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "handle",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "editedVia": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "revisions": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "reactions": {
                      "default": [],
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "emoji": {
                            "type": "string"
                          },
                          "count": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "mine": {
                            "type": "boolean"
                          },
                          "people": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "handle": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "avatarUrl": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "handle",
                                "name"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "emoji",
                          "count",
                          "mine",
                          "people"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "createdAt": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "id",
                    "path",
                    "versionNumber",
                    "parentId",
                    "replyToId",
                    "author",
                    "guestName",
                    "origin",
                    "body",
                    "images",
                    "quote",
                    "anchor",
                    "via",
                    "resolvedAt",
                    "resolvedBy",
                    "resolvedVia",
                    "resolvedVersion",
                    "editedAt",
                    "editedBy",
                    "editedVia",
                    "revisions",
                    "reactions",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/comments/{id}/reactions/{emoji}": {
      "put": {
        "summary": "signed in + canComment (404 if you can't see it); emoji is one of 👍 ❤️ 😂 🎉 👀 ✅, URL-encoded; idempotent; tells nobody (no push, email or Inbox)",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "emoji",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "reactions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "emoji": {
                            "type": "string"
                          },
                          "count": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "mine": {
                            "type": "boolean"
                          },
                          "people": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "handle": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "avatarUrl": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "handle",
                                "name"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "emoji",
                          "count",
                          "mine",
                          "people"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "reactions"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "as PUT; removes your reaction, fine if there was none",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "emoji",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "reactions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "emoji": {
                            "type": "string"
                          },
                          "count": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "mine": {
                            "type": "boolean"
                          },
                          "people": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "handle": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "avatarUrl": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "handle",
                                "name"
                              ],
                              "additionalProperties": false
                            }
                          }
                        },
                        "required": [
                          "emoji",
                          "count",
                          "mine",
                          "people"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "reactions"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/db/query": {
      "post": {
        "summary": "view; write: true needs push (401 signed out / 403, never downgraded)",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "columns": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "null"
                            },
                            {
                              "type": "object",
                              "properties": {
                                "$blob": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "$blob"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        }
                      }
                    },
                    "rowsRead": {
                      "type": "number"
                    },
                    "rowsWritten": {
                      "type": "number"
                    },
                    "truncated": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "columns",
                    "rows",
                    "rowsRead",
                    "rowsWritten",
                    "truncated"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "sql": {
                    "type": "string",
                    "minLength": 1
                  },
                  "params": {
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "number"
                        },
                        {
                          "type": "null"
                        },
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "$blob": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "$blob"
                          ]
                        }
                      ]
                    }
                  },
                  "write": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "sql"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/db": {
      "get": {
        "summary": "view; tables, columns, row counts, size",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "tables": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "columns": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "type": {
                                  "type": "string"
                                },
                                "notnull": {
                                  "type": "boolean"
                                },
                                "pk": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                }
                              },
                              "required": [
                                "name",
                                "type",
                                "notnull",
                                "pk"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "rowCount": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "name",
                          "columns",
                          "rowCount"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "databaseSize": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "tables",
                    "databaseSize"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/db/rows": {
      "post": {
        "summary": "push; one row: insert, or update/delete by primary key (rowid when none); 404 when no row matches; logged with its values",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "rowsWritten": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "rowsWritten"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "op": {
                        "type": "string",
                        "const": "insert"
                      },
                      "table": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "values": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "null"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "object",
                              "properties": {
                                "$blob": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "$blob"
                              ]
                            }
                          ]
                        }
                      }
                    },
                    "required": [
                      "op",
                      "table",
                      "values"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "op": {
                        "type": "string",
                        "const": "update"
                      },
                      "table": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "key": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "null"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "object",
                              "properties": {
                                "$blob": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "$blob"
                              ]
                            }
                          ]
                        }
                      },
                      "values": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "null"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "object",
                              "properties": {
                                "$blob": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "$blob"
                              ]
                            }
                          ]
                        }
                      }
                    },
                    "required": [
                      "op",
                      "table",
                      "key",
                      "values"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "op": {
                        "type": "string",
                        "const": "delete"
                      },
                      "table": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "key": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "null"
                            },
                            {
                              "type": "boolean"
                            },
                            {
                              "type": "object",
                              "properties": {
                                "$blob": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "$blob"
                              ]
                            }
                          ]
                        }
                      }
                    },
                    "required": [
                      "op",
                      "table",
                      "key"
                    ]
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/db/exists": {
      "get": {
        "summary": "view; { hasTables }, no row counts",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "hasTables": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "hasTables"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/db/guest-writes": {
      "get": {
        "summary": "push; the named writes guests may run",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "statements": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9_]{0,63}$"
                          },
                          "sql": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "required": [
                          "name",
                          "sql"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "statements"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "put": {
        "summary": "push; replaces the set; each must be one write statement",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "statements": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "pattern": "^[A-Za-z][A-Za-z0-9_]{0,63}$"
                          },
                          "sql": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "required": [
                          "name",
                          "sql"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "statements"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "statements": {
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "pattern": "^[A-Za-z][A-Za-z0-9_]{0,63}$"
                        },
                        "sql": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "name",
                        "sql"
                      ]
                    }
                  }
                },
                "required": [
                  "statements"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/db/writes": {
      "get": {
        "summary": "push; the write log, newest first, with guest name and origin",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 100,
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "writes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "at": {
                            "type": "number"
                          },
                          "user": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "handle": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "avatarUrl": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "handle",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "source": {
                            "type": "string",
                            "enum": [
                              "api",
                              "cli",
                              "app",
                              "page",
                              "guest"
                            ]
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "query",
                              "reset",
                              "restore"
                            ]
                          },
                          "statement": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "rowsWritten": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "guestName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "guestId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "origin": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "ip": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 64
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "country": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 8
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "region": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 120
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "city": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 120
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "colo": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 8
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "asn": {
                                    "anyOf": [
                                      {
                                        "type": "integer",
                                        "minimum": -9007199254740991,
                                        "maximum": 9007199254740991
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "userAgent": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 200
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "ip",
                                  "country",
                                  "region",
                                  "city",
                                  "colo",
                                  "asn",
                                  "userAgent"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "at",
                          "user",
                          "source",
                          "kind",
                          "statement",
                          "rowsWritten",
                          "guestName",
                          "guestId",
                          "origin"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "writes"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/db/export": {
      "get": {
        "summary": "push; attachment <spaceId>.sql, replays via db/query with write: true",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "text/plain .sql dump"
          }
        }
      }
    },
    "/v1/spaces/{id}/db/reset": {
      "post": {
        "summary": "admin; wipes every table; { before } undoes it via restore",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "before": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "before"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/spaces/{id}/db/restore": {
      "post": {
        "summary": "admin; point-in-time restore, last 30 days",
        "tags": [
          "Spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "restoredTo": {
                      "type": "number"
                    },
                    "undoBookmark": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "restoredTo",
                    "undoBookmark"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "at": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                      },
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    ]
                  }
                },
                "required": [
                  "at"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/live-spaces": {
      "get": {
        "summary": "live spaces you can view; ?workspace=<slug>",
        "tags": [
          "Live spaces API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "listLiveSpacesOutput"
          }
        },
        "description": "Request: listLiveSpacesQuery"
      },
      "post": {
        "summary": "workspace member; plan live space limit (403 past it)",
        "tags": [
          "Live spaces API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "liveSpaceSchema"
          }
        },
        "description": "Request: createLiveSpaceInput"
      }
    },
    "/v1/live-spaces/{id}": {
      "get": {
        "summary": "view",
        "tags": [
          "Live spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "liveSpaceSchema"
          }
        }
      },
      "patch": {
        "summary": "manage",
        "tags": [
          "Live spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "liveSpaceSchema"
          }
        },
        "description": "Request: updateLiveSpaceInput"
      },
      "delete": {
        "summary": "manage",
        "tags": [
          "Live spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        }
      }
    },
    "/v1/live-spaces/{id}/markdown": {
      "get": {
        "summary": "view; every page, for agents and export",
        "tags": [
          "Live spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "text/markdown"
          }
        }
      }
    },
    "/v1/live-spaces/{id}/messages/{messageId}/report": {
      "post": {
        "summary": "view, signed in; keeps a copy of the message; 404 unknown message",
        "tags": [
          "Live spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        },
        "description": "Request: reportMessageInput"
      }
    },
    "/v1/live-spaces/{id}/messages/{messageId}": {
      "delete": {
        "summary": "the message's author, or manage; sockets get chat.deleted",
        "tags": [
          "Live spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        }
      }
    },
    "/v1/live-spaces/{id}/ticket": {
      "post": {
        "summary": "view; short-lived signed ticket for the WebSocket",
        "tags": [
          "Live spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "liveSpaceTicketOutput"
          }
        }
      }
    },
    "/v1/live-spaces/{id}/ws": {
      "get": {
        "summary": "Yjs doc sync, chat, presence; access re-checked",
        "tags": [
          "Live spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "WebSocket (LiveSpaceDO)"
          }
        },
        "description": "Request: ?ticket="
      }
    },
    "/v1/live-spaces/{id}/people": {
      "get": {
        "summary": "view; pending invites only for manage",
        "tags": [
          "Live spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "liveSpacePeopleOutput"
          }
        }
      },
      "post": {
        "summary": "manage; handle adds a member, email makes an invite link",
        "tags": [
          "Live spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "addLiveSpaceMemberOutput"
          }
        },
        "description": "Request: liveSpaceInviteTargetSchema"
      }
    },
    "/v1/live-spaces/{id}/people/{handle}": {
      "patch": {
        "summary": "manage",
        "tags": [
          "Live spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        },
        "description": "Request: updateLiveSpaceMemberInput"
      },
      "delete": {
        "summary": "manage, or yourself (leave)",
        "tags": [
          "Live spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        }
      }
    },
    "/v1/live-spaces/{id}/invites/{inviteId}": {
      "delete": {
        "summary": "manage",
        "tags": [
          "Live spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "inviteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        }
      }
    },
    "/v1/live-space-invites/accept": {
      "post": {
        "summary": "signed in; token stored hashed, single use",
        "tags": [
          "Live spaces API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "acceptLiveSpaceInviteOutput"
          }
        },
        "description": "Request: acceptLiveSpaceInviteInput"
      }
    },
    "/v1/live-spaces/{id}/sources": {
      "get": {
        "summary": "view",
        "tags": [
          "Live spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "sources": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "contentType": {
                            "type": "string"
                          },
                          "size": {
                            "type": "number"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "ready",
                              "unreadable"
                            ]
                          },
                          "summary": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "extractedChars": {
                            "type": "number"
                          },
                          "hiddenFromAi": {
                            "type": "boolean"
                          },
                          "uploadedBy": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "handle": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "avatarUrl": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "handle",
                                  "name"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "createdAt": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "contentType",
                          "size",
                          "status",
                          "summary",
                          "extractedChars",
                          "hiddenFromAi",
                          "uploadedBy",
                          "createdAt"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "sources"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "comment; MAX_SOURCE_BYTES; bytes in our storage, never on the content origin",
        "tags": [
          "Live spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "contentType": {
                      "type": "string"
                    },
                    "size": {
                      "type": "number"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "ready",
                        "unreadable"
                      ]
                    },
                    "summary": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "extractedChars": {
                      "type": "number"
                    },
                    "hiddenFromAi": {
                      "type": "boolean"
                    },
                    "uploadedBy": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "handle": {
                              "type": "string"
                            },
                            "name": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "avatarUrl": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "handle",
                            "name"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "contentType",
                    "size",
                    "status",
                    "summary",
                    "extractedChars",
                    "hiddenFromAi",
                    "uploadedBy",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "description": "Request: multipart file"
      }
    },
    "/v1/live-spaces/{id}/images": {
      "post": {
        "summary": "edit; an image for an image block; checked, stored and served like comment images; kept while the space exists",
        "tags": [
          "Live spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "contentType": {
                      "type": "string"
                    },
                    "size": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "url",
                    "contentType",
                    "size"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "description": "Request: raw image bytes"
      }
    },
    "/v1/live-spaces/{id}/sources/{sourceId}/raw": {
      "get": {
        "summary": "view",
        "tags": [
          "Live spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "file bytes"
          }
        }
      }
    },
    "/v1/live-spaces/{id}/sources/{sourceId}": {
      "delete": {
        "summary": "edit, or the uploader",
        "tags": [
          "Live spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sourceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        }
      }
    },
    "/v1/live-spaces/{id}/build": {
      "post": {
        "summary": "edit; new app, or { appId } to rebuild its preview",
        "tags": [
          "Live spaces API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "buildOutput"
          }
        },
        "description": "Request: buildInput"
      }
    },
    "/v1/apps": {
      "get": {
        "summary": "apps in live spaces you can view",
        "tags": [
          "Apps API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "listAppsOutput"
          }
        },
        "description": "Request: listAppsQuery"
      }
    },
    "/v1/apps/{id}": {
      "get": {
        "summary": "view on the live space",
        "tags": [
          "Apps API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "appSchema"
          }
        }
      },
      "patch": {
        "summary": "manage (name, access, join code)",
        "tags": [
          "Apps API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "appSchema"
          }
        },
        "description": "Request: updateAppInput"
      },
      "delete": {
        "summary": "manage",
        "tags": [
          "Apps API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          }
        }
      }
    },
    "/v1/apps/{id}/live": {
      "post": {
        "summary": "manage; first go-live, plan live-app limit",
        "tags": [
          "Apps API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "appSchema"
          }
        },
        "description": "Request: goLiveInput"
      }
    },
    "/v1/apps/{id}/promote": {
      "post": {
        "summary": "manage; live = latest preview version",
        "tags": [
          "Apps API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "appSchema"
          }
        }
      }
    },
    "/v1/apps/{id}/rollback": {
      "post": {
        "summary": "manage",
        "tags": [
          "Apps API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "appSchema"
          }
        },
        "description": "Request: rollbackInput"
      }
    },
    "/v1/apps/{id}/deploys": {
      "get": {
        "summary": "view",
        "tags": [
          "Apps API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "appDeploysOutput"
          }
        }
      }
    },
    "/v1/apps/{id}/users": {
      "get": {
        "summary": "manage; the app's end users",
        "tags": [
          "Apps API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "appUsersOutput"
          }
        }
      }
    },
    "/v1/apps/{id}/owner-link": {
      "post": {
        "summary": "edit; signed 10-minute admin link into the live app",
        "tags": [
          "Apps API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ownerLinkOutput"
          }
        }
      }
    },
    "/v1/apps/{id}/export": {
      "get": {
        "summary": "manage; a standalone project you can host yourself",
        "tags": [
          "Apps API"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "application/zip"
          }
        }
      }
    },
    "/v1/workspaces/{slug}/billing": {
      "get": {
        "summary": "workspace member",
        "tags": [
          "Billing API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "plan": {
                      "type": "string",
                      "enum": [
                        "free",
                        "pro",
                        "pro_annual",
                        "team",
                        "team_annual",
                        "enterprise"
                      ]
                    },
                    "status": {
                      "type": "string"
                    },
                    "renewsAt": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "usage": {
                      "type": "object",
                      "properties": {
                        "seats": {
                          "type": "number"
                        },
                        "spaces": {
                          "type": "number"
                        },
                        "liveSpaces": {
                          "type": "number"
                        },
                        "liveApps": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "seats",
                        "liveSpaces",
                        "liveApps"
                      ],
                      "additionalProperties": false
                    },
                    "limits": {
                      "type": "object",
                      "properties": {
                        "seats": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "spaces": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "liveSpaces": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "liveApps": {
                          "type": [
                            "number",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "seats",
                        "liveSpaces",
                        "liveApps"
                      ],
                      "additionalProperties": false
                    },
                    "provider": {
                      "type": "string",
                      "enum": [
                        "autumn",
                        "none"
                      ]
                    },
                    "billingConfigured": {
                      "type": "boolean"
                    },
                    "canManage": {
                      "type": "boolean"
                    },
                    "scheduled": {
                      "default": null,
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "plan": {
                              "type": "string",
                              "enum": [
                                "free",
                                "pro",
                                "pro_annual",
                                "team",
                                "team_annual",
                                "enterprise"
                              ]
                            },
                            "at": {
                              "type": [
                                "number",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "plan",
                            "at"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "providedBy": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "cloudtifact"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "plan",
                    "status",
                    "renewsAt",
                    "usage",
                    "limits",
                    "provider",
                    "billingConfigured",
                    "canManage",
                    "scheduled"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{slug}/billing/checkout": {
      "post": {
        "summary": "owner/admin; Autumn attach: upgrades start now (Stripe Checkout URL when a card is needed), downgrades and \"free\" wait for the period's end; 400 without AUTUMN_SECRET_KEY",
        "tags": [
          "Billing API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "url"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "plan": {
                    "type": "string",
                    "enum": [
                      "free",
                      "pro",
                      "pro_annual",
                      "team",
                      "team_annual"
                    ]
                  }
                },
                "required": [
                  "plan"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{slug}/billing/portal": {
      "post": {
        "summary": "owner/admin; Stripe customer portal via Autumn; 400 without AUTUMN_SECRET_KEY",
        "tags": [
          "Billing API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "url"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{slug}/billing/keep": {
      "post": {
        "summary": "owner/admin; undoes a downgrade or cancel waiting for the period's end; 400 on Free or without AUTUMN_SECRET_KEY",
        "tags": [
          "Billing API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "url"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/webhook": {
      "post": {
        "summary": "Svix signature; billing.updated and customer.products.updated; 404 while AUTUMN_WEBHOOK_SECRET is unset",
        "tags": [
          "Billing API"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "200"
          }
        },
        "description": "Request: Autumn event"
      }
    }
  }
}
