{
  "openapi": "3.1.0",
  "info": {
    "title": "Only Recipes API",
    "version": "1.0.0",
    "description": "API for managing recipes, collections, and user data in Only Recipes. Generated from the zod schemas in lib/api/schemas by `pnpm openapi:generate`."
  },
  "servers": [
    {
      "url": "https://onlyrecipes.app/api",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Users",
      "description": "The signed-in user, profile and preferences"
    },
    {
      "name": "Recipes",
      "description": "Workspace recipes and public recipe pages"
    },
    {
      "name": "Invitations",
      "description": "Kitchen invites, short join codes and seats"
    },
    {
      "name": "Onboarding",
      "description": "Onboarding answers saved on the user, cuisine picker, recommendations"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/v1/user_info": {
      "get": {
        "operationId": "getUserInfo",
        "tags": [
          "Users"
        ],
        "summary": "Get current user",
        "description": "Returns the authenticated user, their active workspace (with plans and billing) and every workspace they belong to. Without workspaceId the default workspace is used, and one is created when the user has none.",
        "parameters": [
          {
            "in": "query",
            "name": "workspaceId",
            "schema": {
              "description": "Optional workspace ID to fetch a specific workspace",
              "type": "string"
            },
            "description": "Optional workspace ID to fetch a specific workspace"
          },
          {
            "in": "query",
            "name": "includeOnboarding",
            "schema": {
              "description": "When 'true', includes the active onboarding flow config in the response. Pass on first launch to avoid a separate network round-trip.",
              "type": "string"
            },
            "description": "When 'true', includes the active onboarding flow config in the response. Pass on first launch to avoid a separate network round-trip."
          }
        ],
        "responses": {
          "200": {
            "description": "User, active workspace and workspace list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserInfoResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/profile": {
      "patch": {
        "operationId": "updateUserProfile",
        "tags": [
          "Users"
        ],
        "summary": "Update profile",
        "description": "Update the display name and/or recipe unit display mode. Send at least one field. The avatar has its own endpoint.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProfileBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated profile fields",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateProfileResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/avatar": {
      "post": {
        "operationId": "uploadUserAvatar",
        "tags": [
          "Users"
        ],
        "summary": "Upload avatar",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Image file, at most 5MB"
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "New avatar URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "image": {
                      "description": "New avatar URL",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "image"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteUserAvatar",
        "tags": [
          "Users"
        ],
        "summary": "Remove avatar",
        "responses": {
          "200": {
            "description": "Avatar removed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/users/check-handle": {
      "get": {
        "operationId": "checkUserHandle",
        "tags": [
          "Users"
        ],
        "summary": "Check handle availability",
        "security": [],
        "description": "Works signed in or out. A signed-in user's own handle counts as available.",
        "parameters": [
          {
            "in": "query",
            "name": "handle",
            "schema": {
              "type": "string",
              "description": "Handle to check (3-15 letters, numbers, underscores)"
            },
            "required": true,
            "description": "Handle to check (3-15 letters, numbers, underscores)"
          }
        ],
        "responses": {
          "200": {
            "description": "Availability (invalid handles return available: false with an error)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "available": {
                      "type": "boolean"
                    },
                    "error": {
                      "description": "Why the handle is unavailable",
                      "type": "string"
                    }
                  },
                  "required": [
                    "available"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "handle missing",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "available": {
                      "type": "boolean"
                    },
                    "error": {
                      "description": "Why the handle is unavailable",
                      "type": "string"
                    }
                  },
                  "required": [
                    "available"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/v1/user/preferences": {
      "get": {
        "operationId": "getUserPreferences",
        "tags": [
          "Users"
        ],
        "summary": "Get preferences",
        "responses": {
          "200": {
            "description": "Display and unit preferences",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserPreferences"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateUserPreferences",
        "tags": [
          "Users"
        ],
        "summary": "Update preferences",
        "description": "Only provided fields are updated.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdatePreferencesBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preferences after the update",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserPreferences"
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/user/default-workspace": {
      "put": {
        "operationId": "setDefaultWorkspace",
        "tags": [
          "Users"
        ],
        "summary": "Set default workspace",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspaceId": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Workspace to make the default"
                  }
                },
                "required": [
                  "workspaceId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default workspace changed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/user/account": {
      "delete": {
        "operationId": "deleteAccount",
        "tags": [
          "Users"
        ],
        "summary": "Delete the account",
        "description": "Permanently deletes the signed-in account and every kitchen it owns, including shared kitchens. Kitchens it only joined stay. A live web subscription is cancelled first.",
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deleted": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "deleted"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/user/account/deletion-preview": {
      "get": {
        "operationId": "getAccountDeletionPreview",
        "tags": [
          "Users"
        ],
        "summary": "Preview account deletion",
        "description": "Counts and names of everything that deleting this account removes.",
        "responses": {
          "200": {
            "description": "What would be deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "kitchens": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "recipes": {
                            "type": "number"
                          },
                          "collections": {
                            "type": "number"
                          },
                          "meals": {
                            "type": "number"
                          },
                          "groceryLists": {
                            "type": "number"
                          },
                          "collaborators": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Names of collaborators who will be removed"
                          },
                          "collaboratorCount": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "recipes",
                          "collections",
                          "meals",
                          "groceryLists",
                          "collaborators",
                          "collaboratorCount"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Kitchens the person owns; all are deleted"
                    },
                    "leaving": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "name"
                        ],
                        "additionalProperties": false
                      },
                      "description": "Kitchens they only joined; these stay"
                    },
                    "favorites": {
                      "type": "number"
                    },
                    "endsPremium": {
                      "type": "boolean"
                    },
                    "needsAppStoreCancel": {
                      "type": "boolean",
                      "description": "An App Store subscription must be cancelled separately"
                    }
                  },
                  "required": [
                    "kitchens",
                    "leaving",
                    "favorites",
                    "endsPremium",
                    "needsAppStoreCancel"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/user/merge-anonymous": {
      "post": {
        "operationId": "mergeAnonymousAccount",
        "tags": [
          "Users"
        ],
        "summary": "Merge an anonymous account",
        "description": "After an anonymous user signs in to an account that already existed, moves the anonymous account's recipes, collections and favorites into the signed-in account's default kitchen. Duplicates are skipped and a repeat call moves nothing.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "anonymousIdToken": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Firebase ID token of the anonymous account being left"
                  }
                },
                "required": [
                  "anonymousIdToken"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "What was moved",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "movedRecipes": {
                      "type": "number",
                      "description": "Recipes moved into the default kitchen"
                    },
                    "skippedDuplicates": {
                      "type": "number",
                      "description": "Recipes already in that kitchen, left behind"
                    },
                    "movedCollections": {
                      "type": "number",
                      "description": "Collections moved"
                    },
                    "movedFavorites": {
                      "type": "number",
                      "description": "Favorites moved"
                    }
                  },
                  "required": [
                    "movedRecipes",
                    "skippedDuplicates",
                    "movedCollections",
                    "movedFavorites"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/recipes": {
      "get": {
        "operationId": "listWorkspaceRecipes",
        "tags": [
          "Recipes"
        ],
        "summary": "List recipes",
        "description": "All non-deleted recipes in the workspace, newest first. Send If-Modified-Since to get 304 when nothing changed; the response carries Last-Modified.",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "description": "Maximum number of recipes to return",
              "type": "string"
            },
            "description": "Maximum number of recipes to return"
          },
          {
            "in": "query",
            "name": "hasProperty",
            "schema": {
              "description": "'true' to only return recipes that have a property assigned",
              "type": "string"
            },
            "description": "'true' to only return recipes that have a property assigned"
          },
          {
            "in": "query",
            "name": "reimported",
            "schema": {
              "description": "'1' to only return recipes recovered after a failed import",
              "type": "string"
            },
            "description": "'1' to only return recipes recovered after a failed import"
          }
        ],
        "responses": {
          "200": {
            "description": "Recipes",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListRecipesResponse"
                }
              }
            }
          },
          "304": {
            "description": "Not modified since If-Modified-Since"
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createWorkspaceRecipe",
        "tags": [
          "Recipes"
        ],
        "summary": "Create a recipe",
        "description": "Creates a private recipe. Ingredients go in rawIngredients.",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateRecipeBody"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created recipe row",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecipeEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/recipes/{recipeId}": {
      "get": {
        "operationId": "getWorkspaceRecipe",
        "tags": [
          "Recipes"
        ],
        "summary": "Get a recipe",
        "description": "The recipe in parser format plus favorited and recovered-import state.",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID"
            },
            "required": true,
            "description": "Recipe ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Recipe",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceRecipeDetail"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateWorkspaceRecipe",
        "tags": [
          "Recipes"
        ],
        "summary": "Update a recipe",
        "description": "Partial update. A body of only { reimportNoticeDismissed: true } is allowed for viewers and returns the short form.",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID"
            },
            "required": true,
            "description": "Recipe ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateRecipeBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated recipe",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateRecipeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteWorkspaceRecipe",
        "tags": [
          "Recipes"
        ],
        "summary": "Delete a recipe",
        "description": "Soft delete.",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID"
            },
            "required": true,
            "description": "Recipe ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/recipes/from-text": {
      "post": {
        "operationId": "createRecipeFromText",
        "tags": [
          "Recipes"
        ],
        "summary": "Create a recipe from pasted text",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string",
                    "minLength": 10,
                    "maxLength": 10000,
                    "description": "Pasted recipe text"
                  },
                  "sourceUrl": {
                    "description": "Page the text was selected on (browser extension). Stored as the recipe's source.",
                    "type": "string",
                    "maxLength": 2048,
                    "pattern": "^https?:\\/\\/"
                  },
                  "imageUrl": {
                    "description": "Photo selected with the text (browser extension). Becomes the cover photo.",
                    "type": "string",
                    "maxLength": 2048,
                    "pattern": "^https:\\/\\/"
                  }
                },
                "required": [
                  "text"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created recipe",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiCreatedRecipeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Could not process the input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/recipes/from-photo": {
      "post": {
        "operationId": "createRecipeFromPhoto",
        "tags": [
          "Recipes"
        ],
        "summary": "Create a recipe from a photo",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "image": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Base64 data URL or image URL"
                  }
                },
                "required": [
                  "image"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created recipe",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiCreatedRecipeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Could not process the input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/recipes/clone": {
      "post": {
        "operationId": "cloneRecipe",
        "tags": [
          "Recipes"
        ],
        "summary": "Copy a recipe into this workspace",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "recipeId": {
                    "type": "string",
                    "description": "Recipe to copy"
                  },
                  "sourceWorkspaceId": {
                    "description": "Workspace the recipe lives in, when copying between kitchens",
                    "type": "string"
                  }
                },
                "required": [
                  "recipeId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "New recipe row",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecipeEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/recipes/transfer": {
      "post": {
        "operationId": "transferRecipe",
        "tags": [
          "Recipes"
        ],
        "summary": "Move a recipe into this workspace",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "recipeId": {
                    "type": "string"
                  },
                  "sourceWorkspaceId": {
                    "type": "string"
                  }
                },
                "required": [
                  "recipeId",
                  "sourceWorkspaceId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Moved recipe row",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecipeEnvelope"
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/recipes/bookmark": {
      "post": {
        "operationId": "toggleRecipeBookmark",
        "tags": [
          "Recipes"
        ],
        "summary": "Toggle a bookmark",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "Recipe ID"
                  }
                },
                "required": [
                  "id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bookmark state after the toggle",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "bookmarked": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "bookmarked"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/recipes/search": {
      "get": {
        "operationId": "searchWorkspaceRecipes",
        "tags": [
          "Recipes"
        ],
        "summary": "Search my recipes",
        "description": "The workspace twin of GET /v1/explore/search, with the same filters plus favorites. Returns paged recipes like the list; nothing searched or filtered returns none.",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "query",
            "name": "q",
            "schema": {
              "description": "Matches name, description, source URL and ingredients",
              "type": "string"
            },
            "description": "Matches name, description, source URL and ingredients"
          },
          {
            "in": "query",
            "name": "sort",
            "schema": {
              "description": "Default newest-first",
              "type": "string",
              "enum": [
                "newest-first",
                "oldest-first",
                "recently-updated",
                "alphabetical",
                "frequently-viewed"
              ]
            },
            "description": "Default newest-first"
          },
          {
            "in": "query",
            "name": "page",
            "schema": {
              "description": "1-based page, default 1",
              "type": "string"
            },
            "description": "1-based page, default 1"
          },
          {
            "in": "query",
            "name": "pageSize",
            "schema": {
              "description": "Default 50, max 100",
              "type": "string"
            },
            "description": "Default 50, max 100"
          },
          {
            "in": "query",
            "name": "maxTime",
            "schema": {
              "description": "Max total time in minutes",
              "type": "string"
            },
            "description": "Max total time in minutes"
          },
          {
            "in": "query",
            "name": "difficulty",
            "schema": {
              "description": "Max difficulty (1-5)",
              "type": "string"
            },
            "description": "Max difficulty (1-5)"
          },
          {
            "in": "query",
            "name": "favorites",
            "schema": {
              "description": "'1' for the caller's favorites only",
              "type": "string"
            },
            "description": "'1' for the caller's favorites only"
          }
        ],
        "responses": {
          "200": {
            "description": "Matching recipes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "recipes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id"
                        ],
                        "additionalProperties": {}
                      },
                      "description": "This page's recipes in sort order, the same shape as the recipe list"
                    },
                    "totalCount": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "page": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "pageCount": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "hasMore": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "recipes",
                    "totalCount",
                    "page",
                    "pageCount",
                    "hasMore"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/recipes/search/filters": {
      "get": {
        "operationId": "getWorkspaceRecipeFilterCounts",
        "tags": [
          "Recipes"
        ],
        "summary": "Tag counts for the My Recipes filter sheet",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          }
        ],
        "responses": {
          "200": {
            "description": "Recipes per tag slug",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tagCounts": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      "description": "Recipes in this workspace per tag slug"
                    }
                  },
                  "required": [
                    "tagCounts"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/recipes/check-source-url": {
      "get": {
        "operationId": "checkRecipeSourceUrl",
        "tags": [
          "Recipes"
        ],
        "summary": "Check whether a source URL was already imported",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "query",
            "name": "sourceUrl",
            "schema": {
              "type": "string",
              "description": "Source URL to look up (normalized variants are also matched)"
            },
            "required": true,
            "description": "Source URL to look up (normalized variants are also matched)"
          }
        ],
        "responses": {
          "200": {
            "description": "Match, if any",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "exists": {
                      "type": "boolean"
                    },
                    "recipeId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "recipeSlug": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "recipeName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "recipeCoverPhoto": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "exists",
                    "recipeId",
                    "recipeSlug",
                    "recipeName",
                    "recipeCoverPhoto"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/recipes/export": {
      "get": {
        "operationId": "exportRecipes",
        "tags": [
          "Recipes"
        ],
        "summary": "Export all recipes",
        "description": "Downloads the workspace's recipes as JSON, CSV, plain text or schema.org JSON-LD.",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "query",
            "name": "format",
            "schema": {
              "description": "Defaults to json",
              "type": "string",
              "enum": [
                "json",
                "csv",
                "txt",
                "schema-org"
              ]
            },
            "description": "Defaults to json"
          }
        ],
        "responses": {
          "200": {
            "description": "Export file (Content-Disposition: attachment)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {}
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/recipes/recent-imports": {
      "get": {
        "operationId": "listRecentImports",
        "tags": [
          "Recipes"
        ],
        "summary": "Recent successful imports",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "query",
            "name": "platform",
            "schema": {
              "description": "Only imports from this platform",
              "type": "string"
            },
            "description": "Only imports from this platform"
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "description": "Default 10, max 50",
              "type": "string"
            },
            "description": "Default 10, max 50"
          }
        ],
        "responses": {
          "200": {
            "description": "Imports, one per recipe",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "imports": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "importedAt": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "string"
                              }
                            ],
                            "type": "string",
                            "format": "date-time"
                          },
                          "platform": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "recipe": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "slug": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "coverPhoto": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "sourceUrl": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "required": [
                                  "id",
                                  "name",
                                  "slug",
                                  "coverPhoto",
                                  "sourceUrl"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "importedAt",
                          "platform",
                          "recipe"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "imports"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/recipes/{recipeId}/ai-cleanup": {
      "get": {
        "operationId": "getAiCleanupStatus",
        "tags": [
          "Recipes"
        ],
        "summary": "AI edit allowance",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID"
            },
            "required": true,
            "description": "Recipe ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Whether AI edits are available and how many remain",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "canUseAiEdits": {
                      "type": "boolean"
                    },
                    "remaining": {
                      "type": "number"
                    },
                    "limit": {
                      "type": "number"
                    },
                    "resetAt": {
                      "description": "Epoch ms when the window resets",
                      "type": "number"
                    }
                  },
                  "required": [
                    "canUseAiEdits",
                    "remaining",
                    "limit"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "runAiCleanup",
        "tags": [
          "Recipes"
        ],
        "summary": "Suggest AI edits",
        "description": "Returns suggested changes; nothing is saved.",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID"
            },
            "required": true,
            "description": "Recipe ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "prompt": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "What to change, e.g. 'convert to metric'"
                  }
                },
                "required": [
                  "prompt"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Suggestions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "suggestions": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "rawIngredients": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "quantity": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "unit": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "preparation": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "section": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "required": [
                              "name"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "instructionSections": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "instructions": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "text": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "text"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "instructions"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "notes": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    },
                    "remaining": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "suggestions",
                    "remaining"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/recipes/{recipeId}/attachments": {
      "get": {
        "operationId": "listRecipeAttachments",
        "tags": [
          "Recipes"
        ],
        "summary": "List attachments",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID"
            },
            "required": true,
            "description": "Recipe ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Attachments, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RecipeAttachment"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "uploadRecipeAttachment",
        "tags": [
          "Recipes"
        ],
        "summary": "Upload an attachment",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID"
            },
            "required": true,
            "description": "Recipe ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "File, at most 10MB"
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Uploaded attachment",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "contentType": {
                      "type": "string"
                    },
                    "size": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "string"
                        }
                      ],
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "url",
                    "contentType",
                    "size",
                    "createdAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/recipes/{recipeId}/attachments/{attachmentId}": {
      "patch": {
        "operationId": "updateRecipeAttachment",
        "tags": [
          "Recipes"
        ],
        "summary": "Update attachment title or alt text",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID"
            },
            "required": true,
            "description": "Recipe ID"
          },
          {
            "in": "path",
            "name": "attachmentId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "altText": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated attachment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecipeAttachment"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteRecipeAttachment",
        "tags": [
          "Recipes"
        ],
        "summary": "Delete an attachment",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID"
            },
            "required": true,
            "description": "Recipe ID"
          },
          {
            "in": "path",
            "name": "attachmentId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/recipes/{recipeId}/collections": {
      "get": {
        "operationId": "listRecipeCollections",
        "tags": [
          "Recipes"
        ],
        "summary": "Collections with membership for this recipe",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID"
            },
            "required": true,
            "description": "Recipe ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Every workspace collection with isInCollection",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "description": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "emoji": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "recipeCount": {
                        "type": "number"
                      },
                      "isInCollection": {
                        "type": "boolean"
                      },
                      "sortOrder": {
                        "type": "number"
                      },
                      "createdAt": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "string"
                          }
                        ],
                        "type": "string",
                        "format": "date-time"
                      }
                    },
                    "required": [
                      "id",
                      "name",
                      "description",
                      "emoji",
                      "recipeCount",
                      "isInCollection",
                      "sortOrder",
                      "createdAt"
                    ],
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "setRecipeCollections",
        "tags": [
          "Recipes"
        ],
        "summary": "Set the recipe's collections",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID"
            },
            "required": true,
            "description": "Recipe ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "collectionIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Full set of collections the recipe should be in"
                  }
                },
                "required": [
                  "collectionIds"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Collections now holding the recipe",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "collectionIds": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "message",
                    "collectionIds"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/recipes/{recipeId}/comments": {
      "get": {
        "operationId": "listRecipeComments",
        "tags": [
          "Recipes"
        ],
        "summary": "List workspace comments",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID"
            },
            "required": true,
            "description": "Recipe ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Comments with replies, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WorkspaceRecipeCommentThread"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createRecipeComment",
        "tags": [
          "Recipes"
        ],
        "summary": "Add a comment or reply",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID"
            },
            "required": true,
            "description": "Recipe ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "body": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Comment text"
                  },
                  "parentId": {
                    "description": "Comment being replied to",
                    "type": "string"
                  }
                },
                "required": [
                  "body"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created comment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceRecipeComment"
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/recipes/{recipeId}/comments/{commentId}": {
      "delete": {
        "operationId": "deleteRecipeComment",
        "tags": [
          "Recipes"
        ],
        "summary": "Delete a comment",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID"
            },
            "required": true,
            "description": "Recipe ID"
          },
          {
            "in": "path",
            "name": "commentId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/recipes/{recipeId}/cover-photo": {
      "post": {
        "operationId": "setRecipeCoverPhoto",
        "tags": [
          "Recipes"
        ],
        "summary": "Upload or choose the cover photo",
        "description": "Multipart upload of a new image, or JSON { imageUrl } to promote an image already on the recipe.",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID"
            },
            "required": true,
            "description": "Recipe ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "File, at most 10MB"
                  }
                },
                "required": [
                  "file"
                ]
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "imageUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "URL of an image already on this recipe"
                  }
                },
                "required": [
                  "imageUrl"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "New cover",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "coverPhoto": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "coverPhotoBlurHash": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "coverPhoto"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteRecipeCoverPhoto",
        "tags": [
          "Recipes"
        ],
        "summary": "Remove the cover photo",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID"
            },
            "required": true,
            "description": "Recipe ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Removed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/recipes/{recipeId}/instruction-images": {
      "post": {
        "operationId": "uploadInstructionImage",
        "tags": [
          "Recipes"
        ],
        "summary": "Upload a step image",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID"
            },
            "required": true,
            "description": "Recipe ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "File, at most 10MB"
                  }
                },
                "required": [
                  "file"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Uploaded image URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "url"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteInstructionImage",
        "tags": [
          "Recipes"
        ],
        "summary": "Delete a step image",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID"
            },
            "required": true,
            "description": "Recipe ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "imageUrl": {
                    "type": "string"
                  }
                },
                "required": [
                  "imageUrl"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/recipes/{recipeId}/meal-slot": {
      "put": {
        "operationId": "setRecipeMealSlot",
        "tags": [
          "Recipes"
        ],
        "summary": "Tag the recipe with a meal type",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID"
            },
            "required": true,
            "description": "Recipe ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mealSlotId": {
                    "description": "Meal slot to tag the recipe with, or null to clear",
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "mealSlotId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "New meal slot",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "mealSlotId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "mealSlotId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/recipes/{recipeId}/owner": {
      "patch": {
        "operationId": "changeRecipeOwner",
        "tags": [
          "Recipes"
        ],
        "summary": "Change who the recipe is attributed to",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID"
            },
            "required": true,
            "description": "Recipe ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "userId": {
                    "type": "string",
                    "description": "Workspace member to make the owner"
                  }
                },
                "required": [
                  "userId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "New creator",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "creator": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "image": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "name",
                            "image"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "creator"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/recipes/{recipeId}/share-code": {
      "post": {
        "operationId": "createRecipeShareCode",
        "tags": [
          "Recipes"
        ],
        "summary": "Get or create a share link",
        "description": "Idempotent: returns the existing code when there is one.",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID"
            },
            "required": true,
            "description": "Recipe ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Share code and link",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "shareCode": {
                      "type": "string"
                    },
                    "shareUrl": {
                      "type": "string",
                      "description": "Public share link"
                    }
                  },
                  "required": [
                    "shareCode",
                    "shareUrl"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/recipes/{recipeId}/view": {
      "post": {
        "operationId": "recordWorkspaceRecipeView",
        "tags": [
          "Recipes"
        ],
        "summary": "Record a member view",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID"
            },
            "required": true,
            "description": "Recipe ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Recorded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuccessResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/recipes/{recipeId}/measurements": {
      "get": {
        "operationId": "listRecipeMeasurements",
        "tags": [
          "Recipes"
        ],
        "summary": "List measurements (always empty)",
        "deprecated": true,
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID"
            },
            "required": true,
            "description": "Recipe ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Empty list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {}
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createRecipeMeasurement",
        "tags": [
          "Recipes"
        ],
        "summary": "Create a measurement (not implemented)",
        "deprecated": true,
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID"
            },
            "required": true,
            "description": "Recipe ID"
          }
        ],
        "responses": {
          "501": {
            "description": "Not implemented",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/recipes/{recipeId}/measurements/{id}": {
      "put": {
        "operationId": "updateRecipeMeasurement",
        "tags": [
          "Recipes"
        ],
        "summary": "Update a measurement (not implemented)",
        "deprecated": true,
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID"
            },
            "required": true,
            "description": "Recipe ID"
          },
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "501": {
            "description": "Not implemented",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteRecipeMeasurement",
        "tags": [
          "Recipes"
        ],
        "summary": "Delete a measurement (not implemented)",
        "deprecated": true,
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID"
            },
            "required": true,
            "description": "Recipe ID"
          },
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "501": {
            "description": "Not implemented",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/recipes/{recipeId}": {
      "get": {
        "operationId": "getPublicRecipe",
        "tags": [
          "Recipes"
        ],
        "summary": "Get a public recipe",
        "description": "Looks up a public recipe by ID or slug, or any recipe by share code.",
        "security": [],
        "parameters": [
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID (public endpoints also accept a slug or share code where noted)"
            },
            "required": true,
            "description": "Recipe ID (public endpoints also accept a slug or share code where noted)"
          },
          {
            "in": "query",
            "name": "includeSimilar",
            "schema": {
              "description": "'true' to include similarRecipes",
              "type": "string"
            },
            "description": "'true' to include similarRecipes"
          },
          {
            "in": "query",
            "name": "similarLimit",
            "schema": {
              "description": "Number of similar recipes, default 6, max 20",
              "type": "string"
            },
            "description": "Number of similar recipes, default 6, max 20"
          }
        ],
        "responses": {
          "200": {
            "description": "Recipe in parser format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicRecipe"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/recipes/{recipeId}/similar": {
      "get": {
        "operationId": "listSimilarRecipes",
        "tags": [
          "Recipes"
        ],
        "summary": "Similar public recipes",
        "security": [],
        "parameters": [
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID (public endpoints also accept a slug or share code where noted)"
            },
            "required": true,
            "description": "Recipe ID (public endpoints also accept a slug or share code where noted)"
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "description": "Default 6, max 20",
              "type": "string"
            },
            "description": "Default 6, max 20"
          }
        ],
        "responses": {
          "200": {
            "description": "Nearest recipes by embedding",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SimilarRecipeWithRating"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/recipes/{recipeId}/tags": {
      "get": {
        "operationId": "listRecipeTags",
        "tags": [
          "Recipes"
        ],
        "summary": "Tags on a public recipe",
        "security": [],
        "parameters": [
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID (public endpoints also accept a slug or share code where noted)"
            },
            "required": true,
            "description": "Recipe ID (public endpoints also accept a slug or share code where noted)"
          }
        ],
        "responses": {
          "200": {
            "description": "Tags",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Tag"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/recipes/{recipeId}/user-state": {
      "get": {
        "operationId": "getRecipeUserState",
        "tags": [
          "Recipes"
        ],
        "summary": "Viewer state for a public recipe page",
        "description": "Signed out (or on any error) returns the signed-out state, never an error.",
        "security": [],
        "parameters": [
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID (public endpoints also accept a slug or share code where noted)"
            },
            "required": true,
            "description": "Recipe ID (public endpoints also accept a slug or share code where noted)"
          }
        ],
        "responses": {
          "200": {
            "description": "Viewer state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecipeUserState"
                }
              }
            }
          }
        }
      }
    },
    "/v1/recipes/{recipeId}/share-url": {
      "post": {
        "operationId": "getPublicRecipeShareUrl",
        "tags": [
          "Recipes"
        ],
        "summary": "URL to share for a public recipe",
        "description": "The slug page when it exists, otherwise the recipe's share link (created on demand). Imported recipes have no slug page while public recipe browsing is off.",
        "parameters": [
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID (public endpoints also accept a slug or share code where noted)"
            },
            "required": true,
            "description": "Recipe ID (public endpoints also accept a slug or share code where noted)"
          }
        ],
        "responses": {
          "200": {
            "description": "URL to share",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "url"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/recipes/{recipeId}/view": {
      "post": {
        "operationId": "recordPublicRecipeView",
        "tags": [
          "Recipes"
        ],
        "summary": "Record a public view",
        "security": [],
        "parameters": [
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID (public endpoints also accept a slug or share code where noted)"
            },
            "required": true,
            "description": "Recipe ID (public endpoints also accept a slug or share code where noted)"
          }
        ],
        "responses": {
          "204": {
            "description": "Recorded (errors are swallowed)"
          }
        }
      }
    },
    "/v1/recipes/{recipeId}/flag": {
      "post": {
        "operationId": "flagRecipe",
        "tags": [
          "Recipes"
        ],
        "summary": "Report a problem with a recipe",
        "security": [],
        "parameters": [
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID (public endpoints also accept a slug or share code where noted)"
            },
            "required": true,
            "description": "Recipe ID (public endpoints also accept a slug or share code where noted)"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "enum": [
                      "missing_image",
                      "incorrect_ingredient",
                      "missing_category",
                      "broken_instructions",
                      "spam_fake",
                      "inappropriate_content",
                      "other"
                    ]
                  },
                  "details": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "email": {
                    "description": "Reporter email when signed out",
                    "type": "string",
                    "format": "email",
                    "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                  }
                },
                "required": [
                  "reason"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Report received",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/recipes/{recipeId}/questions": {
      "post": {
        "operationId": "askRecipeQuestion",
        "tags": [
          "Recipes"
        ],
        "summary": "Ask a question about a recipe",
        "security": [],
        "parameters": [
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID (public endpoints also accept a slug or share code where noted)"
            },
            "required": true,
            "description": "Recipe ID (public endpoints also accept a slug or share code where noted)"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "question": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1000
                  }
                },
                "required": [
                  "question"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Question",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "recipeId": {
                      "type": "string"
                    },
                    "userId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "question": {
                      "type": "string"
                    },
                    "createdAt": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "string"
                        }
                      ],
                      "type": "string",
                      "format": "date-time"
                    },
                    "updatedAt": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "string"
                        }
                      ],
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "id",
                    "recipeId",
                    "userId",
                    "question",
                    "createdAt",
                    "updatedAt"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/recipes/{recipeId}/ratings": {
      "get": {
        "operationId": "getRecipeRatings",
        "tags": [
          "Recipes"
        ],
        "summary": "Ratings summary",
        "description": "Signed in, userRating is the caller's own rating.",
        "security": [],
        "parameters": [
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID (public endpoints also accept a slug or share code where noted)"
            },
            "required": true,
            "description": "Recipe ID (public endpoints also accept a slug or share code where noted)"
          }
        ],
        "responses": {
          "200": {
            "description": "Aggregate, distribution and latest 50 reviews",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "aggregateRating": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "totalCount": {
                      "type": "number"
                    },
                    "userRatings": {
                      "type": "object",
                      "properties": {
                        "count": {
                          "type": "number"
                        },
                        "distribution": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {
                            "type": "number"
                          },
                          "description": "Count per star, keys 1-5"
                        }
                      },
                      "required": [
                        "count",
                        "distribution"
                      ],
                      "additionalProperties": false
                    },
                    "sourceRating": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "value": {
                              "type": "number"
                            },
                            "count": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "sourceName": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "sourceUrl": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "value",
                            "count",
                            "sourceName",
                            "sourceUrl"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "userRating": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "rating": {
                              "type": "number"
                            },
                            "review": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "required": [
                            "rating",
                            "review"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "reviews": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PublicReview"
                      }
                    }
                  },
                  "required": [
                    "aggregateRating",
                    "totalCount",
                    "userRatings",
                    "sourceRating",
                    "userRating",
                    "reviews"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "rateRecipe",
        "tags": [
          "Recipes"
        ],
        "summary": "Rate or re-rate a recipe",
        "parameters": [
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID (public endpoints also accept a slug or share code where noted)"
            },
            "required": true,
            "description": "Recipe ID (public endpoints also accept a slug or share code where noted)"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "rating": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 5
                  },
                  "review": {
                    "type": "string",
                    "maxLength": 2000
                  }
                },
                "required": [
                  "rating"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved rating and new aggregate",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "rating": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "recipeId": {
                          "type": "string"
                        },
                        "userId": {
                          "type": "string"
                        },
                        "rating": {
                          "type": "number"
                        },
                        "review": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "string"
                            }
                          ],
                          "type": "string",
                          "format": "date-time"
                        },
                        "updatedAt": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "string"
                            }
                          ],
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "required": [
                        "id",
                        "recipeId",
                        "userId",
                        "rating",
                        "review",
                        "createdAt",
                        "updatedAt"
                      ],
                      "additionalProperties": false
                    },
                    "aggregateRating": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "aggregateRatingCount": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "success",
                    "rating",
                    "aggregateRating",
                    "aggregateRatingCount"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteRecipeRating",
        "tags": [
          "Recipes"
        ],
        "summary": "Remove your rating",
        "parameters": [
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID (public endpoints also accept a slug or share code where noted)"
            },
            "required": true,
            "description": "Recipe ID (public endpoints also accept a slug or share code where noted)"
          }
        ],
        "responses": {
          "200": {
            "description": "New aggregate",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "aggregateRating": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "aggregateRatingCount": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "success",
                    "aggregateRating",
                    "aggregateRatingCount"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/recipes/{recipeId}/ratings/reviews": {
      "get": {
        "operationId": "listRecipeReviews",
        "tags": [
          "Recipes"
        ],
        "summary": "Page through reviews",
        "security": [],
        "parameters": [
          {
            "in": "path",
            "name": "recipeId",
            "schema": {
              "type": "string",
              "description": "Recipe ID (public endpoints also accept a slug or share code where noted)"
            },
            "required": true,
            "description": "Recipe ID (public endpoints also accept a slug or share code where noted)"
          },
          {
            "in": "query",
            "name": "page",
            "schema": {
              "description": "1-based page, max 1000",
              "type": "string"
            },
            "description": "1-based page, max 1000"
          }
        ],
        "responses": {
          "200": {
            "description": "Reviews page",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "reviews": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PublicReview"
                      }
                    },
                    "page": {
                      "type": "number"
                    },
                    "pageSize": {
                      "type": "number"
                    },
                    "total": {
                      "type": "number"
                    },
                    "hasMore": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "reviews",
                    "page",
                    "pageSize",
                    "total",
                    "hasMore"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/recipes/generate": {
      "post": {
        "operationId": "generateRecipe",
        "tags": [
          "Recipes"
        ],
        "summary": "Generate a public recipe with AI",
        "description": "Anonymous tool, one generation per IP and cookie per day.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string",
                    "minLength": 10,
                    "maxLength": 500,
                    "description": "What to cook"
                  }
                },
                "required": [
                  "description"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Generated recipe",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "recipe": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "slug": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "slug"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "success",
                    "recipe"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Could not process the input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/recipes/images/upload": {
      "post": {
        "operationId": "uploadRecipeImage",
        "tags": [
          "Recipes"
        ],
        "summary": "Upload a recipe image",
        "description": "Raw image bytes as the request body.",
        "parameters": [
          {
            "in": "query",
            "name": "filename",
            "schema": {
              "type": "string",
              "description": "Original filename; a random suffix is added"
            },
            "required": true,
            "description": "Original filename; a random suffix is added"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Stored object",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "url"
                  ],
                  "additionalProperties": {},
                  "description": "Storage upload result"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/invitations": {
      "get": {
        "operationId": "listWorkspaceInvitations",
        "tags": [
          "Invitations"
        ],
        "summary": "Invite sheet state",
        "description": "Seats (pending invites hold a seat), pending invitations (owner only) and members. Call when the invite sheet opens to choose between the premium, not-premium and seats-full screens.",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          }
        ],
        "responses": {
          "200": {
            "description": "Seats, invitations and members",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationsListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createWorkspaceInvitation",
        "tags": [
          "Invitations"
        ],
        "summary": "Create invitation",
        "description": "Owner only. Creates a 7-day, single-use invite with a six-character code. With email, sends a branded email and only that address can accept. Errors carry `code`: not_owner, invalid_body, daily_limit (429, max 5 a day), premium_required, editor_requires_premium, seats_full (403, with `seats`), self_invite (400), duplicate_email (409, with `invitationId`).",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInvitationBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created invitation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateInvitationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/invitations/{invitationId}": {
      "delete": {
        "operationId": "cancelWorkspaceInvitation",
        "tags": [
          "Invitations"
        ],
        "summary": "Cancel invitation",
        "description": "Owner only. Frees the seat; the code then answers 410 invite_cancelled.",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "path",
            "name": "invitationId",
            "schema": {
              "type": "string",
              "description": "Invitation id"
            },
            "required": true,
            "description": "Invitation id"
          }
        ],
        "responses": {
          "200": {
            "description": "Cancelled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelInvitationResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces/{workspaceIdOrSlug}/invitations/{invitationId}/resend": {
      "post": {
        "operationId": "resendWorkspaceInvitation",
        "tags": [
          "Invitations"
        ],
        "summary": "Resend email invitation",
        "description": "Owner only. Sends an email invite again and restarts the 7 days. A link invite needs `email` in the body (else 400 not_email_invite) and becomes an email invite for that address (409 duplicate_email or already_member, 400 self_invite). 429 rate_limited after 3 an hour.",
        "parameters": [
          {
            "in": "path",
            "name": "workspaceIdOrSlug",
            "schema": {
              "type": "string",
              "description": "Workspace ID or slug"
            },
            "required": true,
            "description": "Workspace ID or slug"
          },
          {
            "in": "path",
            "name": "invitationId",
            "schema": {
              "type": "string",
              "description": "Invitation id"
            },
            "required": true,
            "description": "Invitation id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResendInvitationBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Resent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResendInvitationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/invitations/{invitationId}": {
      "get": {
        "operationId": "getInvitation",
        "tags": [
          "Invitations"
        ],
        "summary": "Invite preview by id",
        "parameters": [
          {
            "in": "path",
            "name": "invitationId",
            "schema": {
              "type": "string",
              "description": "Invitation id (wsi_...); a short code is accepted too"
            },
            "required": true,
            "description": "Invitation id (wsi_...); a short code is accepted too"
          }
        ],
        "responses": {
          "200": {
            "description": "Usable invite",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitePreviewResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "410": {
            "description": "Invite expired, used or cancelled; preview plus an owner-named message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InviteUnusableResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/invitations/{invitationId}/accept": {
      "post": {
        "operationId": "acceptInvitation",
        "tags": [
          "Invitations"
        ],
        "summary": "Accept invite by id",
        "description": "Joins the kitchen and pushes the owner. Errors: 403 seats_full, 410 as for the preview. Already a member returns 200 with alreadyMember.",
        "parameters": [
          {
            "in": "path",
            "name": "invitationId",
            "schema": {
              "type": "string",
              "description": "Invitation id (wsi_...); a short code is accepted too"
            },
            "required": true,
            "description": "Invitation id (wsi_...); a short code is accepted too"
          }
        ],
        "responses": {
          "200": {
            "description": "Joined",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcceptInvitationResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "410": {
            "description": "Invite expired, used or cancelled; preview plus an owner-named message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InviteUnusableResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/invitations/by-code/{code}": {
      "get": {
        "operationId": "getInvitationByCode",
        "tags": [
          "Invitations"
        ],
        "summary": "Invite preview by code",
        "description": "For Join kitchen. Rate limited to 20 lookups an hour per IP and per user (429 rate_limited).",
        "parameters": [
          {
            "in": "path",
            "name": "code",
            "schema": {
              "type": "string",
              "description": "Short code in any form (\"K7M4QX\", \"k7m-4qx\"), or an invitation id"
            },
            "required": true,
            "description": "Short code in any form (\"K7M4QX\", \"k7m-4qx\"), or an invitation id"
          }
        ],
        "responses": {
          "200": {
            "description": "Usable invite",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitePreviewResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "410": {
            "description": "Invite expired, used or cancelled; preview plus an owner-named message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InviteUnusableResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/invitations/by-code/{code}/accept": {
      "post": {
        "operationId": "acceptInvitationByCode",
        "tags": [
          "Invitations"
        ],
        "summary": "Accept invite by code",
        "description": "Same as accept by id, and shares the lookup rate limit.",
        "parameters": [
          {
            "in": "path",
            "name": "code",
            "schema": {
              "type": "string",
              "description": "Short code in any form (\"K7M4QX\", \"k7m-4qx\"), or an invitation id"
            },
            "required": true,
            "description": "Short code in any form (\"K7M4QX\", \"k7m-4qx\"), or an invitation id"
          }
        ],
        "responses": {
          "200": {
            "description": "Joined",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcceptInvitationResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden (read-only member, plan limit, or no access)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "410": {
            "description": "Invite expired, used or cancelled; preview plus an owner-named message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InviteUnusableResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/onboarding/preferences": {
      "get": {
        "operationId": "getOnboardingPreferences",
        "tags": [
          "Onboarding"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Saved onboarding answers",
        "description": "Reasons, sources, dietary restrictions, favorite cuisines and cook-with. Anonymous Firebase users included. Empty defaults before the first save.",
        "responses": {
          "200": {
            "description": "Preferences",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardingPreferencesResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "saveOnboardingPreferences",
        "tags": [
          "Onboarding"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Save onboarding answers",
        "description": "Partial, idempotent upsert after each step. Omitted keys keep their value; favoriteCuisines replaces the set. 400 code invalid_body, or unknown_cuisines with `unknown`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OnboardingPreferencesBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved preferences",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardingPreferencesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/onboarding/cuisines": {
      "get": {
        "operationId": "listOnboardingCuisines",
        "tags": [
          "Onboarding"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Cuisine picker options",
        "description": "Cuisines with public recipes, most recipes first. Cached 24h server side.",
        "responses": {
          "200": {
            "description": "Cuisines",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardingCuisinesResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/onboarding/recommended-recipes": {
      "get": {
        "operationId": "getOnboardingRecommendedRecipes",
        "tags": [
          "Onboarding"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Top recipes for picked cuisines",
        "description": "Balanced round-robin across the cuisines, ranked by Bayesian rating, saves and views, filtered by dietary restrictions. Tops up with trending below 12 results.",
        "parameters": [
          {
            "in": "query",
            "name": "cuisines",
            "schema": {
              "description": "Comma-separated cuisine ids or slugs. Absent: the saved favorites",
              "type": "string"
            },
            "description": "Comma-separated cuisine ids or slugs. Absent: the saved favorites"
          },
          {
            "in": "query",
            "name": "dietary",
            "schema": {
              "description": "Comma-separated dietary ids. Absent: the saved restrictions",
              "type": "string"
            },
            "description": "Comma-separated dietary ids. Absent: the saved restrictions"
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "description": "1 to 40, default 24",
              "type": "string"
            },
            "description": "1 to 40, default 24"
          }
        ],
        "responses": {
          "200": {
            "description": "Recommendations",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecommendedRecipesResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request or validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "UpdateProfileBody": {
        "type": "object",
        "properties": {
          "recipeUnitDisplayMode": {
            "type": "string",
            "enum": [
              "original",
              "converted"
            ]
          },
          "name": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "UpdatePreferencesBody": {
        "type": "object",
        "properties": {
          "keepScreenAwake": {
            "description": "Whether to keep the screen awake when viewing recipes",
            "type": "boolean"
          },
          "instructionImagesMode": {
            "description": "How to display instruction images",
            "type": "string",
            "enum": [
              "none",
              "thumbnail",
              "full"
            ]
          },
          "showIngredientDescriptions": {
            "description": "Whether to show ingredient descriptions",
            "type": "boolean"
          },
          "preferredUnits": {
            "description": "Preferred unit system",
            "type": "string",
            "enum": [
              "imperial",
              "metric"
            ]
          },
          "currency": {
            "description": "Preferred currency code (e.g., USD, EUR)",
            "type": "string",
            "minLength": 3,
            "maxLength": 3
          }
        }
      },
      "CreateRecipeBody": {
        "type": "object",
        "properties": {
          "name": {
            "description": "Recipe name",
            "type": "string"
          },
          "title": {
            "description": "Recipe title (alias for name)",
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "coverPhoto": {
            "description": "Cover photo URL",
            "type": "string"
          },
          "sourceUrl": {
            "description": "Original source URL; marks the recipe as imported",
            "type": "string"
          },
          "prepTime": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ],
            "description": "Preparation time (TimeDuration)"
          },
          "cookTime": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ],
            "description": "Cooking time (TimeDuration)"
          },
          "recipeYield": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RecipeYield"
              },
              {
                "type": "null"
              }
            ]
          },
          "cuisine": {
            "type": [
              "string",
              "null"
            ]
          },
          "difficulty": {
            "description": "Difficulty level (1-5)",
            "type": [
              "number",
              "null"
            ]
          },
          "cost": {
            "description": "Estimated cost in cents",
            "type": [
              "number",
              "null"
            ]
          },
          "instructionSections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InstructionSection"
            }
          },
          "rawIngredients": {
            "description": "Ingredients (not `ingredients`)",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RawIngredientInput"
            }
          }
        }
      },
      "RecipeYield": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "description": "Yield amount"
          },
          "unit": {
            "type": "string",
            "description": "Yield unit (e.g., 'servings', 'cookies')"
          }
        },
        "required": [
          "amount",
          "unit"
        ]
      },
      "InstructionSection": {
        "type": "object",
        "properties": {
          "name": {
            "description": "Section name (e.g., 'For the sauce')",
            "type": "string"
          },
          "instructions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Instruction"
            },
            "description": "List of instructions"
          }
        },
        "required": [
          "instructions"
        ]
      },
      "Instruction": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "description": "Instruction text"
          },
          "name": {
            "description": "Instruction step name",
            "type": "string"
          },
          "url": {
            "description": "Optional URL reference",
            "type": "string"
          },
          "images": {
            "description": "Step images",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecipeImage"
            }
          }
        },
        "required": [
          "text"
        ]
      },
      "RecipeImage": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Image URL"
          },
          "width": {
            "description": "Image width in pixels",
            "type": "number"
          },
          "height": {
            "description": "Image height in pixels",
            "type": "number"
          }
        },
        "required": [
          "url"
        ]
      },
      "RawIngredientInput": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "description": "Full ingredient description"
          },
          "quantity": {
            "description": "Quantity information",
            "type": "object",
            "properties": {
              "amount": {
                "type": "number"
              },
              "unit": {
                "type": "string"
              },
              "unitId": {
                "type": "string"
              }
            }
          }
        },
        "required": [
          "description"
        ]
      },
      "UpdateRecipeBody": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "slug": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 60,
                "pattern": "^[a-z0-9-]+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "coverPhoto": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 5000
              },
              {
                "type": "null"
              }
            ]
          },
          "difficulty": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 5
              },
              {
                "type": "null"
              }
            ]
          },
          "cost": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "isPrivate": {
            "type": "boolean"
          },
          "units": {
            "type": "string",
            "enum": [
              "imperial",
              "metric"
            ]
          },
          "sourceUrl": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "recipeYield": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": "number"
                  },
                  "unit": {
                    "type": "string"
                  }
                },
                "required": [
                  "amount",
                  "unit"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "prepTime": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "days": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "hours": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "minutes": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "seconds": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "isoDuration": {
                    "type": "string"
                  }
                },
                "required": [
                  "isoDuration"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "cookTime": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "days": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "hours": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "minutes": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "seconds": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "isoDuration": {
                    "type": "string"
                  }
                },
                "required": [
                  "isoDuration"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "totalTime": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "days": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "hours": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "minutes": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "seconds": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "isoDuration": {
                    "type": "string"
                  }
                },
                "required": [
                  "isoDuration"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "cuisineId": {
            "type": [
              "string",
              "null"
            ]
          },
          "cuisine": {
            "type": [
              "string",
              "null"
            ]
          },
          "course": {
            "type": [
              "string",
              "null"
            ]
          },
          "keywords": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "authors": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "name"
                  ]
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "nutrition": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ]
          },
          "suitableForDiet": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "instructionSections": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/InstructionSection"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "rawIngredients": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ]
          },
          "tiktokId": {
            "type": [
              "string",
              "null"
            ]
          },
          "instagramReelId": {
            "type": [
              "string",
              "null"
            ]
          },
          "youtubeShortId": {
            "type": [
              "string",
              "null"
            ]
          },
          "youtubeVideoId": {
            "type": [
              "string",
              "null"
            ]
          },
          "favorited": {
            "description": "Add or remove the recipe from the caller's favorites",
            "type": "boolean"
          },
          "reimportNoticeDismissed": {
            "type": "boolean",
            "const": true
          }
        }
      },
      "CreateInvitationBody": {
        "type": "object",
        "properties": {
          "role": {
            "default": "editor",
            "type": "string",
            "enum": [
              "editor",
              "viewer"
            ],
            "description": "editor = Can edit, viewer = Can view"
          },
          "email": {
            "description": "Send an email invite that only this address can accept. Omit for a code + link invite.",
            "type": "string",
            "maxLength": 254,
            "format": "email",
            "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "label": {
            "description": "Who the invite is for (\"Sam\"), shown as \"For Sam\". Defaults to the email local part.",
            "type": "string",
            "maxLength": 60
          }
        }
      },
      "ResendInvitationBody": {
        "type": "object",
        "properties": {
          "email": {
            "description": "Link invites only: send this link invite by email. It becomes an email invite only that address can accept.",
            "type": "string",
            "maxLength": 254,
            "format": "email",
            "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          }
        }
      },
      "OnboardingPreferencesBody": {
        "type": "object",
        "properties": {
          "reasons": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 64
            }
          },
          "sources": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 64
            }
          },
          "dietary": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 64
            }
          },
          "favoriteCuisines": {
            "description": "Cuisine ids or slugs; replaces the saved set",
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 64
            }
          },
          "cookWithSomeone": {
            "type": [
              "boolean",
              "null"
            ]
          }
        }
      },
      "UserInfoResponse": {
        "type": "object",
        "properties": {
          "user": {
            "$ref": "#/components/schemas/UserInfoUser"
          },
          "onboarding": {
            "description": "Active onboarding flow with steps and fields (only when includeOnboarding=true; null when none is active)"
          },
          "workspace": {
            "$ref": "#/components/schemas/UserInfoWorkspace"
          },
          "workspaces": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserInfoWorkspaceSummary"
            },
            "description": "All workspaces the user belongs to"
          }
        },
        "required": [
          "user",
          "workspace",
          "workspaces"
        ],
        "additionalProperties": false
      },
      "UserInfoUser": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "User ID"
          },
          "email": {
            "description": "User email address (null for anonymous users)",
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "description": "User display name",
            "type": [
              "string",
              "null"
            ]
          },
          "handle": {
            "description": "User handle/username",
            "type": [
              "string",
              "null"
            ]
          },
          "image": {
            "description": "User avatar URL",
            "type": [
              "string",
              "null"
            ]
          },
          "bio": {
            "description": "User bio",
            "type": [
              "string",
              "null"
            ]
          },
          "country": {
            "description": "User country",
            "type": [
              "string",
              "null"
            ]
          },
          "preferredUnits": {
            "description": "Preferred measurement units",
            "type": [
              "string",
              "null"
            ]
          },
          "recipeUnitDisplayMode": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "original",
                  "converted"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "How recipe amounts are shown: as written or converted (null = never chosen)"
          },
          "currency": {
            "description": "Preferred currency",
            "type": [
              "string",
              "null"
            ]
          },
          "admin": {
            "type": "boolean",
            "description": "Whether user is an admin"
          },
          "legacy": {
            "type": "boolean",
            "description": "Whether user is a legacy user (pre-2.0)"
          }
        },
        "required": [
          "id",
          "email",
          "name",
          "handle",
          "image",
          "bio",
          "country",
          "preferredUnits",
          "recipeUnitDisplayMode",
          "currency",
          "admin",
          "legacy"
        ],
        "additionalProperties": false
      },
      "UserInfoWorkspace": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Workspace ID"
          },
          "name": {
            "type": "string",
            "description": "Workspace name"
          },
          "slug": {
            "type": "string",
            "description": "Workspace URL slug"
          },
          "plan": {
            "type": "string",
            "description": "Subscription plan (free, premium)"
          },
          "locked": {
            "type": "boolean",
            "description": "Whether the workspace is locked due to lapsed subscription"
          },
          "role": {
            "description": "User's role in workspace",
            "type": "string"
          },
          "isDefault": {
            "description": "Whether this is user's default workspace",
            "type": "boolean"
          },
          "maxRecipes": {
            "type": "number",
            "description": "Maximum recipes allowed"
          },
          "maxCollections": {
            "type": "number",
            "description": "Maximum collections allowed"
          },
          "maxCollaborators": {
            "type": "number",
            "description": "Maximum collaborators allowed"
          },
          "canScalePortions": {
            "type": "boolean",
            "description": "Whether portion scaling is enabled"
          },
          "hideAds": {
            "type": "boolean",
            "description": "Whether ads are hidden"
          },
          "recipeCount": {
            "type": "number",
            "description": "Current recipe count"
          },
          "collectionCount": {
            "type": "number",
            "description": "Current collection count"
          },
          "plans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Plan"
            },
            "description": "Available plans with current indicator"
          },
          "billing": {
            "type": "object",
            "properties": {
              "source": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "app_store",
                      "play_store",
                      "other"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Who bills the subscription; manage or cancel it there"
              },
              "store": {
                "description": "Raw RevenueCat store (APP_STORE, PLAY_STORE, ...)",
                "type": [
                  "string",
                  "null"
                ]
              },
              "expiresAt": {
                "description": "ISO end of the current paid period",
                "type": [
                  "string",
                  "null"
                ]
              },
              "cancelsAt": {
                "description": "ISO date access ends when auto-renew is off, else null",
                "type": [
                  "string",
                  "null"
                ]
              },
              "billedBy": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "app_store",
                      "play_store",
                      "web",
                      "granted",
                      "other"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Who bills it, including web (Stripe) and granted (promotional, no billing)"
              },
              "status": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "active",
                      "trialing",
                      "canceling",
                      "past_due",
                      "grace_period",
                      "paused",
                      "expired"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Subscription state, null when the workspace never subscribed"
              },
              "productId": {
                "description": "Store product (or rc_promo_* grant) behind premium",
                "type": [
                  "string",
                  "null"
                ]
              },
              "period": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "weekly",
                      "monthly",
                      "two_month",
                      "three_month",
                      "six_month",
                      "yearly",
                      "lifetime"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Billing period or grant length read from the product id, when known"
              }
            },
            "required": [
              "source",
              "store",
              "expiresAt",
              "cancelsAt",
              "billedBy",
              "status",
              "productId",
              "period"
            ],
            "additionalProperties": false,
            "description": "Who bills the subscription and when it renews or ends"
          }
        },
        "required": [
          "id",
          "name",
          "slug",
          "plan",
          "locked",
          "maxRecipes",
          "maxCollections",
          "maxCollaborators",
          "canScalePortions",
          "hideAds",
          "recipeCount",
          "collectionCount",
          "plans",
          "billing"
        ],
        "additionalProperties": false
      },
      "Plan": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Plan ID (free, premium)"
          },
          "name": {
            "type": "string",
            "description": "Plan display name"
          },
          "description": {
            "type": "string",
            "description": "Plan description"
          },
          "price": {
            "type": "object",
            "properties": {
              "monthly": {
                "type": "number",
                "description": "Monthly price in cents"
              },
              "yearly": {
                "type": "number",
                "description": "Yearly price in cents"
              }
            },
            "required": [
              "monthly",
              "yearly"
            ],
            "additionalProperties": false
          },
          "features": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlanFeature"
            },
            "description": "List of plan features"
          },
          "limits": {
            "type": "object",
            "properties": {
              "maxCollaborators": {
                "type": "number",
                "description": "Maximum workspace members"
              },
              "maxRecipes": {
                "type": "number",
                "description": "Maximum recipes (-1 = unlimited)"
              },
              "maxFavorites": {
                "type": "number",
                "description": "Maximum favorites (-1 = unlimited)"
              },
              "maxCollections": {
                "type": "number",
                "description": "Maximum collections (-1 = unlimited)"
              }
            },
            "required": [
              "maxCollaborators",
              "maxRecipes",
              "maxFavorites",
              "maxCollections"
            ],
            "additionalProperties": false
          },
          "capabilities": {
            "type": "object",
            "properties": {
              "canScalePortions": {
                "type": "boolean",
                "description": "Can scale recipe portions"
              },
              "canEditRecipes": {
                "type": "boolean",
                "description": "Can edit recipes"
              },
              "canUseAiEdits": {
                "type": "boolean",
                "description": "Can use AI-powered edits"
              },
              "canCreateRecipes": {
                "type": "boolean",
                "description": "Can create recipes from scratch"
              },
              "canCustomizeRecipeCards": {
                "type": "boolean",
                "description": "Can customize recipe cards"
              },
              "hideBranding": {
                "type": "boolean",
                "description": "Can hide branding"
              },
              "canImportVideos": {
                "type": "boolean",
                "description": "Can import recipes from videos"
              },
              "canUseMealPlanning": {
                "type": "boolean",
                "description": "Can use meal planning"
              },
              "canUseGroceryList": {
                "type": "boolean",
                "description": "Can use shopping list"
              }
            },
            "required": [
              "canScalePortions",
              "canEditRecipes",
              "canUseAiEdits",
              "canCreateRecipes",
              "canCustomizeRecipeCards",
              "hideBranding",
              "canImportVideos",
              "canUseMealPlanning",
              "canUseGroceryList"
            ],
            "additionalProperties": false
          },
          "current": {
            "type": "boolean",
            "description": "Whether this is the current plan"
          },
          "upgrade_plan": {
            "description": "The next plan to upgrade to (only present on current plan if upgrade available)",
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Plan ID (free, premium)"
              },
              "name": {
                "type": "string",
                "description": "Plan display name"
              },
              "description": {
                "type": "string",
                "description": "Plan description"
              },
              "price": {
                "type": "object",
                "properties": {
                  "monthly": {
                    "type": "number",
                    "description": "Monthly price in cents"
                  },
                  "yearly": {
                    "type": "number",
                    "description": "Yearly price in cents"
                  }
                },
                "required": [
                  "monthly",
                  "yearly"
                ],
                "additionalProperties": false
              },
              "features": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PlanFeature"
                },
                "description": "List of plan features"
              },
              "limits": {
                "type": "object",
                "properties": {
                  "maxCollaborators": {
                    "type": "number",
                    "description": "Maximum workspace members"
                  },
                  "maxRecipes": {
                    "type": "number",
                    "description": "Maximum recipes (-1 = unlimited)"
                  },
                  "maxFavorites": {
                    "type": "number",
                    "description": "Maximum favorites (-1 = unlimited)"
                  },
                  "maxCollections": {
                    "type": "number",
                    "description": "Maximum collections (-1 = unlimited)"
                  }
                },
                "required": [
                  "maxCollaborators",
                  "maxRecipes",
                  "maxFavorites",
                  "maxCollections"
                ],
                "additionalProperties": false
              },
              "capabilities": {
                "type": "object",
                "properties": {
                  "canScalePortions": {
                    "type": "boolean",
                    "description": "Can scale recipe portions"
                  },
                  "canEditRecipes": {
                    "type": "boolean",
                    "description": "Can edit recipes"
                  },
                  "canUseAiEdits": {
                    "type": "boolean",
                    "description": "Can use AI-powered edits"
                  },
                  "canCreateRecipes": {
                    "type": "boolean",
                    "description": "Can create recipes from scratch"
                  },
                  "canCustomizeRecipeCards": {
                    "type": "boolean",
                    "description": "Can customize recipe cards"
                  },
                  "hideBranding": {
                    "type": "boolean",
                    "description": "Can hide branding"
                  },
                  "canImportVideos": {
                    "type": "boolean",
                    "description": "Can import recipes from videos"
                  },
                  "canUseMealPlanning": {
                    "type": "boolean",
                    "description": "Can use meal planning"
                  },
                  "canUseGroceryList": {
                    "type": "boolean",
                    "description": "Can use shopping list"
                  }
                },
                "required": [
                  "canScalePortions",
                  "canEditRecipes",
                  "canUseAiEdits",
                  "canCreateRecipes",
                  "canCustomizeRecipeCards",
                  "hideBranding",
                  "canImportVideos",
                  "canUseMealPlanning",
                  "canUseGroceryList"
                ],
                "additionalProperties": false
              },
              "current": {
                "type": "boolean",
                "description": "Whether this is the current plan"
              }
            },
            "required": [
              "id",
              "name",
              "description",
              "price",
              "features",
              "limits",
              "capabilities",
              "current"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "price",
          "features",
          "limits",
          "capabilities",
          "current"
        ],
        "additionalProperties": false
      },
      "PlanFeature": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "Feature title"
          },
          "description": {
            "type": "string",
            "description": "Feature description"
          },
          "sfSymbol": {
            "type": "string",
            "description": "SF Symbol icon name"
          },
          "upsellContext": {
            "description": "Context in which this feature is highlighted as an upsell",
            "type": "string"
          }
        },
        "required": [
          "title",
          "description",
          "sfSymbol"
        ],
        "additionalProperties": false
      },
      "UserInfoWorkspaceSummary": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Workspace ID"
          },
          "name": {
            "type": "string",
            "description": "Workspace name"
          },
          "color": {
            "description": "Owner-picked icon colour (#RRGGBB), or null for the automatic one",
            "type": [
              "string",
              "null"
            ]
          },
          "slug": {
            "type": "string",
            "description": "Workspace URL slug"
          },
          "plan": {
            "type": "string",
            "description": "Subscription plan (free, premium)"
          },
          "locked": {
            "type": "boolean",
            "description": "Whether the workspace is locked due to lapsed subscription"
          },
          "role": {
            "type": "string",
            "description": "User's role in workspace (owner, editor, viewer)"
          },
          "isDefault": {
            "type": "boolean",
            "description": "Whether this is user's default workspace"
          },
          "memberCount": {
            "type": "number",
            "description": "Number of members in workspace"
          },
          "recipeCount": {
            "type": "number",
            "description": "Number of recipes in workspace"
          },
          "ownerName": {
            "type": "string",
            "description": "Name of the workspace owner"
          },
          "ownerImage": {
            "description": "Avatar URL of the workspace owner",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "color",
          "slug",
          "plan",
          "locked",
          "role",
          "isDefault",
          "memberCount",
          "recipeCount",
          "ownerName",
          "ownerImage"
        ],
        "additionalProperties": false
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "description": "Human-readable error (hand-written responses)",
            "type": "string"
          },
          "message": {
            "description": "Human-readable error (OnlyRecipesError responses)",
            "type": "string"
          },
          "code": {
            "description": "Machine-readable error code",
            "type": "string"
          },
          "details": {
            "description": "Validation issues, when the body failed validation"
          }
        },
        "additionalProperties": false
      },
      "UpdateProfileResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "image": {
            "type": [
              "string",
              "null"
            ]
          },
          "recipeUnitDisplayMode": {
            "description": "original, converted, or null when never chosen",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "image",
          "recipeUnitDisplayMode"
        ],
        "additionalProperties": false
      },
      "SuccessResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "success"
        ],
        "additionalProperties": false
      },
      "UserPreferences": {
        "type": "object",
        "properties": {
          "keepScreenAwake": {
            "type": "boolean",
            "description": "Keep the screen awake while viewing recipes"
          },
          "instructionImagesMode": {
            "type": "string",
            "description": "none, thumbnail, or full"
          },
          "showIngredientDescriptions": {
            "type": "boolean",
            "description": "Show ingredient descriptions in recipe view"
          },
          "preferredUnits": {
            "description": "imperial or metric",
            "type": [
              "string",
              "null"
            ]
          },
          "currency": {
            "description": "ISO 4217 currency code",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "keepScreenAwake",
          "instructionImagesMode",
          "showIngredientDescriptions",
          "preferredUnits",
          "currency"
        ],
        "additionalProperties": false
      },
      "ListRecipesResponse": {
        "type": "object",
        "properties": {
          "recipes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkspaceRecipeListItem"
            }
          }
        },
        "required": [
          "recipes"
        ],
        "additionalProperties": false
      },
      "WorkspaceRecipeListItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Recipe ID"
          },
          "name": {
            "type": "string",
            "description": "Recipe name"
          },
          "slug": {
            "description": "URL-friendly slug",
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "coverPhoto": {
            "description": "Cover photo URL",
            "type": [
              "string",
              "null"
            ]
          },
          "coverPhotoBlurHash": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "description": "Personal notes",
            "type": [
              "string",
              "null"
            ]
          },
          "difficulty": {
            "description": "Difficulty rating (0-5)",
            "type": [
              "number",
              "null"
            ]
          },
          "cost": {
            "description": "Estimated cost in cents",
            "type": [
              "number",
              "null"
            ]
          },
          "isPrivate": {
            "type": "boolean"
          },
          "units": {
            "description": "imperial or metric",
            "type": [
              "string",
              "null"
            ]
          },
          "sourceUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "canonicalUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "recipeYield": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RecipeYieldOutput"
              },
              {
                "type": "null"
              }
            ]
          },
          "prepTime": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TimeDuration"
              },
              {
                "type": "null"
              }
            ]
          },
          "cookTime": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TimeDuration"
              },
              {
                "type": "null"
              }
            ]
          },
          "totalTime": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TimeDuration"
              },
              {
                "type": "null"
              }
            ]
          },
          "cuisine": {
            "type": [
              "string",
              "null"
            ]
          },
          "course": {
            "type": [
              "string",
              "null"
            ]
          },
          "keywords": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "authors": {
            "description": "Authors, usually [{ name }]"
          },
          "nutrition": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Nutrition"
              },
              {
                "type": "null"
              }
            ]
          },
          "suitableForDiet": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "images": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RecipeImageOutput"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "rawIngredients": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Ingredient"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "instructionSections": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/InstructionSectionOutput"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "tiktokId": {
            "type": [
              "string",
              "null"
            ]
          },
          "instagramReelId": {
            "type": [
              "string",
              "null"
            ]
          },
          "youtubeShortId": {
            "type": [
              "string",
              "null"
            ]
          },
          "youtubeVideoId": {
            "type": [
              "string",
              "null"
            ]
          },
          "viewCount": {
            "type": "number",
            "description": "Views by workspace members"
          },
          "publicViewCount": {
            "type": "number",
            "description": "Public views"
          },
          "createdAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "string"
              }
            ],
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "string"
              }
            ],
            "type": "string",
            "format": "date-time"
          },
          "importedAt": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "string"
                  }
                ],
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastViewedAt": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "string"
                  }
                ],
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "reimported": {
            "type": "boolean",
            "description": "Recovered by /fix-recipes after a failed import"
          },
          "reimportedAt": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "string"
                  }
                ],
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "reimportedFromImportId": {
            "type": [
              "string",
              "null"
            ]
          },
          "reimportMethod": {
            "type": [
              "string",
              "null"
            ]
          },
          "reimportNoticeDismissedAt": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "string"
                  }
                ],
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "mealSlotId": {
            "description": "Meal type tag",
            "type": [
              "string",
              "null"
            ]
          },
          "createdBy": {
            "description": "User ID of the creator",
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": "string",
            "description": "Public URL of the recipe page"
          },
          "favorited": {
            "type": "boolean",
            "description": "Whether the current user favorited it"
          },
          "caloriesPerServing": {
            "description": "nutrition.calories.amount",
            "type": [
              "number",
              "null"
            ]
          },
          "createdByName": {
            "description": "Creator display name",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "slug",
          "description",
          "coverPhoto",
          "coverPhotoBlurHash",
          "notes",
          "difficulty",
          "cost",
          "isPrivate",
          "units",
          "sourceUrl",
          "canonicalUrl",
          "recipeYield",
          "prepTime",
          "cookTime",
          "totalTime",
          "cuisine",
          "course",
          "keywords",
          "authors",
          "nutrition",
          "suitableForDiet",
          "images",
          "rawIngredients",
          "instructionSections",
          "tiktokId",
          "instagramReelId",
          "youtubeShortId",
          "youtubeVideoId",
          "viewCount",
          "publicViewCount",
          "createdAt",
          "updatedAt",
          "importedAt",
          "lastViewedAt",
          "reimported",
          "reimportedAt",
          "reimportedFromImportId",
          "reimportMethod",
          "reimportNoticeDismissedAt",
          "mealSlotId",
          "createdBy",
          "url",
          "favorited",
          "caloriesPerServing",
          "createdByName"
        ],
        "additionalProperties": false
      },
      "TimeDuration": {
        "type": "object",
        "properties": {
          "isoDuration": {
            "description": "ISO 8601 duration string",
            "type": "string"
          },
          "days": {
            "type": "number"
          },
          "hours": {
            "type": "number"
          },
          "minutes": {
            "type": "number"
          },
          "seconds": {
            "type": "number"
          }
        },
        "additionalProperties": false
      },
      "Nutrition": {
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {},
        "description": "Nutrition facts keyed by nutrient, e.g. { calories: { amount, unit } }"
      },
      "Ingredient": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "description": "Full ingredient description"
          },
          "quantity": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "amount": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "unit": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "unitId": {
                    "type": "string"
                  }
                },
                "additionalProperties": {}
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "description"
        ],
        "additionalProperties": {}
      },
      "RecipeEnvelope": {
        "type": "object",
        "properties": {
          "recipe": {
            "$ref": "#/components/schemas/RecipeRecord"
          }
        },
        "required": [
          "recipe"
        ],
        "additionalProperties": false
      },
      "RecipeRecord": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Recipe ID"
          },
          "name": {
            "type": "string",
            "description": "Recipe name"
          },
          "slug": {
            "description": "URL-friendly slug",
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "coverPhoto": {
            "description": "Cover photo URL",
            "type": [
              "string",
              "null"
            ]
          },
          "coverPhotoBlurHash": {
            "type": [
              "string",
              "null"
            ]
          },
          "notes": {
            "description": "Personal notes",
            "type": [
              "string",
              "null"
            ]
          },
          "difficulty": {
            "description": "Difficulty rating (0-5)",
            "type": [
              "number",
              "null"
            ]
          },
          "cost": {
            "description": "Estimated cost in cents",
            "type": [
              "number",
              "null"
            ]
          },
          "isPrivate": {
            "type": "boolean"
          },
          "units": {
            "description": "imperial or metric",
            "type": [
              "string",
              "null"
            ]
          },
          "sourceUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "canonicalUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "recipeYield": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RecipeYieldOutput"
              },
              {
                "type": "null"
              }
            ]
          },
          "prepTime": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TimeDuration"
              },
              {
                "type": "null"
              }
            ]
          },
          "cookTime": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TimeDuration"
              },
              {
                "type": "null"
              }
            ]
          },
          "totalTime": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TimeDuration"
              },
              {
                "type": "null"
              }
            ]
          },
          "cuisine": {
            "type": [
              "string",
              "null"
            ]
          },
          "course": {
            "type": [
              "string",
              "null"
            ]
          },
          "keywords": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "authors": {
            "description": "Authors, usually [{ name }]"
          },
          "nutrition": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Nutrition"
              },
              {
                "type": "null"
              }
            ]
          },
          "suitableForDiet": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "images": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RecipeImageOutput"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "rawIngredients": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Ingredient"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "instructionSections": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/InstructionSectionOutput"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "tiktokId": {
            "type": [
              "string",
              "null"
            ]
          },
          "instagramReelId": {
            "type": [
              "string",
              "null"
            ]
          },
          "youtubeShortId": {
            "type": [
              "string",
              "null"
            ]
          },
          "youtubeVideoId": {
            "type": [
              "string",
              "null"
            ]
          },
          "viewCount": {
            "type": "number",
            "description": "Views by workspace members"
          },
          "publicViewCount": {
            "type": "number",
            "description": "Public views"
          },
          "createdAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "string"
              }
            ],
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "string"
              }
            ],
            "type": "string",
            "format": "date-time"
          },
          "importedAt": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "string"
                  }
                ],
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastViewedAt": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "string"
                  }
                ],
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "reimported": {
            "type": "boolean",
            "description": "Recovered by /fix-recipes after a failed import"
          },
          "reimportedAt": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "string"
                  }
                ],
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "reimportedFromImportId": {
            "type": [
              "string",
              "null"
            ]
          },
          "reimportMethod": {
            "type": [
              "string",
              "null"
            ]
          },
          "reimportNoticeDismissedAt": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "string"
                  }
                ],
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "mealSlotId": {
            "description": "Meal type tag",
            "type": [
              "string",
              "null"
            ]
          },
          "createdBy": {
            "description": "User ID of the creator",
            "type": [
              "string",
              "null"
            ]
          },
          "workspaceId": {
            "type": [
              "string",
              "null"
            ]
          },
          "originalRecipeId": {
            "description": "Recipe this one was cloned from",
            "type": [
              "string",
              "null"
            ]
          },
          "shareCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "hidden": {
            "type": "boolean"
          },
          "deletedAt": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "string"
                  }
                ],
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "slug",
          "description",
          "coverPhoto",
          "coverPhotoBlurHash",
          "notes",
          "difficulty",
          "cost",
          "isPrivate",
          "units",
          "sourceUrl",
          "canonicalUrl",
          "recipeYield",
          "prepTime",
          "cookTime",
          "totalTime",
          "cuisine",
          "course",
          "keywords",
          "authors",
          "nutrition",
          "suitableForDiet",
          "images",
          "rawIngredients",
          "instructionSections",
          "tiktokId",
          "instagramReelId",
          "youtubeShortId",
          "youtubeVideoId",
          "viewCount",
          "publicViewCount",
          "createdAt",
          "updatedAt",
          "importedAt",
          "lastViewedAt",
          "reimported",
          "reimportedAt",
          "reimportedFromImportId",
          "reimportMethod",
          "reimportNoticeDismissedAt",
          "mealSlotId",
          "createdBy",
          "workspaceId",
          "originalRecipeId",
          "shareCode",
          "hidden",
          "deletedAt"
        ],
        "additionalProperties": {}
      },
      "WorkspaceRecipeDetail": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "ingredients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Ingredient"
            }
          },
          "instructionSections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InstructionSectionOutput"
            }
          },
          "suitableForDiet": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "images": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecipeImageOutput"
            }
          },
          "nutrition": {
            "$ref": "#/components/schemas/Nutrition"
          },
          "keywords": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "authors": {
            "type": "array",
            "items": {}
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "yield": {
            "$ref": "#/components/schemas/RecipeYieldOutput"
          },
          "time": {
            "type": "object",
            "properties": {
              "prep": {
                "$ref": "#/components/schemas/TimeDuration"
              },
              "cook": {
                "$ref": "#/components/schemas/TimeDuration"
              },
              "total": {
                "$ref": "#/components/schemas/TimeDuration"
              }
            },
            "additionalProperties": false
          },
          "datePublished": {
            "type": "string"
          },
          "sourceUrl": {
            "type": "string"
          },
          "coverPhoto": {
            "type": "string"
          },
          "coverPhotoBlurHash": {
            "type": [
              "string",
              "null"
            ]
          },
          "seoContent": {},
          "seoFaqs": {},
          "url": {
            "type": "string"
          },
          "favorited": {
            "type": "boolean"
          },
          "reimported": {
            "type": "boolean"
          },
          "reimportedAt": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "string"
                  }
                ],
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "reimportedFromImportId": {
            "type": [
              "string",
              "null"
            ]
          },
          "reimportMethod": {
            "type": [
              "string",
              "null"
            ]
          },
          "reimportNoticeDismissedAt": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "string"
                  }
                ],
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "ingredients",
          "instructionSections",
          "suitableForDiet",
          "images",
          "keywords",
          "authors",
          "categories",
          "time",
          "url",
          "favorited",
          "reimported",
          "reimportedAt",
          "reimportedFromImportId",
          "reimportMethod",
          "reimportNoticeDismissedAt"
        ],
        "additionalProperties": false
      },
      "UpdateRecipeResponse": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Recipe ID"
              },
              "name": {
                "type": "string",
                "description": "Recipe name"
              },
              "slug": {
                "description": "URL-friendly slug",
                "type": [
                  "string",
                  "null"
                ]
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "coverPhoto": {
                "description": "Cover photo URL",
                "type": [
                  "string",
                  "null"
                ]
              },
              "coverPhotoBlurHash": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "notes": {
                "description": "Personal notes",
                "type": [
                  "string",
                  "null"
                ]
              },
              "difficulty": {
                "description": "Difficulty rating (0-5)",
                "type": [
                  "number",
                  "null"
                ]
              },
              "cost": {
                "description": "Estimated cost in cents",
                "type": [
                  "number",
                  "null"
                ]
              },
              "isPrivate": {
                "type": "boolean"
              },
              "units": {
                "description": "imperial or metric",
                "type": [
                  "string",
                  "null"
                ]
              },
              "sourceUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "canonicalUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "recipeYield": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/RecipeYieldOutput"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "prepTime": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/TimeDuration"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "cookTime": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/TimeDuration"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "totalTime": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/TimeDuration"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "cuisine": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "course": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "keywords": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "authors": {
                "description": "Authors, usually [{ name }]"
              },
              "nutrition": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/Nutrition"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "suitableForDiet": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "images": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/RecipeImageOutput"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "rawIngredients": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/Ingredient"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "instructionSections": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/InstructionSectionOutput"
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "tiktokId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "instagramReelId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "youtubeShortId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "youtubeVideoId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "viewCount": {
                "type": "number",
                "description": "Views by workspace members"
              },
              "publicViewCount": {
                "type": "number",
                "description": "Public views"
              },
              "createdAt": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "string"
                  }
                ],
                "type": "string",
                "format": "date-time"
              },
              "updatedAt": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "string"
                  }
                ],
                "type": "string",
                "format": "date-time"
              },
              "importedAt": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "string",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "lastViewedAt": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "string",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reimported": {
                "type": "boolean",
                "description": "Recovered by /fix-recipes after a failed import"
              },
              "reimportedAt": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "string",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "reimportedFromImportId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "reimportMethod": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "reimportNoticeDismissedAt": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "string",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "mealSlotId": {
                "description": "Meal type tag",
                "type": [
                  "string",
                  "null"
                ]
              },
              "createdBy": {
                "description": "User ID of the creator",
                "type": [
                  "string",
                  "null"
                ]
              },
              "workspaceId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "originalRecipeId": {
                "description": "Recipe this one was cloned from",
                "type": [
                  "string",
                  "null"
                ]
              },
              "shareCode": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "hidden": {
                "type": "boolean"
              },
              "deletedAt": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "string",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "url": {
                "type": "string"
              },
              "favorited": {
                "description": "Present when the body toggled favorited",
                "type": "boolean"
              },
              "cuisineRef": {
                "anyOf": [
                  {},
                  {
                    "type": "null"
                  }
                ],
                "description": "Linked Cuisine row"
              }
            },
            "required": [
              "id",
              "name",
              "slug",
              "description",
              "coverPhoto",
              "coverPhotoBlurHash",
              "notes",
              "difficulty",
              "cost",
              "isPrivate",
              "units",
              "sourceUrl",
              "canonicalUrl",
              "recipeYield",
              "prepTime",
              "cookTime",
              "totalTime",
              "cuisine",
              "course",
              "keywords",
              "authors",
              "nutrition",
              "suitableForDiet",
              "images",
              "rawIngredients",
              "instructionSections",
              "tiktokId",
              "instagramReelId",
              "youtubeShortId",
              "youtubeVideoId",
              "viewCount",
              "publicViewCount",
              "createdAt",
              "updatedAt",
              "importedAt",
              "lastViewedAt",
              "reimported",
              "reimportedAt",
              "reimportedFromImportId",
              "reimportMethod",
              "reimportNoticeDismissedAt",
              "mealSlotId",
              "createdBy",
              "workspaceId",
              "originalRecipeId",
              "shareCode",
              "hidden",
              "deletedAt",
              "url",
              "cuisineRef"
            ],
            "additionalProperties": {}
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "reimportNoticeDismissedAt": {
                "anyOf": [
                  {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "type": "string",
                    "format": "date-time"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "id",
              "reimportNoticeDismissedAt"
            ],
            "additionalProperties": false,
            "description": "Returned when the body only had reimportNoticeDismissed: true"
          }
        ]
      },
      "AiCreatedRecipeResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "const": true
          },
          "recipe": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "slug": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "id",
              "name",
              "slug"
            ],
            "additionalProperties": false
          },
          "remaining": {
            "type": "number",
            "description": "AI imports left in the current rate-limit window"
          }
        },
        "required": [
          "success",
          "recipe",
          "remaining"
        ],
        "additionalProperties": false
      },
      "RecipeAttachment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "recipeId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "altText": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "size": {
            "type": [
              "number",
              "null"
            ]
          },
          "userId": {
            "type": "string"
          },
          "createdAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "string"
              }
            ],
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "string"
              }
            ],
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "recipeId",
          "name",
          "title",
          "altText",
          "url",
          "contentType",
          "size",
          "userId",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "WorkspaceRecipeCommentThread": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "recipeId": {
            "type": "string"
          },
          "authorId": {
            "type": "string"
          },
          "parentId": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "string"
              }
            ],
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "string"
              }
            ],
            "type": "string",
            "format": "date-time"
          },
          "author": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "image": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "handle": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "id",
              "name",
              "image",
              "handle"
            ],
            "additionalProperties": false
          },
          "replies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorkspaceRecipeComment"
            }
          }
        },
        "required": [
          "id",
          "body",
          "recipeId",
          "authorId",
          "parentId",
          "createdAt",
          "updatedAt",
          "author",
          "replies"
        ],
        "additionalProperties": false
      },
      "WorkspaceRecipeComment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "recipeId": {
            "type": "string"
          },
          "authorId": {
            "type": "string"
          },
          "parentId": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "string"
              }
            ],
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "string"
              }
            ],
            "type": "string",
            "format": "date-time"
          },
          "author": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "image": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "handle": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "id",
              "name",
              "image",
              "handle"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "body",
          "recipeId",
          "authorId",
          "parentId",
          "createdAt",
          "updatedAt",
          "author"
        ],
        "additionalProperties": false
      },
      "PublicRecipe": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "ingredients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Ingredient"
            }
          },
          "instructionSections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InstructionSectionOutput"
            }
          },
          "suitableForDiet": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "images": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecipeImageOutput"
            }
          },
          "nutrition": {
            "$ref": "#/components/schemas/Nutrition"
          },
          "keywords": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "authors": {
            "type": "array",
            "items": {}
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "yield": {
            "$ref": "#/components/schemas/RecipeYieldOutput"
          },
          "time": {
            "type": "object",
            "properties": {
              "prep": {
                "$ref": "#/components/schemas/TimeDuration"
              },
              "cook": {
                "$ref": "#/components/schemas/TimeDuration"
              },
              "total": {
                "$ref": "#/components/schemas/TimeDuration"
              }
            },
            "additionalProperties": false
          },
          "datePublished": {
            "type": "string"
          },
          "sourceUrl": {
            "type": "string"
          },
          "coverPhoto": {
            "type": "string"
          },
          "coverPhotoBlurHash": {
            "type": [
              "string",
              "null"
            ]
          },
          "seoContent": {},
          "seoFaqs": {},
          "similarRecipes": {
            "description": "Only with includeSimilar=true",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SimilarRecipe"
            }
          }
        },
        "required": [
          "id",
          "name",
          "ingredients",
          "instructionSections",
          "suitableForDiet",
          "images",
          "keywords",
          "authors",
          "categories",
          "time"
        ],
        "additionalProperties": false
      },
      "SimilarRecipe": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "coverPhoto": {
            "type": [
              "string",
              "null"
            ]
          },
          "coverPhotoBlurHash": {
            "type": [
              "string",
              "null"
            ]
          },
          "prepTime": {},
          "cookTime": {},
          "totalTime": {},
          "recipeYield": {},
          "caloriesPerServing": {
            "type": [
              "number",
              "null"
            ]
          },
          "difficulty": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "description",
          "coverPhoto",
          "coverPhotoBlurHash",
          "prepTime",
          "cookTime",
          "totalTime",
          "recipeYield",
          "caloriesPerServing",
          "difficulty"
        ],
        "additionalProperties": false
      },
      "SimilarRecipeWithRating": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "coverPhoto": {
            "type": [
              "string",
              "null"
            ]
          },
          "coverPhotoBlurHash": {
            "type": [
              "string",
              "null"
            ]
          },
          "prepTime": {},
          "cookTime": {},
          "totalTime": {},
          "recipeYield": {},
          "caloriesPerServing": {
            "type": [
              "number",
              "null"
            ]
          },
          "difficulty": {
            "type": [
              "number",
              "null"
            ]
          },
          "aggregateRating": {
            "type": [
              "number",
              "null"
            ]
          },
          "aggregateRatingCount": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "description",
          "coverPhoto",
          "coverPhotoBlurHash",
          "prepTime",
          "cookTime",
          "totalTime",
          "recipeYield",
          "caloriesPerServing",
          "difficulty",
          "aggregateRating",
          "aggregateRatingCount"
        ],
        "additionalProperties": false
      },
      "Tag": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "keywords": {},
          "hashtags": {},
          "featured": {
            "type": "boolean"
          },
          "public": {
            "type": "boolean"
          },
          "cuisineId": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "string"
              }
            ],
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "string"
              }
            ],
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "title",
          "slug",
          "keywords",
          "hashtags",
          "featured",
          "public",
          "cuisineId",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "RecipeUserState": {
        "type": "object",
        "properties": {
          "signedIn": {
            "type": "boolean"
          },
          "admin": {
            "type": "boolean"
          },
          "saved": {
            "type": "boolean",
            "description": "Whether the user has a copy in one of their kitchens"
          },
          "workspaceSlug": {
            "type": [
              "string",
              "null"
            ]
          },
          "keepScreenAwake": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "instructionImagesMode": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "none",
                  "thumbnail",
                  "full"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "showIngredientDescriptions": {
            "type": [
              "boolean",
              "null"
            ]
          }
        },
        "required": [
          "signedIn",
          "admin",
          "saved",
          "workspaceSlug",
          "keepScreenAwake",
          "instructionImagesMode",
          "showIngredientDescriptions"
        ],
        "additionalProperties": false
      },
      "PublicReview": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "rating": {
            "type": "number"
          },
          "review": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "string"
              }
            ],
            "type": "string",
            "format": "date-time"
          },
          "user": {
            "type": "object",
            "properties": {
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "image": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "name",
              "image"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "rating",
          "review",
          "createdAt",
          "user"
        ],
        "additionalProperties": false
      },
      "InvitationsListResponse": {
        "type": "object",
        "properties": {
          "seats": {
            "$ref": "#/components/schemas/InviteSeats"
          },
          "invitations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OwnerInvitation"
            },
            "description": "Pending invites, newest first. Empty for non-owners."
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KitchenMember"
            }
          }
        },
        "required": [
          "seats",
          "invitations",
          "members"
        ],
        "additionalProperties": false
      },
      "InviteSeats": {
        "type": "object",
        "properties": {
          "seatsTotal": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Seats for cooks other than the owner (free 0, or 1 with the free view-only seat; premium 1)"
          },
          "seatsUsed": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Members other than the owner"
          },
          "seatsPending": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Pending, unexpired invites; each holds a seat"
          },
          "seatsAvailable": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "viewerOnlySeats": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Seats only a viewer can take (free view-only invite)"
          },
          "canInvite": {
            "type": "boolean",
            "description": "Owner can create an invite now (any role)"
          },
          "canInviteEditor": {
            "type": "boolean",
            "description": "Owner can create a Can edit invite now. Always false on free."
          },
          "canInviteViewer": {
            "type": "boolean"
          },
          "isPremium": {
            "type": "boolean"
          },
          "isOwner": {
            "type": "boolean"
          },
          "freeViewerInviteEnabled": {
            "type": "boolean",
            "description": "The \"free-viewer-invite\" flag"
          },
          "invitesCreatedToday": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "maxInvitesPerDay": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "dailyLimitReached": {
            "type": "boolean"
          }
        },
        "required": [
          "seatsTotal",
          "seatsUsed",
          "seatsPending",
          "seatsAvailable",
          "viewerOnlySeats",
          "canInvite",
          "canInviteEditor",
          "canInviteViewer",
          "isPremium",
          "isOwner",
          "freeViewerInviteEnabled",
          "invitesCreatedToday",
          "maxInvitesPerDay",
          "dailyLimitReached"
        ],
        "additionalProperties": false
      },
      "OwnerInvitation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "code": {
            "description": "Stored form \"K7M4QX\"; null on invites created before codes",
            "type": [
              "string",
              "null"
            ]
          },
          "codeDisplay": {
            "description": "\"K7M·4QX\"",
            "type": [
              "string",
              "null"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "email",
              "link"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "role": {
            "type": "string",
            "enum": [
              "editor",
              "viewer"
            ],
            "description": "editor = Can edit, viewer = Can view"
          },
          "roleLabel": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "inviteUrl": {
            "type": "string",
            "description": "https://onlyrecipes.app/invite/{id}; /invite/{code} also works"
          },
          "canResend": {
            "type": "boolean",
            "description": "Email invites only"
          },
          "expired": {
            "type": "boolean",
            "description": "Pending but past expiresAt; listed for 7 days so the owner can renew"
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "string"
              }
            ],
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "string"
              }
            ],
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "code",
          "codeDisplay",
          "kind",
          "email",
          "label",
          "role",
          "roleLabel",
          "status",
          "inviteUrl",
          "canResend",
          "expired",
          "expiresAt",
          "createdAt"
        ],
        "additionalProperties": false
      },
      "KitchenMember": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "User id"
          },
          "workspaceUserId": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "description": "Only shown to the owner (and yourself)",
            "type": [
              "string",
              "null"
            ]
          },
          "image": {
            "type": [
              "string",
              "null"
            ]
          },
          "role": {
            "type": "string"
          },
          "isOwner": {
            "type": "boolean"
          },
          "isYou": {
            "type": "boolean"
          },
          "joinedAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "string"
              }
            ],
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "workspaceUserId",
          "name",
          "email",
          "image",
          "role",
          "isOwner",
          "isYou",
          "joinedAt"
        ],
        "additionalProperties": false
      },
      "CreateInvitationResponse": {
        "type": "object",
        "properties": {
          "invitation": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "code": {
                "description": "Stored form \"K7M4QX\"; null on invites created before codes",
                "type": [
                  "string",
                  "null"
                ]
              },
              "codeDisplay": {
                "description": "\"K7M·4QX\"",
                "type": [
                  "string",
                  "null"
                ]
              },
              "kind": {
                "type": "string",
                "enum": [
                  "email",
                  "link"
                ]
              },
              "email": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "label": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "role": {
                "type": "string",
                "enum": [
                  "editor",
                  "viewer"
                ],
                "description": "editor = Can edit, viewer = Can view"
              },
              "roleLabel": {
                "type": "string"
              },
              "status": {
                "type": "string"
              },
              "inviteUrl": {
                "type": "string",
                "description": "https://onlyrecipes.app/invite/{id}; /invite/{code} also works"
              },
              "canResend": {
                "type": "boolean",
                "description": "Email invites only"
              },
              "expired": {
                "type": "boolean",
                "description": "Pending but past expiresAt; listed for 7 days so the owner can renew"
              },
              "expiresAt": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "string"
                  }
                ],
                "type": "string",
                "format": "date-time"
              },
              "createdAt": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "string"
                  }
                ],
                "type": "string",
                "format": "date-time"
              },
              "workspaceId": {
                "type": "string"
              },
              "workspaceName": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "code",
              "codeDisplay",
              "kind",
              "email",
              "label",
              "role",
              "roleLabel",
              "status",
              "inviteUrl",
              "canResend",
              "expired",
              "expiresAt",
              "createdAt",
              "workspaceId",
              "workspaceName"
            ],
            "additionalProperties": false
          },
          "emailSent": {
            "type": "boolean"
          },
          "seats": {
            "$ref": "#/components/schemas/InviteSeats"
          }
        },
        "required": [
          "invitation",
          "emailSent",
          "seats"
        ],
        "additionalProperties": false
      },
      "CancelInvitationResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "const": true
          },
          "seats": {
            "$ref": "#/components/schemas/InviteSeats"
          }
        },
        "required": [
          "success",
          "seats"
        ],
        "additionalProperties": false
      },
      "ResendInvitationResponse": {
        "type": "object",
        "properties": {
          "invitation": {
            "$ref": "#/components/schemas/OwnerInvitation"
          },
          "emailSent": {
            "type": "boolean"
          }
        },
        "required": [
          "invitation",
          "emailSent"
        ],
        "additionalProperties": false
      },
      "InvitePreviewResponse": {
        "type": "object",
        "properties": {
          "invitation": {
            "$ref": "#/components/schemas/InvitePreview"
          }
        },
        "required": [
          "invitation"
        ],
        "additionalProperties": false
      },
      "InvitePreview": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "code": {
            "type": [
              "string",
              "null"
            ]
          },
          "codeDisplay": {
            "type": [
              "string",
              "null"
            ]
          },
          "workspaceId": {
            "type": "string"
          },
          "workspaceName": {
            "type": "string"
          },
          "ownerName": {
            "type": [
              "string",
              "null"
            ]
          },
          "ownerFirstName": {
            "type": "string"
          },
          "ownerImage": {
            "type": [
              "string",
              "null"
            ]
          },
          "recipeCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "memberCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "role": {
            "type": "string",
            "enum": [
              "editor",
              "viewer"
            ],
            "description": "editor = Can edit, viewer = Can view"
          },
          "roleLabel": {
            "type": "string"
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "emailLocked": {
            "type": "boolean",
            "description": "Only the invited email address can accept"
          },
          "coveredByPremium": {
            "type": "boolean",
            "description": "The kitchen is Premium, so the cook won't need to pay"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "expired",
              "accepted",
              "cancelled"
            ]
          },
          "expired": {
            "type": "boolean"
          },
          "usable": {
            "type": "boolean"
          },
          "message": {
            "description": "\"This invite expired. Ask Ian for a new code.\" when not usable",
            "type": [
              "string",
              "null"
            ]
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "string"
              }
            ],
            "type": "string",
            "format": "date-time"
          },
          "workspaceOwnerName": {
            "type": "string",
            "description": "Deprecated, for older app builds"
          },
          "invitedBy": {
            "type": "string",
            "description": "Deprecated, for older app builds"
          }
        },
        "required": [
          "id",
          "code",
          "codeDisplay",
          "workspaceId",
          "workspaceName",
          "ownerName",
          "ownerFirstName",
          "ownerImage",
          "recipeCount",
          "memberCount",
          "role",
          "roleLabel",
          "label",
          "emailLocked",
          "coveredByPremium",
          "status",
          "expired",
          "usable",
          "message",
          "expiresAt",
          "workspaceOwnerName",
          "invitedBy"
        ],
        "additionalProperties": false
      },
      "InviteUnusableResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "enum": [
              "invite_expired",
              "invite_used",
              "invite_cancelled"
            ]
          },
          "message": {
            "type": "string"
          },
          "ownerFirstName": {
            "type": "string"
          },
          "invitation": {
            "$ref": "#/components/schemas/InvitePreview"
          }
        },
        "required": [
          "error",
          "code",
          "message",
          "ownerFirstName",
          "invitation"
        ],
        "additionalProperties": false
      },
      "AcceptInvitationResponse": {
        "type": "object",
        "properties": {
          "alreadyMember": {
            "type": "boolean"
          },
          "workspace": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "slug": {
                "type": "string"
              },
              "role": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name",
              "slug",
              "role"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "workspace"
        ],
        "additionalProperties": false
      },
      "OnboardingPreferencesResponse": {
        "type": "object",
        "properties": {
          "preferences": {
            "$ref": "#/components/schemas/OnboardingPreferences"
          }
        },
        "required": [
          "preferences"
        ],
        "additionalProperties": false
      },
      "OnboardingPreferences": {
        "type": "object",
        "properties": {
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "\"What brings you here\" option ids"
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Where they find recipes, option ids"
          },
          "dietary": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Dietary restriction ids: vegetarian, vegan, gluten-free, dairy-free, keto, pescatarian"
          },
          "favoriteCuisines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "slug": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "slug",
                "name"
              ],
              "additionalProperties": false
            },
            "description": "In the order picked"
          },
          "cookWithSomeone": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "updatedAt": {
            "description": "ISO time of the last save, null if never saved",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "reasons",
          "sources",
          "dietary",
          "favoriteCuisines",
          "cookWithSomeone",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "OnboardingCuisinesResponse": {
        "type": "object",
        "properties": {
          "cuisines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OnboardingCuisine"
            }
          }
        },
        "required": [
          "cuisines"
        ],
        "additionalProperties": false
      },
      "OnboardingCuisine": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "emoji": {
            "type": [
              "string",
              "null"
            ]
          },
          "imageUrl": {
            "description": "Cover photo of the cuisine's most saved recipe",
            "type": [
              "string",
              "null"
            ]
          },
          "recipeCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Public recipes in this cuisine"
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "emoji",
          "imageUrl",
          "recipeCount"
        ],
        "additionalProperties": false
      },
      "RecommendedRecipesResponse": {
        "type": "object",
        "properties": {
          "recipes": {
            "type": "array",
            "items": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {}
            },
            "description": "Explore recipe cards (same shape as /v1/explore)"
          },
          "source": {
            "type": "string",
            "enum": [
              "cuisines",
              "mixed",
              "trending"
            ]
          },
          "dietaryRelaxed": {
            "type": "boolean",
            "description": "Unfiltered recipes were added because too few met the dietary filter"
          }
        },
        "required": [
          "recipes",
          "source",
          "dietaryRelaxed"
        ],
        "additionalProperties": false
      },
      "RecipeYieldOutput": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number",
            "description": "Yield amount"
          },
          "unit": {
            "type": "string",
            "description": "Yield unit (e.g., 'servings', 'cookies')"
          }
        },
        "required": [
          "amount",
          "unit"
        ],
        "additionalProperties": false
      },
      "RecipeImageOutput": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Image URL"
          },
          "width": {
            "description": "Image width in pixels",
            "type": "number"
          },
          "height": {
            "description": "Image height in pixels",
            "type": "number"
          }
        },
        "required": [
          "url"
        ],
        "additionalProperties": false
      },
      "InstructionSectionOutput": {
        "type": "object",
        "properties": {
          "name": {
            "description": "Section name (e.g., 'For the sauce')",
            "type": "string"
          },
          "instructions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InstructionOutput"
            },
            "description": "List of instructions"
          }
        },
        "required": [
          "instructions"
        ],
        "additionalProperties": false
      },
      "InstructionOutput": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "description": "Instruction text"
          },
          "name": {
            "description": "Instruction step name",
            "type": "string"
          },
          "url": {
            "description": "Optional URL reference",
            "type": "string"
          },
          "images": {
            "description": "Step images",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecipeImageOutput"
            }
          }
        },
        "required": [
          "text"
        ],
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Firebase ID token (mobile) or a session-derived token. Web requests may use the session cookie instead."
      }
    }
  }
}
