{
  "openapi": "3.1.1",
  "info": {
    "title": "CapWorks Better Auth API",
    "description": "由 CapWorks 使用的 Better Auth 配置自动生成；包含 Google OAuth、Email OTP 和会话管理。",
    "version": "1.0.0"
  },
  "components": {
    "schemas": {
      "User": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "readOnly": true
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "emailVerified": {
            "type": "boolean",
            "default": false,
            "readOnly": true
          },
          "image": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "email",
          "emailVerified",
          "createdAt",
          "updatedAt"
        ]
      },
      "Session": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "readOnly": true
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "token": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "ipAddress": {
            "type": "string"
          },
          "userAgent": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "expiresAt",
          "token",
          "createdAt",
          "updatedAt",
          "userId"
        ]
      },
      "Account": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "readOnly": true
          },
          "issuer": {
            "type": "string"
          },
          "accountId": {
            "type": "string"
          },
          "providerId": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "accessToken": {
            "type": "string"
          },
          "refreshToken": {
            "type": "string"
          },
          "idToken": {
            "type": "string"
          },
          "accessTokenExpiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "refreshTokenExpiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "scope": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "issuer",
          "accountId",
          "providerId",
          "userId",
          "createdAt",
          "updatedAt"
        ]
      },
      "Verification": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "readOnly": true
          },
          "identifier": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "identifier",
          "value",
          "expiresAt",
          "createdAt",
          "updatedAt"
        ]
      }
    },
    "securitySchemes": {
      "apiKeyCookie": {
        "type": "apiKey",
        "in": "cookie",
        "name": "apiKeyCookie",
        "description": "API Key authentication via cookie"
      },
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Bearer token authentication"
      }
    }
  },
  "security": [
    {
      "apiKeyCookie": [],
      "bearerAuth": []
    }
  ],
  "servers": [
    {
      "url": "https://capworks-api-docs.pages.dev/proxy/capworks",
      "description": "文档站同源代理"
    },
    {
      "url": "http://localhost:8787",
      "description": "本地开发"
    }
  ],
  "tags": [
    {
      "name": "Default",
      "description": "Default endpoints that are included with Better Auth by default. These endpoints are not part of any plugin."
    }
  ],
  "paths": {
    "/api/auth/sign-in/social": {
      "post": {
        "tags": [
          "Default"
        ],
        "description": "Sign in with a social provider",
        "operationId": "socialSignIn",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "callbackURL": {
                    "type": "string",
                    "description": "Callback URL to redirect to after the user has signed in"
                  },
                  "newUserCallbackURL": {
                    "type": "string"
                  },
                  "errorCallbackURL": {
                    "type": "string",
                    "description": "Callback URL to redirect to if an error happens"
                  },
                  "provider": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "apple",
                          "atlassian",
                          "cognito",
                          "discord",
                          "facebook",
                          "figma",
                          "github",
                          "microsoft",
                          "google",
                          "huggingface",
                          "slack",
                          "spotify",
                          "twitch",
                          "twitter",
                          "dropbox",
                          "kick",
                          "linear",
                          "linkedin",
                          "gitlab",
                          "tiktok",
                          "reddit",
                          "roblox",
                          "salesforce",
                          "vk",
                          "zoom",
                          "notion",
                          "kakao",
                          "naver",
                          "line",
                          "paybin",
                          "paypal",
                          "polar",
                          "railway",
                          "vercel",
                          "wechat"
                        ]
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "disableRedirect": {
                    "type": "boolean",
                    "description": "Disable automatic redirection to the provider. Useful for handling the redirection yourself"
                  },
                  "idToken": {
                    "type": "object",
                    "properties": {
                      "token": {
                        "type": "string",
                        "description": "ID token from the provider"
                      },
                      "nonce": {
                        "type": "string",
                        "description": "Nonce used to generate the token"
                      },
                      "accessToken": {
                        "type": "string",
                        "description": "Access token from the provider"
                      },
                      "refreshToken": {
                        "type": "string",
                        "description": "Refresh token from the provider"
                      },
                      "expiresAt": {
                        "type": "number",
                        "description": "Expiry date of the token"
                      },
                      "user": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "object",
                            "properties": {
                              "firstName": {
                                "type": "string"
                              },
                              "lastName": {
                                "type": "string"
                              }
                            }
                          },
                          "email": {
                            "type": "string"
                          }
                        },
                        "description": "The user object from the provider. Only available for some providers like Apple."
                      }
                    },
                    "required": [
                      "token"
                    ]
                  },
                  "scopes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Array of scopes to request from the provider. This will override the default scopes passed."
                  },
                  "requestSignUp": {
                    "type": "boolean",
                    "description": "Explicitly request sign-up. Useful when disableImplicitSignUp is true for this provider"
                  },
                  "loginHint": {
                    "type": "string",
                    "description": "The login hint to use for the authorization code request"
                  },
                  "additionalParams": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Extra query parameters to append to the provider authorization URL (e.g. Cognito identity_provider, Google hd)."
                  },
                  "additionalData": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  }
                },
                "required": [
                  "provider"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success - Returns session details (idToken branch) or an authorize URL (redirect branch)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Returns session details when idToken is provided, or an authorize URL otherwise",
                  "properties": {
                    "token": {
                      "type": "string"
                    },
                    "user": {
                      "type": "object",
                      "$ref": "#/components/schemas/User"
                    },
                    "url": {
                      "type": "string"
                    },
                    "redirect": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "redirect"
                  ]
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/callback/{id}": {
      "get": {
        "tags": [
          "Default"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      },
      "post": {
        "tags": [
          "Default"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "error": {
                    "type": "string"
                  },
                  "device_id": {
                    "type": "string"
                  },
                  "error_description": {
                    "type": "string"
                  },
                  "state": {
                    "type": "string"
                  },
                  "user": {
                    "type": "string"
                  },
                  "iss": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/get-session": {
      "get": {
        "tags": [
          "Default"
        ],
        "description": "Get the current session",
        "operationId": "getSession",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "session": {
                      "$ref": "#/components/schemas/Session"
                    },
                    "user": {
                      "$ref": "#/components/schemas/User"
                    }
                  },
                  "required": [
                    "session",
                    "user"
                  ]
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      },
      "post": {
        "tags": [
          "Default"
        ],
        "description": "Get the current session",
        "operationId": "getSessionPost",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "session": {
                      "$ref": "#/components/schemas/Session"
                    },
                    "user": {
                      "$ref": "#/components/schemas/User"
                    }
                  },
                  "required": [
                    "session",
                    "user"
                  ]
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/sign-out": {
      "post": {
        "tags": [
          "Default"
        ],
        "description": "Sign out the current user",
        "operationId": "signOut",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "callbackURL": {
                    "type": "string",
                    "description": "The URL to redirect to after provider logout"
                  },
                  "disableRedirect": {
                    "type": "boolean",
                    "description": "Return the provider logout URL without redirecting"
                  },
                  "state": {
                    "type": "string",
                    "description": "State to pass to the provider logout endpoint"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "url": {
                      "type": "string",
                      "description": "Provider logout URL when RP-initiated logout is available"
                    },
                    "redirect": {
                      "type": "boolean",
                      "description": "Whether the client should redirect to the provider logout URL"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/sign-up/email": {
      "post": {
        "tags": [
          "Default"
        ],
        "description": "Sign up a user using email and password",
        "operationId": "signUpWithEmailAndPassword",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The name of the user"
                  },
                  "email": {
                    "type": "string",
                    "description": "The email of the user"
                  },
                  "password": {
                    "type": "string",
                    "description": "The password of the user"
                  },
                  "image": {
                    "type": "string",
                    "description": "The profile image URL of the user"
                  },
                  "callbackURL": {
                    "type": "string",
                    "description": "The URL to use for email verification callback"
                  },
                  "rememberMe": {
                    "type": "boolean",
                    "description": "If this is false, the session will not be remembered. Default is `true`."
                  }
                },
                "required": [
                  "name",
                  "email",
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully created user",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string",
                      "nullable": true,
                      "description": "Authentication token for the session"
                    },
                    "user": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "The unique identifier of the user"
                        },
                        "email": {
                          "type": "string",
                          "format": "email",
                          "description": "The email address of the user"
                        },
                        "name": {
                          "type": "string",
                          "description": "The name of the user"
                        },
                        "image": {
                          "type": "string",
                          "format": "uri",
                          "nullable": true,
                          "description": "The profile image URL of the user"
                        },
                        "emailVerified": {
                          "type": "boolean",
                          "description": "Whether the email has been verified"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time",
                          "description": "When the user was created"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time",
                          "description": "When the user was last updated"
                        }
                      },
                      "required": [
                        "id",
                        "email",
                        "name",
                        "emailVerified",
                        "createdAt",
                        "updatedAt"
                      ]
                    }
                  },
                  "required": [
                    "user"
                  ]
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "422": {
            "description": "Unprocessable Entity. User already exists or failed to create user.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/sign-in/email": {
      "post": {
        "tags": [
          "Default"
        ],
        "description": "Sign in with email and password",
        "operationId": "signInEmail",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "Email of the user"
                  },
                  "password": {
                    "type": "string",
                    "description": "Password of the user"
                  },
                  "callbackURL": {
                    "type": "string",
                    "description": "Callback URL to use as a redirect for email verification"
                  },
                  "rememberMe": {
                    "type": "boolean",
                    "description": "If this is false, the session will not be remembered. Default is `true`."
                  }
                },
                "required": [
                  "email",
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success - Returns either session details or redirect URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Session response when idToken is provided",
                  "properties": {
                    "redirect": {
                      "type": "boolean",
                      "enum": [
                        false
                      ]
                    },
                    "token": {
                      "type": "string",
                      "description": "Session token"
                    },
                    "url": {
                      "type": "string",
                      "nullable": true
                    },
                    "user": {
                      "type": "object",
                      "$ref": "#/components/schemas/User"
                    }
                  },
                  "required": [
                    "redirect",
                    "token",
                    "user"
                  ]
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/reset-password": {
      "post": {
        "tags": [
          "Default"
        ],
        "description": "Reset the password for a user",
        "operationId": "resetPassword",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "newPassword": {
                    "type": "string",
                    "description": "The new password to set"
                  },
                  "token": {
                    "type": "string",
                    "description": "The token to reset the password"
                  }
                },
                "required": [
                  "newPassword"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/verify-password": {
      "post": {
        "tags": [
          "Default"
        ],
        "description": "Verify the current user's password",
        "operationId": "verifyPassword",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "password": {
                    "type": "string",
                    "description": "The password to verify"
                  }
                },
                "required": [
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/verify-email": {
      "get": {
        "tags": [
          "Default"
        ],
        "description": "Verify the email of the user",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "description": "The token to verify the email",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "callbackURL",
            "in": "query",
            "description": "The URL to redirect to after email verification",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user": {
                      "type": "object",
                      "$ref": "#/components/schemas/User"
                    },
                    "status": {
                      "type": "boolean",
                      "description": "Indicates if the email was verified successfully"
                    }
                  },
                  "required": [
                    "user",
                    "status"
                  ]
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/send-verification-email": {
      "post": {
        "tags": [
          "Default"
        ],
        "description": "Send a verification email to the user",
        "operationId": "sendVerificationEmail",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "The email to send the verification email to",
                    "example": "user@example.com"
                  },
                  "callbackURL": {
                    "type": "string",
                    "description": "The URL to use for email verification callback",
                    "example": "https://example.com/callback",
                    "nullable": true
                  }
                },
                "required": [
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "description": "Indicates if the email was sent successfully",
                      "example": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "Error message",
                      "example": "Verification email isn't enabled"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/change-email": {
      "post": {
        "tags": [
          "Default"
        ],
        "operationId": "changeEmail",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "newEmail": {
                    "type": "string",
                    "description": "The new email address to set must be a valid email address"
                  },
                  "callbackURL": {
                    "type": "string",
                    "description": "The URL to redirect to after email verification"
                  }
                },
                "required": [
                  "newEmail"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email change request processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user": {
                      "type": "object",
                      "$ref": "#/components/schemas/User"
                    },
                    "status": {
                      "type": "boolean",
                      "description": "Indicates if the request was successful"
                    },
                    "message": {
                      "type": "string",
                      "enum": [
                        "Email updated",
                        "Verification email sent"
                      ],
                      "description": "Status message of the email change process",
                      "nullable": true
                    }
                  },
                  "required": [
                    "status"
                  ]
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/change-password": {
      "post": {
        "tags": [
          "Default"
        ],
        "description": "Change the password of the user",
        "operationId": "changePassword",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "newPassword": {
                    "type": "string",
                    "description": "The new password to set"
                  },
                  "currentPassword": {
                    "type": "string",
                    "description": "The current password is required"
                  },
                  "revokeOtherSessions": {
                    "type": "boolean",
                    "description": "Must be a boolean value"
                  }
                },
                "required": [
                  "newPassword",
                  "currentPassword"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Password successfully changed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string",
                      "nullable": true,
                      "description": "New session token if other sessions were revoked"
                    },
                    "user": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "The unique identifier of the user"
                        },
                        "email": {
                          "type": "string",
                          "format": "email",
                          "description": "The email address of the user"
                        },
                        "name": {
                          "type": "string",
                          "description": "The name of the user"
                        },
                        "image": {
                          "type": "string",
                          "format": "uri",
                          "nullable": true,
                          "description": "The profile image URL of the user"
                        },
                        "emailVerified": {
                          "type": "boolean",
                          "description": "Whether the email has been verified"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time",
                          "description": "When the user was created"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time",
                          "description": "When the user was last updated"
                        }
                      },
                      "required": [
                        "id",
                        "email",
                        "name",
                        "emailVerified",
                        "createdAt",
                        "updatedAt"
                      ]
                    }
                  },
                  "required": [
                    "user"
                  ]
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/update-session": {
      "post": {
        "tags": [
          "Default"
        ],
        "description": "Update the current session",
        "operationId": "updateSession",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "propertyNames": {
                  "type": "string",
                  "description": "Field name must be a string"
                },
                "additionalProperties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "session": {
                      "type": "object",
                      "$ref": "#/components/schemas/Session"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/update-user": {
      "post": {
        "tags": [
          "Default"
        ],
        "description": "Update the current user",
        "operationId": "updateUser",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "The name of the user"
                  },
                  "image": {
                    "type": "string",
                    "description": "The image of the user",
                    "nullable": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user": {
                      "type": "object",
                      "$ref": "#/components/schemas/User"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/delete-user": {
      "post": {
        "tags": [
          "Default"
        ],
        "description": "Delete the user",
        "operationId": "deleteUser",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "callbackURL": {
                    "type": "string",
                    "description": "The callback URL to redirect to after the user is deleted"
                  },
                  "password": {
                    "type": "string",
                    "description": "The user's password. Required if session is not fresh"
                  },
                  "token": {
                    "type": "string",
                    "description": "The deletion verification token"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "User deletion processed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Indicates if the operation was successful"
                    },
                    "message": {
                      "type": "string",
                      "enum": [
                        "User deleted",
                        "Verification email sent"
                      ],
                      "description": "Status message of the deletion process"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/request-password-reset": {
      "post": {
        "tags": [
          "Default"
        ],
        "description": "Send a password reset email to the user",
        "operationId": "requestPasswordReset",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "The email address of the user to send a password reset email to"
                  },
                  "redirectTo": {
                    "type": "string",
                    "description": "The URL to redirect the user to reset their password. If the token isn't valid or expired, it'll be redirected with a query parameter `?error=INVALID_TOKEN`. If the token is valid, it'll be redirected with a query parameter `?token=VALID_TOKEN"
                  }
                },
                "required": [
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/reset-password/{token}": {
      "get": {
        "tags": [
          "Default"
        ],
        "description": "Redirects the user to the callback URL with the token",
        "operationId": "resetPasswordCallback",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "description": "The token to reset the password",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "callbackURL",
            "in": "query",
            "required": true,
            "description": "The URL to redirect the user to reset their password",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/list-sessions": {
      "get": {
        "tags": [
          "Default"
        ],
        "description": "List all active sessions for the user",
        "operationId": "listUserSessions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Session"
                  }
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/revoke-session": {
      "post": {
        "tags": [
          "Default"
        ],
        "description": "Revoke a single session",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "description": "The token to revoke"
                  }
                },
                "required": [
                  "token"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "description": "Indicates if the session was revoked successfully"
                    }
                  },
                  "required": [
                    "status"
                  ]
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/revoke-sessions": {
      "post": {
        "tags": [
          "Default"
        ],
        "description": "Revoke all sessions for the user",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "description": "Indicates if all sessions were revoked successfully"
                    }
                  },
                  "required": [
                    "status"
                  ]
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/revoke-other-sessions": {
      "post": {
        "tags": [
          "Default"
        ],
        "description": "Revoke all other sessions for the user except the current one",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "description": "Indicates if all other sessions were revoked successfully"
                    }
                  },
                  "required": [
                    "status"
                  ]
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/link-social": {
      "post": {
        "tags": [
          "Default"
        ],
        "description": "Link a social account to the user",
        "operationId": "linkSocialAccount",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "callbackURL": {
                    "type": "string",
                    "description": "The URL to redirect to after the user has signed in"
                  },
                  "provider": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "apple",
                          "atlassian",
                          "cognito",
                          "discord",
                          "facebook",
                          "figma",
                          "github",
                          "microsoft",
                          "google",
                          "huggingface",
                          "slack",
                          "spotify",
                          "twitch",
                          "twitter",
                          "dropbox",
                          "kick",
                          "linear",
                          "linkedin",
                          "gitlab",
                          "tiktok",
                          "reddit",
                          "roblox",
                          "salesforce",
                          "vk",
                          "zoom",
                          "notion",
                          "kakao",
                          "naver",
                          "line",
                          "paybin",
                          "paypal",
                          "polar",
                          "railway",
                          "vercel",
                          "wechat"
                        ]
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "idToken": {
                    "type": "object",
                    "properties": {
                      "token": {
                        "type": "string"
                      },
                      "nonce": {
                        "type": "string"
                      },
                      "accessToken": {
                        "type": "string"
                      },
                      "refreshToken": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "token"
                    ]
                  },
                  "requestSignUp": {
                    "type": "boolean"
                  },
                  "scopes": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Additional scopes to request from the provider"
                  },
                  "errorCallbackURL": {
                    "type": "string",
                    "description": "The URL to redirect to if there is an error during the link process"
                  },
                  "disableRedirect": {
                    "type": "boolean",
                    "description": "Disable automatic redirection to the provider. Useful for handling the redirection yourself"
                  },
                  "loginHint": {
                    "type": "string",
                    "description": "The login hint to use for the authorization code request"
                  },
                  "additionalParams": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Extra query parameters to append to the provider authorization URL (e.g. Cognito identity_provider, Google hd)."
                  },
                  "additionalData": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  }
                },
                "required": [
                  "provider"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "description": "The authorization URL to redirect the user to"
                    },
                    "redirect": {
                      "type": "boolean",
                      "description": "Indicates if the user should be redirected to the authorization URL"
                    },
                    "status": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "redirect"
                  ]
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/list-accounts": {
      "get": {
        "tags": [
          "Default"
        ],
        "description": "List all accounts linked to the user",
        "operationId": "listUserAccounts",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "providerId": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "updatedAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "issuer": {
                        "type": "string"
                      },
                      "accountId": {
                        "type": "string"
                      },
                      "userId": {
                        "type": "string"
                      },
                      "scopes": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "required": [
                      "id",
                      "providerId",
                      "createdAt",
                      "updatedAt",
                      "issuer",
                      "accountId",
                      "userId",
                      "scopes"
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/delete-user/callback": {
      "get": {
        "tags": [
          "Default"
        ],
        "description": "Callback to complete user deletion with verification token",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "The token to verify the deletion request"
            }
          },
          {
            "name": "callbackURL",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "The URL to redirect to after deletion"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "User successfully deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Indicates if the deletion was successful"
                    },
                    "message": {
                      "type": "string",
                      "enum": [
                        "User deleted"
                      ],
                      "description": "Confirmation message"
                    }
                  },
                  "required": [
                    "success",
                    "message"
                  ]
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/unlink-account": {
      "post": {
        "tags": [
          "Default"
        ],
        "description": "Unlink an account",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "accountId": {
                    "type": "string",
                    "description": "The Better Auth account ID to unlink"
                  }
                },
                "required": [
                  "accountId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/refresh-token": {
      "post": {
        "tags": [
          "Default"
        ],
        "description": "Refresh the access token using a refresh token",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "accountId": {
                        "type": "string",
                        "description": "The Better Auth account ID"
                      },
                      "userId": {
                        "type": "string",
                        "description": "The user ID associated with the account"
                      }
                    },
                    "required": [
                      "accountId"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "useAccountCookie": {
                        "enum": [
                          true
                        ],
                        "description": "Select the current OAuth account from its signed cookie"
                      },
                      "userId": {
                        "type": "string",
                        "description": "The user ID associated with the account"
                      }
                    },
                    "required": [
                      "useAccountCookie"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Access token refreshed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tokenType": {
                      "type": "string"
                    },
                    "idToken": {
                      "type": "string"
                    },
                    "accessToken": {
                      "type": "string"
                    },
                    "refreshToken": {
                      "type": "string"
                    },
                    "accessTokenExpiresAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "refreshTokenExpiresAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid refresh token or provider configuration"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/get-access-token": {
      "post": {
        "tags": [
          "Default"
        ],
        "description": "Get a valid access token, doing a refresh if needed",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "accountId": {
                        "type": "string",
                        "description": "The Better Auth account ID"
                      },
                      "userId": {
                        "type": "string",
                        "description": "The user ID associated with the account"
                      }
                    },
                    "required": [
                      "accountId"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "useAccountCookie": {
                        "enum": [
                          true
                        ],
                        "description": "Select the current OAuth account from its signed cookie"
                      },
                      "userId": {
                        "type": "string",
                        "description": "The user ID associated with the account"
                      }
                    },
                    "required": [
                      "useAccountCookie"
                    ]
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A Valid access token",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "tokenType": {
                      "type": "string"
                    },
                    "idToken": {
                      "type": "string"
                    },
                    "accessToken": {
                      "type": "string"
                    },
                    "accessTokenExpiresAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid refresh token or provider configuration"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/account-info": {
      "get": {
        "tags": [
          "Default"
        ],
        "description": "Get the account info provided by the provider",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "user": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string",
                          "nullable": true
                        },
                        "image": {
                          "type": "string"
                        },
                        "emailVerified": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "emailVerified"
                      ]
                    },
                    "account": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "providerId": {
                          "type": "string"
                        },
                        "issuer": {
                          "type": "string"
                        },
                        "accountId": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "providerId",
                        "issuer",
                        "accountId"
                      ],
                      "additionalProperties": false
                    },
                    "data": {
                      "type": "object",
                      "properties": {},
                      "additionalProperties": true
                    }
                  },
                  "required": [
                    "user",
                    "data",
                    "account"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/ok": {
      "get": {
        "tags": [
          "Default"
        ],
        "description": "Check if the API is working",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "API is working",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "description": "Indicates if the API is working"
                    }
                  },
                  "required": [
                    "ok"
                  ]
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/error": {
      "get": {
        "tags": [
          "Default"
        ],
        "description": "Displays an error page",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string",
                  "description": "The HTML content of the error page"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/email-otp/send-verification-otp": {
      "post": {
        "tags": [
          "Email-otp"
        ],
        "description": "Send a verification OTP to an email",
        "operationId": "sendEmailVerificationOTP",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "Email address to send the OTP"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "email-verification",
                      "sign-in",
                      "forget-password",
                      "change-email"
                    ],
                    "description": "Type of the OTP"
                  }
                },
                "required": [
                  "email",
                  "type"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/email-otp/check-verification-otp": {
      "post": {
        "tags": [
          "Email-otp"
        ],
        "description": "Verify an email with an OTP",
        "operationId": "verifyEmailWithOTP",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "Email address the OTP was sent to"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "email-verification",
                      "sign-in",
                      "forget-password",
                      "change-email"
                    ],
                    "description": "Type of the OTP"
                  },
                  "otp": {
                    "type": "string",
                    "description": "OTP to verify"
                  }
                },
                "required": [
                  "email",
                  "type",
                  "otp"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/email-otp/verify-email": {
      "post": {
        "tags": [
          "Email-otp"
        ],
        "description": "Verify email with OTP",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "Email address to verify"
                  },
                  "otp": {
                    "type": "string",
                    "description": "OTP to verify"
                  }
                },
                "required": [
                  "email",
                  "otp"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "description": "Indicates if the verification was successful",
                      "enum": [
                        true
                      ]
                    },
                    "token": {
                      "type": "string",
                      "nullable": true,
                      "description": "Session token if autoSignInAfterVerification is enabled, otherwise null"
                    },
                    "user": {
                      "$ref": "#/components/schemas/User"
                    }
                  },
                  "required": [
                    "status",
                    "token",
                    "user"
                  ]
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/sign-in/email-otp": {
      "post": {
        "tags": [
          "Email-otp"
        ],
        "description": "Sign in with email and OTP",
        "operationId": "signInWithEmailOTP",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "Email address to sign in"
                  },
                  "otp": {
                    "type": "string",
                    "description": "OTP sent to the email"
                  },
                  "name": {
                    "type": "string",
                    "description": "User display name. Only used if the user is registering for the first time. Eg: \"my-name\""
                  },
                  "image": {
                    "type": "string",
                    "description": "User profile image URL. Only used if the user is registering for the first time."
                  }
                },
                "required": [
                  "email",
                  "otp"
                ],
                "additionalProperties": {},
                "propertyNames": {
                  "type": "string"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "token": {
                      "type": "string",
                      "description": "Session token for the authenticated session"
                    },
                    "user": {
                      "$ref": "#/components/schemas/User"
                    }
                  },
                  "required": [
                    "token",
                    "user"
                  ]
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/email-otp/request-password-reset": {
      "post": {
        "tags": [
          "Email-otp"
        ],
        "description": "Request password reset with email and OTP",
        "operationId": "requestPasswordResetWithEmailOTP",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "Email address to send the OTP"
                  }
                },
                "required": [
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Indicates if the OTP was sent successfully"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/forget-password/email-otp": {
      "post": {
        "tags": [
          "Email-otp"
        ],
        "description": "Deprecated: Use /email-otp/request-password-reset instead.",
        "operationId": "forgetPasswordWithEmailOTP",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "Email address to send the OTP"
                  }
                },
                "required": [
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Indicates if the OTP was sent successfully"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/email-otp/reset-password": {
      "post": {
        "tags": [
          "Email-otp"
        ],
        "description": "Reset password with email and OTP",
        "operationId": "resetPasswordWithEmailOTP",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "Email address to reset the password"
                  },
                  "otp": {
                    "type": "string",
                    "description": "OTP sent to the email"
                  },
                  "password": {
                    "type": "string",
                    "description": "New password"
                  }
                },
                "required": [
                  "email",
                  "otp",
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/email-otp/request-email-change": {
      "post": {
        "tags": [
          "Email-otp"
        ],
        "description": "Request email change with verification OTP sent to the new email",
        "operationId": "requestEmailChangeWithEmailOTP",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "newEmail": {
                    "type": "string",
                    "description": "New email address to send the OTP"
                  },
                  "otp": {
                    "type": "string"
                  }
                },
                "required": [
                  "newEmail"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    },
    "/api/auth/email-otp/change-email": {
      "post": {
        "tags": [
          "Email-otp"
        ],
        "description": "Verify new email with OTP and change the email if verification is successful",
        "operationId": "changeEmailWithEmailOTP",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "newEmail": {
                    "type": "string",
                    "description": "New email address to verify and change to"
                  },
                  "otp": {
                    "type": "string",
                    "description": "OTP sent to the new email"
                  }
                },
                "required": [
                  "newEmail",
                  "otp"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Bad Request. Usually due to missing parameters, or invalid parameters."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            },
            "description": "Unauthorized. Due to missing or invalid authentication."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Forbidden. You do not have permission to access this resource or to perform this action."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Not Found. The requested resource was not found."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Too Many Requests. You have exceeded the rate limit. Try again later."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "Internal Server Error. This is a problem with the server that you cannot fix."
          }
        }
      }
    }
  }
}
