openapi: 3.1.1
info:
  title: Athena Auth
  description: API Reference for  Athena Auth Instance
  version: 1.1.0
components:
  schemas:
    User:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        email:
          type: string
        emailVerified:
          type: boolean
        image:
          type: string
        createdAt:
          type: date
        updatedAt:
          type: date
        username:
          type: string
        displayUsername:
          type: string
        twoFactorEnabled:
          type: boolean
        role:
          type: string
        banned:
          type: boolean
        banReason:
          type: string
        banExpires:
          type: date
    Session:
      type: object
      properties:
        id:
          type: string
        expiresAt:
          type: date
        token:
          type: string
        createdAt:
          type: date
        updatedAt:
          type: date
        ipAddress:
          type: string
        userAgent:
          type: string
        userId:
          type: string
        impersonatedBy:
          type: string
        activeOrganizationId:
          type: string
    Account:
      type: object
      properties:
        id:
          type: string
        accountId:
          type: string
        providerId:
          type: string
        userId:
          type: string
        accessToken:
          type: string
        refreshToken:
          type: string
        idToken:
          type: string
        accessTokenExpiresAt:
          type: date
        refreshTokenExpiresAt:
          type: date
        scope:
          type: string
        password:
          type: string
        createdAt:
          type: date
        updatedAt:
          type: date
    Verification:
      type: object
      properties:
        id:
          type: string
        identifier:
          type: string
        value:
          type: string
        expiresAt:
          type: date
        createdAt:
          type: date
        updatedAt:
          type: date
    TwoFactor:
      type: object
      properties:
        id:
          type: string
        secret:
          type: string
        backupCodes:
          type: string
        userId:
          type: string
    Passkey:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        publicKey:
          type: string
        userId:
          type: string
        credentialID:
          type: string
        counter:
          type: number
        deviceType:
          type: string
        backedUp:
          type: boolean
        transports:
          type: string
        createdAt:
          type: date
    Apikey:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        start:
          type: string
        prefix:
          type: string
        key:
          type: string
        userId:
          type: string
        refillInterval:
          type: number
        refillAmount:
          type: number
        lastRefillAt:
          type: date
        enabled:
          type: boolean
        rateLimitEnabled:
          type: boolean
        rateLimitTimeWindow:
          type: number
        rateLimitMax:
          type: number
        requestCount:
          type: number
        remaining:
          type: number
        lastRequest:
          type: date
        expiresAt:
          type: date
        createdAt:
          type: date
        updatedAt:
          type: date
        permissions:
          type: string
        metadata:
          type: string
    Organization:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        slug:
          type: string
        logo:
          type: string
        createdAt:
          type: date
        metadata:
          type: string
    Member:
      type: object
      properties:
        id:
          type: string
        organizationId:
          type: string
        userId:
          type: string
        role:
          type: string
        createdAt:
          type: date
    Invitation:
      type: object
      properties:
        id:
          type: string
        organizationId:
          type: string
        email:
          type: string
        role:
          type: string
        status:
          type: string
        expiresAt:
          type: date
        inviterId:
          type: string
  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: http://localhost:3001/api/auth
tags:
  - name: Default
    description: Default endpoints that are included with Better Auth by default. These endpoints are not part of any plugin.
paths:
  /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: Optional app callback URL. If provided, it must exactly match an active admin OAuth client redirect URI registered for the same provider; otherwise the request is rejected. If omitted, Athena Auth uses its internal provider callback route.
                newUserCallbackURL:
                  type: string
                errorCallbackURL:
                  type: string
                  description: Callback URL to redirect to if an error happens
                provider:
                  type: string
                  description: OAuth2 provider to use
                disableRedirect:
                  type: string
                  description: Disable automatic redirection to the provider. Useful for handling the redirection yourself
                idToken:
                  type: string
                  description: ID token from the provider to sign in the user with id token
                scopes:
                  type: string
                  description: Array of scopes to request from the provider. This will override the default scopes passed.
                requestSignUp:
                  type: string
                  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
              required:
                - provider
      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: "null"
                      nullable: true
                    user:
                      type: object
                      properties:
                        id:
                          type: string
                        email:
                          type: string
                        name:
                          type: string
                          nullable: true
                        image:
                          type: string
                          nullable: true
                        emailVerified:
                          type: boolean
                        createdAt:
                          type: string
                          format: date-time
                        updatedAt:
                          type: string
                          format: date-time
                      required:
                        - id
                        - email
                        - emailVerified
                        - createdAt
                        - updatedAt
                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.
  /get-session:
    get:
      tags:
        - Default
      description: Get the current session
      security:
        - bearerAuth: []
      parameters: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                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.
  /sign-out:
    post:
      tags:
        - Default
      description: Sign out the current user
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties: {}
      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.
  /sign-up/email:
    post:
      tags:
        - Default
      description: Sign up a user using email and password
      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
                callbackURL:
                  type: string
                  description: The URL to use for email verification callback
              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.
        "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.
  /sign-in/email:
    post:
      tags:
        - Default
      description: Sign in with email and password
      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: string
                  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: "null"
                    nullable: true
                  user:
                    type: object
                    properties:
                      id:
                        type: string
                      email:
                        type: string
                      name:
                        type: string
                        nullable: true
                      image:
                        type: string
                        nullable: true
                      emailVerified:
                        type: boolean
                      createdAt:
                        type: string
                        format: date-time
                      updatedAt:
                        type: string
                        format: date-time
                    required:
                      - id
                      - email
                      - emailVerified
                      - createdAt
                      - updatedAt
                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.
  /forget-password:
    post:
      tags:
        - Default
      description: Send a password reset email to the user
      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
        "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.
  /reset-password:
    post:
      tags:
        - Default
      description: Reset the password for a user
      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.
  /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
                    properties:
                      id:
                        type: string
                        description: User ID
                      email:
                        type: string
                        description: User email
                      name:
                        type: string
                        description: User name
                      image:
                        type: string
                        description: User image URL
                      emailVerified:
                        type: boolean
                        description: Indicates if the user email is verified
                      createdAt:
                        type: string
                        description: User creation date
                      updatedAt:
                        type: string
                        description: User update date
                    required:
                      - id
                      - email
                      - name
                      - image
                      - emailVerified
                      - createdAt
                      - updatedAt
                  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.
  /send-verification-email:
    post:
      tags:
        - Default
      description: Send a verification email to the user
      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.
  /change-email:
    post:
      tags:
        - Default
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                newEmail:
                  type: string
                  description: The new email to set
                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:
                  status:
                    type: boolean
                    description: Indicates if the request was successful
                  message:
                    type: string
                    enum:
                      - Email updated
                      - Verification email sent
                      - Email updated successfully
                      - Verification email sent to your new email address
                    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.
  /change-email/verify:
    get:
      tags:
        - Default
      description: Verify a change-email token and finalize the pending email update.
      parameters:
        - name: token
          in: query
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Email change verification completed successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    description: Indicates if the request was successful
                  message:
                    type: string
                    description: Status message of the email verification process
                required:
                  - status
                  - 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.
  /admin/api-key/create:
    post:
      tags:
        - Admin
      description: Create an admin-scoped API key for the authenticated admin user.
      security:
        - bearerAuth: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                expiresIn:
                  type: integer
                athenaClientName:
                  type: string
                permissions:
                  type: object
                metadata:
                  type: object
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  key:
                    type: string
                  apiKey:
                    type: object
                    additionalProperties: true
  /admin/athena-client/create:
    post:
      tags:
        - Admin
      description: Create a tenant/client registry row for Athena routing.
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                clientName:
                  type: string
                description:
                  type: string
                isActive:
                  type: boolean
                pgUriEnvVar:
                  type: string
                metadata:
                  type: object
              required:
                - clientName
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
  /admin/athena-client/list:
    get:
      tags:
      - Admin
      description: List configured Athena tenant/client rows.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  athenaClients:
                    type: array
                    items:
                      type: object
                      additionalProperties: true
  /admin/oauth-client/create:
    post:
      tags:
      - Admin
      description: Register an app-facing callback allowlist entry for social OAuth callers. This is not full OAuth authorization-server client registration.
      security:
      - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                clientName:
                  type: string
                provider:
                  type: string
                description:
                  type: string
                responseType:
                  type: string
                grantType:
                  type: string
                tokenAuthenticationMethod:
                  type: string
                redirectUris:
                  type: array
                  items:
                    type: string
                clientUrl:
                  type: string
                scopes:
                  type: array
                  items:
                    type: string
                isActive:
                  type: boolean
                metadata:
                  type: object
              required:
              - clientName
              - provider
              - redirectUris
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
  /admin/oauth-client/list:
    get:
      tags:
      - Admin
      description: List active and inactive social OAuth callback allowlist entries.
      security:
      - bearerAuth: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  oauthClients:
                    type: array
                    items:
                      type: object
                      additionalProperties: true
  /api-key/verify:
    post:
      tags:
        - Api-key
      description: Validate a raw API key and return key metadata when valid.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                key:
                  type: string
                permissions:
                  type: object
              required:
                - key
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  valid:
                    type: boolean
                  error:
                    type:
                      - object
                      - "null"
                    properties:
                      message:
                        type: string
                      code:
                        type: string
                  key:
                    type:
                      - object
                      - "null"
                    additionalProperties: true
  /api-key/delete-all-expired-api-keys:
    post:
      tags:
        - Api-key
      description: Bulk-delete expired API keys.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  deleted:
                    type: integer
  /callback/{provider}:
    get:
      tags:
        - Default
      description: OAuth callback endpoint (provider-specific path segment).
      parameters:
        - name: provider
          in: path
          required: true
          schema:
            type: string
        - name: code
          in: query
          required: true
          schema:
            type: string
        - name: state
          in: query
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  token:
                    type: string
                  user:
                    type: object
                    additionalProperties: true
  /.well-known/webauthn:
    get:
      tags:
        - Passkey
      description: Return passkey related origins for WebAuthn requests.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  origins:
                    type: array
                    items:
                      type: string
        "400":
          description: Related origins are not configured.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message
  /delete-user/verify:
    get:
      tags:
        - Default
      description: Verify an account-deletion token and finalize deletion.
      parameters:
        - name: token
          in: query
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                  message:
                    type: string
                required:
                  - status
                  - message
  /health:
    get:
      tags:
        - Default
      description: Liveness/health probe for the server process.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                  service:
                    type: string
                  version:
                    type: string
  /organization/list-members:
    get:
      tags:
        - Organization
      description: List organization members for the active or selected organization.
      security:
        - bearerAuth: []
      parameters:
        - name: organizationId
          in: query
          schema:
            type: string
        - name: organizationSlug
          in: query
          schema:
            type: string
        - name: limit
          in: query
          schema:
            type: integer
        - name: offset
          in: query
          schema:
            type: integer
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  members:
                    type: array
                    items:
                      type: object
                      additionalProperties: true
                  total:
                    type: integer
  /organization/list-user-invitations:
    get:
      tags:
        - Organization
      description: List pending invitations for the current authenticated user.
      security:
        - bearerAuth: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  additionalProperties: true
  /reference/openapi.json:
    get:
      tags:
        - Default
      description: Return the live generated OpenAPI document for this auth runtime.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
  /set-password:
    post:
      tags:
        - Default
      description: Set a password for the currently authenticated user.
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                newPassword:
                  type: string
              required:
                - newPassword
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
  /change-password:
    post:
      tags:
        - Default
      description: Change the password of the user
      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
                revokeOtherSessions:
                  type: string
                  description: Revoke all other sessions
              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.
  /update-user:
    post:
      tags:
        - Default
      description: Update the current user
      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
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    description: Indicates if the update was successful
        "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.
  /delete-user:
    post:
      tags:
        - Default
      description: Delete the user
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                callbackURL:
                  type: string
                password:
                  type: string
                token:
                  type: string
              required: []
      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.
  /reset-password/{token}:
    get:
      tags:
        - Default
      description: Redirects the user to the callback URL with the token
      security:
        - bearerAuth: []
      parameters:
        - name: callbackURL
          in: query
          schema:
            type: string
            description: The URL to redirect the user to reset their password
      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.
  /list-sessions:
    get:
      tags:
        - Default
      description: List all active sessions for the user
      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.
  /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.
  /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.
  /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.
  /link-social:
    post:
      tags:
        - Default
      description: Link a social account to the user
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                callbackURL:
                  type: string
                  description: Optional app callback URL. If provided, it must exactly match an active admin OAuth client redirect URI registered for the same provider; otherwise the request is rejected. If omitted, Athena Auth uses its internal provider callback route.
                provider:
                  type: string
                  description: The OAuth2 provider to use
                scopes:
                  type: string
                  description: Additional scopes to request from the provider
              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
                required:
                  - url
                  - 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.
  /list-accounts:
    get:
      tags:
        - Default
      description: List all accounts linked to the user
      security:
        - bearerAuth: []
      parameters: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    provider:
                      type: string
                    createdAt:
                      type: string
                      format: date-time
                    updatedAt:
                      type: string
                      format: date-time
                  accountId:
                    type: string
                  scopes:
                    type: array
                    items:
                      type: string
                required:
                  - id
                  - provider
                  - createdAt
                  - updatedAt
                  - accountId
                  - 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.
  /email/list:
    get:
      tags:
        - Default
      description: List sent emails addressed to the currently authenticated user.
      security:
        - bearerAuth: []
      parameters:
        - name: limit
          in: query
          schema:
            type: integer
        - name: offset
          in: query
          schema:
            type: integer
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  limit:
                    type: integer
                  offset:
                    type: integer
                  emails:
                    type: array
                    items:
                      type: object
                      additionalProperties: true
                required:
                  - total
                  - limit
                  - offset
                  - emails
        "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.
  /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
        - name: callbackURL
          in: query
          schema:
            type: string
      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.
  /unlink-account:
    post:
      tags:
        - Default
      description: Unlink an account
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                providerId:
                  type: string
                accountId:
                  type: string
              required:
                - providerId
      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.
  /refresh-token:
    post:
      tags:
        - Default
      description: Refresh the access token using a refresh token
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                providerId:
                  type: string
                  description: The provider ID for the OAuth provider
                accountId:
                  type: string
                  description: The account ID associated with the refresh token
                userId:
                  type: string
                  description: The user ID associated with the account
              required:
                - providerId
      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.
  /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:
              type: object
              properties:
                providerId:
                  type: string
                  description: The provider ID for the OAuth provider
                accountId:
                  type: string
                  description: The account ID associated with the refresh token
                userId:
                  type: string
                  description: The user ID associated with the account
              required:
                - providerId
      responses:
        "200":
          description: A Valid access token
          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.
  /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.
  /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.
  /sign-in/username:
    post:
      tags:
        - Username
      description: Sign in with username
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                username:
                  type: string
                  description: The username of the user
                password:
                  type: string
                  description: The password of the user
                rememberMe:
                  type: string
                  description: Remember the user session
              required:
                - username
                - password
      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.
  /two-factor/get-totp-uri:
    post:
      tags:
        - Two-factor
      description: Use this endpoint to get the TOTP URI
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                password:
                  type: string
                  description: User password
              required:
                - password
      responses:
        "200":
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  totpURI:
                    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.
  /two-factor/verify-totp:
    post:
      tags:
        - Two-factor
      description: Verify two factor TOTP
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                code:
                  type: string
                  description: The otp code to verify
                trustDevice:
                  type: string
                  description: If true, the device will be trusted for 30 days. It'll be refreshed on every sign in request within this time.
              required:
                - code
      responses:
        "200":
          description: Successful response
          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.
  /two-factor/send-otp:
    post:
      tags:
        - Two-factor
      description: Send two factor OTP to the user
      security:
        - bearerAuth: []
      parameters: []
      responses:
        "200":
          description: Successful response
          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.
  /two-factor/verify-otp:
    post:
      tags:
        - Two-factor
      description: Verify two factor OTP
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                code:
                  type: string
                  description: The otp code to verify
                trustDevice:
                  type: string
              required:
                - code
      responses:
        "200":
          description: Two-factor OTP verified successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  token:
                    type: string
                    description: Session token for the authenticated session
                  user:
                    type: object
                    properties:
                      id:
                        type: string
                        description: Unique identifier of the user
                      email:
                        type: string
                        format: email
                        nullable: true
                        description: User's email address
                      emailVerified:
                        type: boolean
                        nullable: true
                        description: Whether the email is verified
                      name:
                        type: string
                        nullable: true
                        description: User's name
                      image:
                        type: string
                        format: uri
                        nullable: true
                        description: User's profile image URL
                      createdAt:
                        type: string
                        format: date-time
                        description: Timestamp when the user was created
                      updatedAt:
                        type: string
                        format: date-time
                        description: Timestamp when the user was last updated
                    required:
                      - id
                      - createdAt
                      - updatedAt
                    description: The authenticated user object
                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.
  /two-factor/verify-backup-code:
    post:
      tags:
        - Two-factor
      description: Verify a backup code for two-factor authentication
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                code:
                  type: string
                disableSession:
                  type: string
                  description: If true, the session cookie will not be set.
                trustDevice:
                  type: string
                  description: If true, the device will be trusted for 30 days. It'll be refreshed on every sign in request within this time.
              required:
                - code
      responses:
        "200":
          description: Backup code verified successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  user:
                    type: object
                    properties:
                      id:
                        type: string
                        description: Unique identifier of the user
                      email:
                        type: string
                        format: email
                        nullable: true
                        description: User's email address
                      emailVerified:
                        type: boolean
                        nullable: true
                        description: Whether the email is verified
                      name:
                        type: string
                        nullable: true
                        description: User's name
                      image:
                        type: string
                        format: uri
                        nullable: true
                        description: User's profile image URL
                      twoFactorEnabled:
                        type: boolean
                        description: Whether two-factor authentication is enabled for the user
                      createdAt:
                        type: string
                        format: date-time
                        description: Timestamp when the user was created
                      updatedAt:
                        type: string
                        format: date-time
                        description: Timestamp when the user was last updated
                    required:
                      - id
                      - twoFactorEnabled
                      - createdAt
                      - updatedAt
                    description: The authenticated user object with two-factor details
                  session:
                    type: object
                    properties:
                      token:
                        type: string
                        description: Session token
                      userId:
                        type: string
                        description: ID of the user associated with the session
                      createdAt:
                        type: string
                        format: date-time
                        description: Timestamp when the session was created
                      expiresAt:
                        type: string
                        format: date-time
                        description: Timestamp when the session expires
                    required:
                      - token
                      - userId
                      - createdAt
                      - expiresAt
                    description: The current session object, included unless disableSession is true
                required:
                  - user
                  - 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.
  /two-factor/generate-backup-codes:
    post:
      tags:
        - Two-factor
      description: Generate new backup codes for two-factor authentication
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                password:
                  type: string
              required:
                - password
      responses:
        "200":
          description: Backup codes generated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    description: Indicates if the backup codes were generated successfully
                    enum:
                      - true
                  backupCodes:
                    type: array
                    items:
                      type: string
                    description: Array of generated backup codes in plain text
                required:
                  - status
                  - backupCodes
        "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.
  /two-factor/enable:
    post:
      tags:
        - Two-factor
      description: Use this endpoint to enable two factor authentication. This will generate a TOTP URI and backup codes. Once the user verifies the TOTP URI, the two factor authentication will be enabled.
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                password:
                  type: string
                  description: User password
                issuer:
                  type: string
                  description: Custom issuer for the TOTP URI
              required:
                - password
      responses:
        "200":
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  totpURI:
                    type: string
                    description: TOTP URI
                  backupCodes:
                    type: array
                    items:
                      type: string
                    description: Backup codes
        "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.
  /two-factor/disable:
    post:
      tags:
        - Two-factor
      description: Use this endpoint to disable two factor authentication.
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                password:
                  type: string
                  description: User password
              required:
                - password
      responses:
        "200":
          description: Successful response
          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.
  /passkey/generate-register-options:
    get:
      tags:
        - Passkey
      description: Generate registration options for a new passkey
      security:
        - bearerAuth: []
      parameters: []
      responses:
        "200":
          description: Success
          parameters:
            query:
              authenticatorAttachment:
                description: >-
                  Type of authenticator to use for registration. 
                                            "platform" for device-specific authenticators, 
                                            "cross-platform" for authenticators that can be used across devices.
                required: false
          content:
            application/json:
              schema:
                type: object
                properties:
                  challenge:
                    type: string
                  rp:
                    type: object
                    properties:
                      name:
                        type: string
                      id:
                        type: string
                  user:
                    type: object
                    properties:
                      id:
                        type: string
                      name:
                        type: string
                      displayName:
                        type: string
                  pubKeyCredParams:
                    type: array
                    items:
                      type: object
                      properties:
                        type:
                          type: string
                        alg:
                          type: number
                  timeout:
                    type: number
                  excludeCredentials:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                        transports:
                          type: array
                          items:
                            type: string
                  authenticatorSelection:
                    type: object
                    properties:
                      authenticatorAttachment:
                        type: string
                      requireResidentKey:
                        type: boolean
                      userVerification:
                        type: string
                  attestation:
                    type: string
                  extensions:
                    type: object
        "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.
  /passkey/generate-authenticate-options:
    post:
      tags:
        - Passkey
      description: Generate authentication options for a passkey
      security:
        - bearerAuth: []
      parameters: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  challenge:
                    type: string
                  rp:
                    type: object
                    properties:
                      name:
                        type: string
                      id:
                        type: string
                  user:
                    type: object
                    properties:
                      id:
                        type: string
                      name:
                        type: string
                      displayName:
                        type: string
                  timeout:
                    type: number
                  allowCredentials:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                        transports:
                          type: array
                          items:
                            type: string
                  userVerification:
                    type: string
                  authenticatorSelection:
                    type: object
                    properties:
                      authenticatorAttachment:
                        type: string
                      requireResidentKey:
                        type: boolean
                      userVerification:
                        type: string
                  extensions:
                    type: object
        "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.
  /passkey/verify-registration:
    post:
      tags:
        - Passkey
      description: Verify registration of a new passkey
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                response:
                  type: string
                  description: The response from the authenticator
                name:
                  type: string
                  description: Name of the passkey
              required:
                - response
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Passkey"
        "400":
          description: Bad request
        "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.
  /passkey/verify-authentication:
    post:
      tags:
        - Passkey
      description: Verify authentication of a passkey
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                response:
                  type: string
              required:
                - response
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  session:
                    $ref: "#/components/schemas/Session"
                  user:
                    $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.
  /passkey/list-user-passkeys:
    get:
      tags:
        - Passkey
      description: List all passkeys for the authenticated user
      security:
        - bearerAuth: []
      parameters: []
      responses:
        "200":
          description: Passkeys retrieved successfully
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Passkey"
                  required:
                    - id
                    - userId
                    - publicKey
                    - createdAt
                    - updatedAt
                description: Array of passkey objects associated with the 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.
  /passkey/delete-passkey:
    post:
      tags:
        - Passkey
      description: Delete a specific passkey
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
              required:
                - id
      responses:
        "200":
          description: Passkey deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    description: Indicates whether the deletion was successful
                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.
  /passkey/update-passkey:
    post:
      tags:
        - Passkey
      description: Update a specific passkey's name
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                name:
                  type: string
              required:
                - id
                - name
      responses:
        "200":
          description: Passkey updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  passkey:
                    $ref: "#/components/schemas/Passkey"
                required:
                  - passkey
        "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.
  /admin/set-role:
    post:
      tags:
        - Admin
      description: Set the role of a user
      operationId: setRole
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                userId:
                  type: string
                  description: The user id
                role:
                  type: string
              required:
                - userId
                - role
      responses:
        "200":
          description: User role updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  user:
                    $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.
  /admin/create-user:
    post:
      tags:
        - Admin
      description: Create a new user
      operationId: createUser
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  description: The email of the user
                password:
                  type: string
                  description: The password of the user
                name:
                  type: string
                  description: The name of the user
                role:
                  type: string
                data:
                  type: string
              required:
                - email
                - password
                - name
      responses:
        "200":
          description: User created
          content:
            application/json:
              schema:
                type: object
                properties:
                  user:
                    $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.
  /admin/list-users:
    get:
      tags:
        - Admin
      description: List users
      operationId: listUsers
      security:
        - bearerAuth: []
      parameters:
        - name: searchValue
          in: query
          schema:
            type: string
            description: The value to search for
        - name: searchField
          in: query
          schema:
            type: string
            description: The field to search in, defaults to email. Can be `email` or `name`
        - name: searchOperator
          in: query
          schema:
            type: string
            description: The operator to use for the search. Can be `contains`, `starts_with` or `ends_with`
        - name: limit
          in: query
          schema:
            type: string
            description: The number of users to return
        - name: offset
          in: query
          schema:
            type: string
            description: The offset to start from
        - name: sortBy
          in: query
          schema:
            type: string
            description: The field to sort by
        - name: sortDirection
          in: query
          schema:
            type: string
            description: The direction to sort by
        - name: filterField
          in: query
          schema:
            type: string
            description: The field to filter by
        - name: filterValue
          in: query
          schema:
            type: string
            description: The value to filter by
        - name: filterOperator
          in: query
          schema:
            type: string
            description: The operator to use for the filter
      responses:
        "200":
          description: List of users
          content:
            application/json:
              schema:
                type: object
                properties:
                  users:
                    type: array
                    items:
                      $ref: "#/components/schemas/User"
                  total:
                    type: number
                  limit:
                    type: number
                  offset:
                    type: number
                required:
                  - users
                  - total
        "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.
  /admin/list-user-sessions:
    post:
      tags:
        - Admin
      description: List user sessions
      operationId: listUserSessions
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                userId:
                  type: string
                  description: The user id
              required:
                - userId
      responses:
        "200":
          description: List of user sessions
          content:
            application/json:
              schema:
                type: object
                properties:
                  sessions:
                    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.
  /admin/unban-user:
    post:
      tags:
        - Admin
      description: Unban a user
      operationId: unbanUser
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                userId:
                  type: string
                  description: The user id
              required:
                - userId
      responses:
        "200":
          description: User unbanned
          content:
            application/json:
              schema:
                type: object
                properties:
                  user:
                    $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.
  /admin/ban-user:
    post:
      tags:
        - Admin
      description: Ban a user
      operationId: banUser
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                userId:
                  type: string
                  description: The user id
                banReason:
                  type: string
                  description: The reason for the ban
                banExpiresIn:
                  type: string
                  description: The number of seconds until the ban expires
              required:
                - userId
      responses:
        "200":
          description: User banned
          content:
            application/json:
              schema:
                type: object
                properties:
                  user:
                    $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.
  /admin/impersonate-user:
    post:
      tags:
        - Admin
      description: Impersonate a user
      operationId: impersonateUser
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                userId:
                  type: string
                  description: The user id
              required:
                - userId
      responses:
        "200":
          description: Impersonation session created
          content:
            application/json:
              schema:
                type: object
                properties:
                  session:
                    $ref: "#/components/schemas/Session"
                  user:
                    $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.
  /admin/stop-impersonating:
    post:
      tags:
        - Admin
      security:
        - bearerAuth: []
      parameters: []
      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.
  /admin/revoke-user-session:
    post:
      tags:
        - Admin
      description: Revoke a user session
      operationId: revokeUserSession
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                sessionToken:
                  type: string
                  description: The session token
              required:
                - sessionToken
      responses:
        "200":
          description: Session revoked
          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.
  /admin/revoke-user-sessions:
    post:
      tags:
        - Admin
      description: Revoke all user sessions
      operationId: revokeUserSessions
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                userId:
                  type: string
                  description: The user id
              required:
                - userId
      responses:
        "200":
          description: Sessions revoked
          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.
  /admin/remove-user:
    post:
      tags:
        - Admin
      description: Delete a user and all their sessions and accounts. Cannot be undone.
      operationId: removeUser
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                userId:
                  type: string
                  description: The user id
              required:
                - userId
      responses:
        "200":
          description: User removed
          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.
  /admin/set-user-password:
    post:
      tags:
        - Admin
      description: Set a user's password
      operationId: setUserPassword
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                newPassword:
                  type: string
                  description: The new password
                userId:
                  type: string
                  description: The user id
              required:
                - newPassword
                - userId
      responses:
        "200":
          description: Password set
          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.
  /admin/has-permission:
    post:
      tags:
        - Admin
      description: Check if the user has permission
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                permission:
                  type: object
                  description: The permission to check
                  deprecated: true
                permissions:
                  type: object
                  description: The permission to check
              required:
                - permissions
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  success:
                    type: boolean
                required:
                  - success
        "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.
  /admin/audit-log/list:
    get:
      tags:
        - Admin
      description: List admin audit logs for the resolved tenant runtime.
      security:
        - bearerAuth: []
      parameters:
        - name: limit
          in: query
          schema:
            type: integer
        - name: offset
          in: query
          schema:
            type: integer
        - name: actorUserId
          in: query
          schema:
            type: string
        - name: action
          in: query
          schema:
            type: string
        - name: targetType
          in: query
          schema:
            type: string
        - name: targetId
          in: query
          schema:
            type: string
        - name: success
          in: query
          schema:
            type: boolean
        - name: createdAfter
          in: query
          schema:
            type: string
            format: date-time
        - name: createdBefore
          in: query
          schema:
            type: string
            format: date-time
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  limit:
                    type: integer
                  offset:
                    type: integer
                  auditLogs:
                    type: array
                    items:
                      type: object
                      additionalProperties: true
  /admin/email/list:
    get:
      tags:
        - Admin
      description: List sent emails for the resolved tenant runtime.
      security:
        - bearerAuth: []
      parameters:
        - name: limit
          in: query
          schema:
            type: integer
        - name: offset
          in: query
          schema:
            type: integer
        - name: recipientEmail
          in: query
          schema:
            type: string
        - name: provider
          in: query
          schema:
            type: string
        - name: flow
          in: query
          schema:
            type: string
        - name: subjectContains
          in: query
          schema:
            type: string
        - name: createdAfter
          in: query
          schema:
            type: string
            format: date-time
        - name: createdBefore
          in: query
          schema:
            type: string
            format: date-time
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  limit:
                    type: integer
                  offset:
                    type: integer
                  emails:
                    type: array
                    items:
                      type: object
                      additionalProperties: true
  /admin/email/get:
    get:
      tags:
        - Admin
      description: Fetch a sent email row by ID for the resolved tenant runtime.
      security:
        - bearerAuth: []
      parameters:
        - name: id
          in: query
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  email:
                    type: object
                    additionalProperties: true
  /admin/email/create:
    post:
      tags:
        - Admin
      description: Create a sent email audit row in the resolved tenant runtime.
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                recipientEmail:
                  type: string
                  format: email
                subject:
                  type: string
                fromAddress:
                  type: string
                  format: email
                fromName:
                  type: string
                textBody:
                  type: string
                htmlBody:
                  type: string
                provider:
                  type: string
                flow:
                  type: string
                metadata:
                  type: object
              required:
                - recipientEmail
                - subject
                - fromAddress
                - provider
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
  /admin/email/update:
    post:
      tags:
        - Admin
      description: Update a sent email row by ID in the resolved tenant runtime.
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                recipientEmail:
                  type: string
                  format: email
                subject:
                  type: string
                fromAddress:
                  type: string
                  format: email
                fromName:
                  type:
                    - string
                    - "null"
                textBody:
                  type:
                    - string
                    - "null"
                htmlBody:
                  type:
                    - string
                    - "null"
                provider:
                  type: string
                flow:
                  type:
                    - string
                    - "null"
                metadata:
                  type: object
              required:
                - id
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  email:
                    type: object
                    additionalProperties: true
  /admin/email/delete:
    post:
      tags:
        - Admin
      description: Delete a sent email row by ID in the resolved tenant runtime.
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
              required:
                - id
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
  /admin/email-failure/list:
    get:
      tags:
        - Admin
      description: List email send failures for the resolved tenant runtime.
      security:
        - bearerAuth: []
      parameters:
        - name: limit
          in: query
          schema:
            type: integer
        - name: offset
          in: query
          schema:
            type: integer
        - name: recipientEmail
          in: query
          schema:
            type: string
        - name: provider
          in: query
          schema:
            type: string
        - name: flow
          in: query
          schema:
            type: string
        - name: resolved
          in: query
          schema:
            type: boolean
        - name: createdAfter
          in: query
          schema:
            type: string
            format: date-time
        - name: createdBefore
          in: query
          schema:
            type: string
            format: date-time
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  limit:
                    type: integer
                  offset:
                    type: integer
                  emailSendFailures:
                    type: array
                    items:
                      type: object
                      additionalProperties: true
  /admin/email-failure/get:
    get:
      tags:
        - Admin
      description: Fetch an email send failure row by ID for the resolved tenant runtime.
      security:
        - bearerAuth: []
      parameters:
        - name: id
          in: query
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  emailSendFailure:
                    type: object
                    additionalProperties: true
  /admin/email-failure/create:
    post:
      tags:
        - Admin
      description: Create an email send failure row in the resolved tenant runtime.
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                userId:
                  type: string
                recipientEmail:
                  type: string
                  format: email
                flow:
                  type: string
                provider:
                  type: string
                errorMessage:
                  type: string
                metadata:
                  type: object
              required:
                - recipientEmail
                - flow
                - errorMessage
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
  /admin/email-failure/update:
    post:
      tags:
        - Admin
      description: Update an email send failure row by ID in the resolved tenant runtime.
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                resolved:
                  type: boolean
                resolutionNote:
                  type:
                    - string
                    - "null"
                metadata:
                  type: object
              required:
                - id
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  emailSendFailure:
                    type: object
                    additionalProperties: true
  /admin/email-failure/delete:
    post:
      tags:
        - Admin
      description: Delete an email send failure row by ID in the resolved tenant runtime.
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
              required:
                - id
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
  /admin/email-template/create:
    post:
      tags:
        - Admin
      description: Create an email template override in the resolved tenant runtime.
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                templateKey:
                  type: string
                eventType:
                  type: string
                locale:
                  type: string
                subjectTemplate:
                  type: string
                textTemplate:
                  type: string
                htmlTemplate:
                  type: string
                variables:
                  type: array
                  items:
                    type: string
                variableBindings:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                      source:
                        type: string
                      required:
                        type: boolean
                    required:
                      - name
                      - source
                isActive:
                  type: boolean
                metadata:
                  type: object
              required:
                - templateKey
                - subjectTemplate
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
  /admin/email-template/list:
    get:
      tags:
        - Admin
      description: List email template overrides for the resolved tenant runtime.
      security:
        - bearerAuth: []
      parameters:
        - name: limit
          in: query
          schema:
            type: integer
        - name: offset
          in: query
          schema:
            type: integer
        - name: templateKey
          in: query
          schema:
            type: string
        - name: eventType
          in: query
          schema:
            type: string
        - name: locale
          in: query
          schema:
            type: string
        - name: isActive
          in: query
          schema:
            type: boolean
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  limit:
                    type: integer
                  offset:
                    type: integer
                  emailTemplates:
                    type: array
                    items:
                      type: object
                      additionalProperties: true
  /admin/email-template/get:
    get:
      tags:
        - Admin
      description: Fetch an email template override row by ID for the resolved tenant runtime.
      security:
        - bearerAuth: []
      parameters:
        - name: id
          in: query
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  emailTemplate:
                    type: object
                    additionalProperties: true
  /admin/email-template/update:
    post:
      tags:
        - Admin
      description: Update an email template override by ID in the resolved tenant runtime.
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                templateKey:
                  type: string
                eventType:
                  type:
                    - string
                    - "null"
                locale:
                  type: string
                subjectTemplate:
                  type: string
                textTemplate:
                  type:
                    - string
                    - "null"
                htmlTemplate:
                  type:
                    - string
                    - "null"
                variables:
                  type: array
                  items:
                    type: string
                variableBindings:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                      source:
                        type: string
                      required:
                        type: boolean
                    required:
                      - name
                      - source
                isActive:
                  type: boolean
                metadata:
                  type: object
              required:
                - id
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
  /admin/email-template/delete:
    post:
      tags:
        - Admin
      description: Delete an email template override by ID in the resolved tenant runtime.
      security:
        - bearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
              required:
                - id
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
  /api-key/create:
    post:
      tags:
        - Api-key
      description: Create a new API key for a user
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Name of the Api Key
                expiresIn:
                  type: string
                  description: Expiration time of the Api Key in seconds
                userId:
                  type: string
                  description: User Id of the user that the Api Key belongs to. Useful for server-side only.
                prefix:
                  type: string
                  description: Prefix of the Api Key
                remaining:
                  type: string
                  description: Remaining number of requests. Server side only
                metadata:
                  type: string
                  description: Metadata of the Api Key
                refillAmount:
                  type: string
                  description: Amount to refill the remaining count of the Api Key. Server Only Property
                refillInterval:
                  type: string
                  description: Interval to refill the Api Key in milliseconds. Server Only Property.
                rateLimitTimeWindow:
                  type: string
                  description: The duration in milliseconds where each request is counted. Once the `maxRequests` is reached, the request will be rejected until the `timeWindow` has passed, at which point the `timeWindow` will be reset. Server Only Property.
                rateLimitMax:
                  type: string
                  description: Maximum amount of requests allowed within a window. Once the `maxRequests` is reached, the request will be rejected until the `timeWindow` has passed, at which point the `timeWindow` will be reset. Server Only Property.
                rateLimitEnabled:
                  type: string
                  description: Whether the key has rate limiting enabled. Server Only Property.
                permissions:
                  type: string
              required:
                - expiresIn
                - remaining
      responses:
        "200":
          description: API key created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Unique identifier of the API key
                  createdAt:
                    type: string
                    format: date-time
                    description: Creation timestamp
                  updatedAt:
                    type: string
                    format: date-time
                    description: Last update timestamp
                  name:
                    type: string
                    nullable: true
                    description: Name of the API key
                  prefix:
                    type: string
                    nullable: true
                    description: Prefix of the API key
                  start:
                    type: string
                    nullable: true
                    description: Starting characters of the key (if configured)
                  key:
                    type: string
                    description: The full API key (only returned on creation)
                  enabled:
                    type: boolean
                    description: Whether the key is enabled
                  expiresAt:
                    type: string
                    format: date-time
                    nullable: true
                    description: Expiration timestamp
                  userId:
                    type: string
                    description: ID of the user owning the key
                  lastRefillAt:
                    type: string
                    format: date-time
                    nullable: true
                    description: Last refill timestamp
                  lastRequest:
                    type: string
                    format: date-time
                    nullable: true
                    description: Last request timestamp
                  metadata:
                    type: object
                    nullable: true
                    additionalProperties: true
                    description: Metadata associated with the key
                  rateLimitMax:
                    type: number
                    nullable: true
                    description: Maximum requests in time window
                  rateLimitTimeWindow:
                    type: number
                    nullable: true
                    description: Rate limit time window in milliseconds
                  remaining:
                    type: number
                    nullable: true
                    description: Remaining requests
                  refillAmount:
                    type: number
                    nullable: true
                    description: Amount to refill
                  refillInterval:
                    type: number
                    nullable: true
                    description: Refill interval in milliseconds
                  rateLimitEnabled:
                    type: boolean
                    description: Whether rate limiting is enabled
                  requestCount:
                    type: number
                    description: Current request count in window
                  permissions:
                    type: object
                    nullable: true
                    additionalProperties:
                      type: array
                      items:
                        type: string
                    description: Permissions associated with the key
                required:
                  - id
                  - createdAt
                  - updatedAt
                  - key
                  - enabled
                  - userId
                  - rateLimitEnabled
                  - requestCount
        "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-key/get:
    get:
      tags:
        - Api-key
      description: Retrieve an existing API key by ID
      security:
        - bearerAuth: []
      parameters:
        - name: id
          in: query
          schema:
            type: string
            description: The id of the Api Key
      responses:
        "200":
          description: API key retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: ID
                  name:
                    type: string
                    nullable: true
                    description: The name of the key
                  start:
                    type: string
                    nullable: true
                    description: Shows the first few characters of the API key, including the prefix. This allows you to show those few characters in the UI to make it easier for users to identify the API key.
                  prefix:
                    type: string
                    nullable: true
                    description: The API Key prefix. Stored as plain text.
                  userId:
                    type: string
                    description: The owner of the user id
                  refillInterval:
                    type: number
                    nullable: true
                    description: "The interval in which the `remaining` count is refilled by day. Example: 1 // every day"
                  refillAmount:
                    type: number
                    nullable: true
                    description: The amount to refill
                  lastRefillAt:
                    type: string
                    format: date-time
                    nullable: true
                    description: The last refill date
                  enabled:
                    type: boolean
                    description: Sets if key is enabled or disabled
                    default: true
                  rateLimitEnabled:
                    type: boolean
                    description: Whether the key has rate limiting enabled
                  rateLimitTimeWindow:
                    type: number
                    nullable: true
                    description: The duration in milliseconds
                  rateLimitMax:
                    type: number
                    nullable: true
                    description: Maximum amount of requests allowed within a window
                  requestCount:
                    type: number
                    description: The number of requests made within the rate limit time window
                  remaining:
                    type: number
                    nullable: true
                    description: Remaining requests (every time api key is used this should updated and should be updated on refill as well)
                  lastRequest:
                    type: string
                    format: date-time
                    nullable: true
                    description: When last request occurred
                  expiresAt:
                    type: string
                    format: date-time
                    nullable: true
                    description: Expiry date of a key
                  createdAt:
                    type: string
                    format: date-time
                    description: created at
                  updatedAt:
                    type: string
                    format: date-time
                    description: updated at
                  metadata:
                    type: object
                    nullable: true
                    additionalProperties: true
                    description: Extra metadata about the apiKey
                  permissions:
                    type: string
                    nullable: true
                    description: Permissions for the api key (stored as JSON string)
                required:
                  - id
                  - userId
                  - enabled
                  - rateLimitEnabled
                  - requestCount
                  - createdAt
                  - updatedAt
        "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-key/update:
    post:
      tags:
        - Api-key
      description: Retrieve an existing API key by ID
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                keyId:
                  type: string
                  description: The id of the Api Key
                userId:
                  type: string
                name:
                  type: string
                  description: The name of the key
                enabled:
                  type: string
                  description: Whether the Api Key is enabled or not
                remaining:
                  type: string
                  description: The number of remaining requests
                refillAmount:
                  type: string
                  description: The refill amount
                refillInterval:
                  type: string
                  description: The refill interval
                metadata:
                  type: string
                  description: The metadata of the Api Key
                expiresIn:
                  type: string
                  description: Expiration time of the Api Key in seconds
                rateLimitEnabled:
                  type: string
                  description: Whether the key has rate limiting enabled.
                rateLimitTimeWindow:
                  type: string
                  description: The duration in milliseconds where each request is counted.
                rateLimitMax:
                  type: string
                  description: Maximum amount of requests allowed within a window. Once the `maxRequests` is reached, the request will be rejected until the `timeWindow` has passed, at which point the `timeWindow` will be reset.
                permissions:
                  type: string
              required:
                - keyId
                - expiresIn
                - permissions
      responses:
        "200":
          description: API key retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: ID
                  name:
                    type: string
                    nullable: true
                    description: The name of the key
                  start:
                    type: string
                    nullable: true
                    description: Shows the first few characters of the API key, including the prefix. This allows you to show those few characters in the UI to make it easier for users to identify the API key.
                  prefix:
                    type: string
                    nullable: true
                    description: The API Key prefix. Stored as plain text.
                  userId:
                    type: string
                    description: The owner of the user id
                  refillInterval:
                    type: number
                    nullable: true
                    description: "The interval in which the `remaining` count is refilled by day. Example: 1 // every day"
                  refillAmount:
                    type: number
                    nullable: true
                    description: The amount to refill
                  lastRefillAt:
                    type: string
                    format: date-time
                    nullable: true
                    description: The last refill date
                  enabled:
                    type: boolean
                    description: Sets if key is enabled or disabled
                    default: true
                  rateLimitEnabled:
                    type: boolean
                    description: Whether the key has rate limiting enabled
                  rateLimitTimeWindow:
                    type: number
                    nullable: true
                    description: The duration in milliseconds
                  rateLimitMax:
                    type: number
                    nullable: true
                    description: Maximum amount of requests allowed within a window
                  requestCount:
                    type: number
                    description: The number of requests made within the rate limit time window
                  remaining:
                    type: number
                    nullable: true
                    description: Remaining requests (every time api key is used this should updated and should be updated on refill as well)
                  lastRequest:
                    type: string
                    format: date-time
                    nullable: true
                    description: When last request occurred
                  expiresAt:
                    type: string
                    format: date-time
                    nullable: true
                    description: Expiry date of a key
                  createdAt:
                    type: string
                    format: date-time
                    description: created at
                  updatedAt:
                    type: string
                    format: date-time
                    description: updated at
                  metadata:
                    type: object
                    nullable: true
                    additionalProperties: true
                    description: Extra metadata about the apiKey
                  permissions:
                    type: string
                    nullable: true
                    description: Permissions for the api key (stored as JSON string)
                required:
                  - id
                  - userId
                  - enabled
                  - rateLimitEnabled
                  - requestCount
                  - createdAt
                  - updatedAt
        "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-key/delete:
    post:
      tags:
        - Api-key
      description: Delete an existing API key
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                keyId:
                  type: string
                  description: The id of the API key to delete
              required:
                - keyId
      responses:
        "200":
          description: API key deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Indicates if the API key was successfully deleted
                required:
                  - success
        "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-key/list:
    get:
      tags:
        - Api-key
      description: List all API keys for the authenticated user
      security:
        - bearerAuth: []
      parameters: []
      responses:
        "200":
          description: API keys retrieved successfully
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      description: ID
                    name:
                      type: string
                      nullable: true
                      description: The name of the key
                    start:
                      type: string
                      nullable: true
                      description: Shows the first few characters of the API key, including the prefix. This allows you to show those few characters in the UI to make it easier for users to identify the API key.
                    prefix:
                      type: string
                      nullable: true
                      description: The API Key prefix. Stored as plain text.
                    userId:
                      type: string
                      description: The owner of the user id
                    refillInterval:
                      type: number
                      nullable: true
                      description: "The interval in which the `remaining` count is refilled by day. Example: 1 // every day"
                    refillAmount:
                      type: number
                      nullable: true
                      description: The amount to refill
                    lastRefillAt:
                      type: string
                      format: date-time
                      nullable: true
                      description: The last refill date
                    enabled:
                      type: boolean
                      description: Sets if key is enabled or disabled
                      default: true
                    rateLimitEnabled:
                      type: boolean
                      description: Whether the key has rate limiting enabled
                    rateLimitTimeWindow:
                      type: number
                      nullable: true
                      description: The duration in milliseconds
                    rateLimitMax:
                      type: number
                      nullable: true
                      description: Maximum amount of requests allowed within a window
                    requestCount:
                      type: number
                      description: The number of requests made within the rate limit time window
                    remaining:
                      type: number
                      nullable: true
                      description: Remaining requests (every time api key is used this should updated and should be updated on refill as well)
                    lastRequest:
                      type: string
                      format: date-time
                      nullable: true
                      description: When last request occurred
                    expiresAt:
                      type: string
                      format: date-time
                      nullable: true
                      description: Expiry date of a key
                    createdAt:
                      type: string
                      format: date-time
                      description: created at
                    updatedAt:
                      type: string
                      format: date-time
                      description: updated at
                    metadata:
                      type: object
                      nullable: true
                      additionalProperties: true
                      description: Extra metadata about the apiKey
                    permissions:
                      type: string
                      nullable: true
                      description: Permissions for the api key (stored as JSON string)
                  required:
                    - id
                    - userId
                    - enabled
                    - rateLimitEnabled
                    - requestCount
                    - createdAt
                    - updatedAt
        "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.
  /organization/create:
    post:
      tags:
        - Organization
      description: Create an organization
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: The name of the organization
                slug:
                  type: string
                  description: The slug of the organization
                userId:
                  type: string
                  description: The user id of the organization creator. If not provided, the current user will be used. Should only be used by admins or when called by the server.
                logo:
                  type: string
                  description: The logo of the organization
                metadata:
                  type: string
                  description: The metadata of the organization
                keepCurrentActiveOrganization:
                  type: string
                  description: Whether to keep the current active organization active after creating a new one
              required:
                - name
                - slug
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                description: The organization that was created
                $ref: "#/components/schemas/Organization"
        "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.
  /organization/update:
    post:
      tags:
        - Organization
      description: Update an organization
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  type: object
                organizationId:
                  type: string
              required:
                - data
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                description: The updated organization
                $ref: "#/components/schemas/Organization"
        "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.
  /organization/delete:
    post:
      tags:
        - Organization
      description: Delete an organization
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                organizationId:
                  type: string
                  description: The organization id to delete
              required:
                - organizationId
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: string
                description: The organization id that was deleted
        "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.
  /organization/set-active:
    post:
      tags:
        - Organization
      description: Set the active organization
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                organizationId:
                  type: string
                  description: The organization id to set as active. It can be null to unset the active organization
                organizationSlug:
                  type: string
                  description: The organization slug to set as active. It can be null to unset the active organization if organizationId is not provided
              required: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                description: The organization
                $ref: "#/components/schemas/Organization"
        "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.
  /organization/get-full-organization:
    get:
      tags:
        - Organization
      description: Get the full organization
      security:
        - bearerAuth: []
      parameters: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                description: The organization
                $ref: "#/components/schemas/Organization"
        "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.
  /organization/list:
    get:
      tags:
        - Organization
      description: List all organizations
      security:
        - bearerAuth: []
      parameters: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Organization"
        "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.
  /organization/invite-member:
    post:
      tags:
        - Organization
      description: Invite a user to an organization
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  description: The email address of the user to invite
                role:
                  type: string
                organizationId:
                  type: string
                  description: The organization ID to invite the user to
                resend:
                  type: string
                  description: Resend the invitation email, if the user is already invited
                teamId:
                  type: string
                  description: The team ID to invite the user to
              required:
                - email
                - role
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  email:
                    type: string
                  role:
                    type: string
                  organizationId:
                    type: string
                  inviterId:
                    type: string
                  status:
                    type: string
                  expiresAt:
                    type: string
                required:
                  - id
                  - email
                  - role
                  - organizationId
                  - inviterId
                  - status
                  - expiresAt
        "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.
  /organization/cancel-invitation:
    post:
      tags:
        - Organization
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                invitationId:
                  type: string
                  description: The ID of the invitation to cancel
              required:
                - invitationId
      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.
  /organization/accept-invitation:
    post:
      tags:
        - Organization
      description: Accept an invitation to an organization
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                invitationId:
                  type: string
                  description: The ID of the invitation to accept
              required:
                - invitationId
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  invitation:
                    type: object
                  member:
                    type: object
        "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.
  /organization/get-invitation:
    get:
      tags:
        - Organization
      description: Get an invitation by ID
      security:
        - bearerAuth: []
      parameters:
        - name: id
          in: query
          schema:
            type: string
            description: The ID of the invitation to get
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  email:
                    type: string
                  role:
                    type: string
                  organizationId:
                    type: string
                  inviterId:
                    type: string
                  status:
                    type: string
                  expiresAt:
                    type: string
                  organizationName:
                    type: string
                  organizationSlug:
                    type: string
                  inviterEmail:
                    type: string
                required:
                  - id
                  - email
                  - role
                  - organizationId
                  - inviterId
                  - status
                  - expiresAt
                  - organizationName
                  - organizationSlug
                  - inviterEmail
        "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.
  /organization/reject-invitation:
    post:
      tags:
        - Organization
      description: Reject an invitation to an organization
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                invitationId:
                  type: string
                  description: The ID of the invitation to reject
              required:
                - invitationId
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  invitation:
                    type: object
                  member:
                    type: "null"
        "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.
  /organization/check-slug:
    post:
      tags:
        - Organization
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                slug:
                  type: string
              required:
                - slug
      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.
  /organization/remove-member:
    post:
      tags:
        - Organization
      description: Remove a member from an organization
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                memberIdOrEmail:
                  type: string
                  description: The ID or email of the member to remove
                organizationId:
                  type: string
                  description: The ID of the organization to remove the member from. If not provided, the active organization will be used
              required:
                - memberIdOrEmail
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  member:
                    type: object
                    properties:
                      id:
                        type: string
                      userId:
                        type: string
                      organizationId:
                        type: string
                      role:
                        type: string
                    required:
                      - id
                      - userId
                      - organizationId
                      - role
                required:
                  - member
        "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.
  /organization/update-member-role:
    post:
      tags:
        - Organization
      description: Update the role of a member in an organization
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                role:
                  type: string
                memberId:
                  type: string
                organizationId:
                  type: string
              required:
                - role
                - memberId
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  member:
                    type: object
                    properties:
                      id:
                        type: string
                      userId:
                        type: string
                      organizationId:
                        type: string
                      role:
                        type: string
                    required:
                      - id
                      - userId
                      - organizationId
                      - role
                required:
                  - member
        "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.
  /organization/get-active-member:
    get:
      tags:
        - Organization
      description: Get the active member in the organization
      security:
        - bearerAuth: []
      parameters: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  userId:
                    type: string
                  organizationId:
                    type: string
                  role:
                    type: string
                required:
                  - id
                  - userId
                  - organizationId
                  - role
        "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.
  /organization/leave:
    post:
      tags:
        - Organization
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                organizationId:
                  type: string
              required:
                - organizationId
      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.
  /organization/list-invitations:
    get:
      tags:
        - Organization
      security:
        - bearerAuth: []
      parameters: []
      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.
  /organization/has-permission:
    post:
      tags:
        - Organization
      description: Check if the user has permission
      security:
        - bearerAuth: []
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                permission:
                  type: object
                  description: The permission to check
                  deprecated: true
                permissions:
                  type: object
                  description: The permission to check
              required:
                - permissions
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  success:
                    type: boolean
                required:
                  - success
        "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.
