openapi: 3.0.0
info:
  title: 登录认证接口
  version: 1.0.0
  description: >-
    ### Function Introduction

    This document provides the API for login authentication, along with parameter references for each API.

    ### HTTP Status Codes

    Depending on the response, `2xx`, `4xx`, `5xx` status codes may appear. Handle accordingly based on the situation.

servers:
  - url: https://{envId}.api.tcloudbasegateway.com
    description: TCB openapi endpoint
    variables:
      envId:
        default: "your-envId"
        description: Environment ID
tags:
  - name: 登录认证
  - name: 第三方登录认证
  - name: token管理
  - name: 用户管理
  - name: 验证码
paths:
  /auth/v1/provider/uri:
    get:
      summary: Get Third-Party Login Callback URL
      deprecated: false
      description: |-
        ## API Description
        Get the callback URL for third-party identity provider login, used in the OAuth authorization flow.
        
        ### Input Requirements
        - `provider_id`: Identity provider ID (required, e.g., github, wechat)
        - `redirect_uri`: Redirect URL (optional)
        - `state`: Client state parameter (optional, used to prevent CSRF attacks)
        - `scope`: Authorization scope (optional)
        - `response_type`: Authorization type (optional)
        - `client_id`: Client ID (optional, defaults to environment ID)
        - `x-device-id`: Device ID (required, passed in the request header)
        
        ### Output
        - Returns the callback URI for third-party login.
        
        ### Request Example
        ```
        GET /auth/v1/provider/uri?provider_id=github&state=random_state_string
        x-device-id: device_123456
        ```
        
        ### Response Example
        ```json
        {
          "uri": "https://github.com/login/oauth/authorize?client_id=your_client_id&redirect_uri=https://your-app.com/callback&state=random_state_string&scope=user"
        }
        ```
        
        ### Usage Flow
        1. Call this API to obtain the third-party login URL.
        2. Redirect the user to the returned URI.
        3. After the user finishes third-party authorization, they are redirected back to the specified `redirect_uri`.
        4. Retrieve the authorization code from the callback for subsequent token retrieval.
      operationId: Auth_GenProviderRedirectURI
      tags:
        - 第三方登录认证
      parameters:
        - name: provider_id
          in: query
          description: Identity provider ID
          required: true
          example: github
          schema:
            type: string
        - name: redirect_uri
          in: query
          description: Redirect URL
          required: false
          schema:
            type: string
        - name: state
          in: query
          description: Current state of the client, any value can be specified
          required: false
          schema:
            type: string
        - name: scope
          in: query
          description: Authorization scope
          required: false
          schema:
            type: string
        - name: response_type
          in: query
          description: Authorization type
          required: false
          schema:
            type: string
        - name: client_id
          in: query
          description: Client ID corresponding to the application, defaults to environment ID, can be omitted
          required: false
          schema:
            type: string
        - name: x-device-id
          in: header
          description: Device ID
          required: true
          example: ""
          schema:
            type: string
      responses:
        "200":
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/v1GenProviderRedirectURIResponse"
          headers: {}
        "500":
          description: An unexpected error response.
          content:
            application/json:
              schema: &ref_0
                $ref: "#/components/schemas/rpcStatus"
          headers: {}
      security: []
  /auth/v1/provider/token:
    post:
      summary: Get Third-Party Authorization Info
      deprecated: false
      description: |-
        ## API Description
        Obtain authorization information from third-party services. For example, when logging in with OAuth, use this API to get the authorized user information for the OAuth client and generate a `provider_token`.
        
        ### Input Requirements
        - `client_id`: Client ID corresponding to the application (optional, defaults to environment ID)
        - `x-device-id`: Device ID (required, passed in the request header)
        - Request body parameters (`v1GrantProviderTokenRequest`):
          - `provider_id`: Identity provider ID (required, e.g., github, wechat, apple)
          - `provider_code`: Login code obtained from the third-party system (used to exchange for user identity; either this or `provider_id_token` is required)
          - `provider_id_token`: Third-party id_token or identityToken (used to exchange for user identity; either this or `provider_code` is required, e.g., the identityToken returned by Apple login)
          - `provider_redirect_uri`: Identity provider callback URL (optional)
        
        ### Prerequisites
        - You must first obtain an authorization code (`code`) via the third-party authorization flow, or obtain an id_token/identityToken returned directly by the third party.
        - At least one of `provider_code` or `provider_id_token` must be provided.
        - The third-party identity provider must be configured in the CloudBase console.
        
        ### Output
        - Returns `provider_token` and `provider_profile` (`v1GrantProviderTokenResponse`).
        - `provider_token` is used when calling subsequent login APIs.
        - `provider_profile` contains the basic information of the third-party user.
        
        ### Request Example (Authorization Code)
        ```
        POST /auth/v1/provider/token
        x-device-id: device_123456
        Content-Type: application/json
        
        {
          "provider_id": "github",
          "provider_code": "authorization_code_from_github",
          "provider_redirect_uri": "https://your-app.com/callback"
        }
        ```
        
        ### Request Example (id_token)
        ```
        POST /auth/v1/provider/token
        x-device-id: device_123456
        Content-Type: application/json
        
        {
          "provider_id": "apple",
          "provider_id_token": "<identityToken string>"
        }
        ```
        
        ### Response Example
        ```json
        {
          "provider_token": "your_provider_token",
          "expires_in": 3600,
          "provider_profile": {
            "provider_id": "github",
            "sub": "1234567890",
            "name": "Zhang San",
            "picture": "https://avatars.githubusercontent.com/u/1234567890",
            "email": "zhangsan@example",
            "provider": "github"
          }
        }
        ```
        
        ### Usage Flow
        1. After the user completes third-party authorization, obtain the authorization code (`code`) or the id_token/identityToken returned by the third party.
        2. Call this API with the authorization code or id_token/identityToken to exchange it for a `provider_token`.
        3. Use the `provider_token` to call the [Third-party Authorization Info Login](/http-api/auth/auth-sign-in-with-provider) API to complete login.
        
        ### Key Characteristics
        - The `provider_token` is valid for 3600 seconds (1 hour).
        - The returned `provider_profile` contains the full information of the third-party user.
        - Supports auto-registering a new user if the user does not exist.
        - Supports binding to an existing user account.
      operationId: Auth_GrantProviderToken
      tags:
        - 第三方登录认证
      parameters:
        - name: client_id
          in: query
          description: Client ID corresponding to the application, defaults to environment ID, can be omitted
          required: false
          schema:
            type: string
        - name: x-device-id
          in: header
          description: Device ID
          required: true
          example: ""
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/v1GrantProviderTokenRequest"
            example: ""
      responses:
        "200":
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/v1GrantProviderTokenResponse"
          headers: {}
        "500":
          description: An unexpected error response.
          content:
            application/json:
              schema: *ref_0
          headers: {}
      security: []
  /auth/v1/signin/with/provider:
    post:
      summary: Third-Party Authorized Token Login
      deprecated: false
      description: |-
        ## API Description
        Log in using a `provider_token` generated from third-party authorization information. Supports auto-registering new users or binding to existing users.
        
        ### Input Requirements
        - `client_id`: Client ID corresponding to the application (optional, defaults to environment ID)
        - `x-device-id`: Device ID (required, passed in the request header)
        - Request body parameters (`v1SignInWithProviderRequest`):
          - `provider_token`: `provider_token` (required, obtained via the [Get Third-party Authorization Info](/http-api/auth/auth-grant-provider-token) API)
          - `force_disable_sign_up`: Force disable auto registration (optional, default `false`)
          - `sync_profile`: Whether to force synchronization of nickname and other information from the third party (optional, default `false`)
        
        ### Prerequisites
        - You must first call the [Get Third-party Authorization Info](/http-api/auth/auth-grant-provider-token) API to obtain a valid `provider_token`.
        - The `provider_token` must still be within its validity period (default 1 hour).
        - The third-party identity provider must be configured and enabled in the CloudBase console.
        
        ### Output
        - Returns a standard token response (`access_token`, `refresh_token`, etc.).
        - If the user does not exist and auto registration is enabled, a new user will be created automatically.
        - If the user already exists, the third-party identity provider will be bound to the existing user.
        
        ### Request Example
        ```
        POST /auth/v1/signin/with/provider
        x-device-id: device_123456
        Content-Type: application/json
        
        {
          "provider_token": "your_provider_token",
          "force_disable_sign_up": false,
          "sync_profile": true
        }
        ```
        
        ### Response Example
        ```json
        {
          "token_type": "Bearer",
          "access_token": "your_access_token",
          "refresh_token": "m.aB3cD4eF5gH6iJ7kL8mN9oP0qR1sT2uV3wX4yZ5aB6cD7eF8gH9iJ0kL1mN2oP3qR4sT5uV6wX7yZ8",
          "expires_in": 7200,
          "scope": "user sso",
          "sub": "9876543210123456789"
        }
        ```
        
        ### Key Characteristics
        - Supports seamless login via third-party authorization information.
        - Supports auto-registering new users.
        - Supports binding the third-party identity provider to an existing account.
        - Supports synchronizing basic information such as nickname and avatar from the third party.
      operationId: Auth_SignInWithProvider
      tags:
        - 第三方登录认证
      parameters:
        - name: client_id
          in: query
          description: Client ID corresponding to the application, defaults to environment ID, can be omitted
          required: false
          schema:
            type: string
        - name: x-device-id
          in: header
          description: Device ID
          required: true
          example: ""
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/v1SignInWithProviderRequest"
            example: ""
      responses:
        "200":
          description: A successful response.
          content:
            application/json:
              schema: &ref_1
                $ref: "#/components/schemas/v1Token"
          headers: {}
        "500":
          description: An unexpected error response.
          content:
            application/json:
              schema: *ref_0
          headers: {}
      security: []
  /auth/v1/signin/custom:
    post:
      summary: Custom Login
      deprecated: false
      description: |-
        ## Applicable Scenarios
        - One-to-one mapping between enterprise's own account system and CloudBase account system
        - Business scenarios that require completely customized authentication processes
        - Need to achieve seamless integration between your own account system and CloudBase services

        ## Function Description
        ### 1. Server-side Issued Ticket
        Developers need to use the CloudBase SDK on the server side to issue login credentials (Ticket), which are used for subsequent client authentication.
        - Refer to [Custom Login Documentation](https://docs.cloudbase.net/authentication-v2/method/custom-login) for the part before obtaining the ticket.
        #### Code Example:
        ```
          const cloudbase = require("@cloudbase/node-sdk");

          // 1. Initialize SDK
          const app = cloudbase.init({
          env: "your-env-id",
            // Pass custom login private key
          credentials: require("/path/to/your/tcb_custom_login.json")
          });
            
          // 2. Developer-defined unique user identifier
          const customUserId = "your-customUserId";
          
          // 3. Create ticket
          const ticket = app.auth().createTicket(customUserId);
          
          // 4. Return ticket to client
          return ticket;
        ```

        ### 2. Client-side Custom Login
        #### API Description
        The client uses the server-issued Ticket to obtain access credentials.
        #### Request Example:
        ```
          {
            "provider_id": "custom",
            "ticket": "your_ticket"
          }
        ```

        #### Key Features:
          - access_token is valid for 7200 seconds (2 hours)
          - refresh_token is valid for 2592000 seconds (30 days)
          - It is recommended to implement an automatic token refresh mechanism
      operationId: Auth_SignInCustom
      tags:
        - 第三方登录认证
      parameters:
        - name: client_id
          in: query
          description: Client ID corresponding to the application, defaults to environment ID, can be omitted
          required: false
          schema:
            type: string
        - name: x-device-id
          in: header
          description: Device ID
          required: false
          example: ""
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                provider_id:
                  type: string
                  title: Identity provider ID, fixed to custom for custom login
                ticket:
                  type: string
                  title: Custom login ticket
              required:
                - provider_id
                - ticket
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema: &ref_1
                $ref: "#/components/schemas/v1Token"
          headers: {}
      security: []
  /auth/v1/signin:
    post:
      summary: User Login API
      deprecated: false
      description: |-
        ## Login Scenarios Explanation
        
        ### 1. Username/Password Login
        #### Input Requirements:
        - `username`: Username (required, 2-48 characters, supports English letters (case-sensitive), numbers, special characters (only -_.:+ @), must start with a letter or number, Chinese characters not supported)
        - `password`: Password (required)
        
        #### Prerequisites:
        - Registered users can use username/password login
        
        #### Username/Password Login Request Example
        ```json
        {
          "username": "zhangsan",
          "password": "example password"
        }
        ```
        #### Username/Password Login Response Example
        ```json
        {
          "token_type": "Bearer",
          "access_token": "your_access_token",
          "refresh_token": "m.aB3cD4eF5gH6iJ7kL8mN9oP0qR1sT2uV3wX4yZ5aB6cD7eF8gH9iJ0kL1mN2oP3qR4sT5uV6wX7yZ8",
          "expires_in": 7200,
          "sub": "9876543210123456789"
        }
        ```
        
        ### 2. Phone Number Verification Code Login
        #### Input Requirements:
        - `verification_token`: Verification code token (required), obtained from [Verify SMS/Email Verification Code](/http-api/auth/auth-verify-verification) API
        
        #### Prerequisites:
        - Need to call verification code sending API first to get verification code
        - Get verification_token after verification code validation passes
        
        #### Phone Number Verification Code Login Request Example
        ```json
        {
          "verification_token": "your_verification_token"
        }
        ```
        #### Phone Number Verification Code Login Response Example
        ```json
        {
          "token_type": "Bearer",
          "access_token": "your_access_token",
          "refresh_token": "m.aB3cD4eF5gH6iJ7kL8mN9oP0qR1sT2uV3wX4yZ5aB6cD7eF8gH9iJ0kL1mN2oP3qR4sT5uV6wX7yZ8",
          "expires_in": 7200,
          "sub": "9876543210123456789"
        }
        ```
        
        ### 3. Email Verification Code Login
        #### Input Requirements:
        - `verification_token`: Verification code token (required), obtained from [Verify SMS/Email Verification Code](/http-api/auth/auth-verify-verification) API
        
        #### Prerequisites:
        - Need to call email verification code sending API first to get verification code
        - Get verification_token after verification code validation passes
        
        #### Email Verification Code Login Request Example
        ```json
        {
          "verification_token": "your_verification_token"
        }
        ```
        #### Email Verification Code Login Response Example
        ```json
        {
          "token_type": "Bearer",
          "access_token": "your_access_token",
          "refresh_token": "m.aB3cD4eF5gH6iJ7kL8mN9oP0qR1sT2uV3wX4yZ5aB6cD7eF8gH9iJ0kL1mN2oP3qR4sT5uV6wX7yZ8",
          "expires_in": 7200,
          "sub": "9876543210123456789"
        }
        ```
        
        ### General Notes:
        - The three login methods are mutually exclusive, only one method can be used per request
        - For verification code login, need to obtain verification_token from [Verify SMS/Email Verification Code](/http-api/auth/auth-verify-verification) API
        - Returns standard token response after successful login

      operationId: Auth_SignIn
      tags:
        - 登录认证
      parameters:
        - name: client_id
          in: query
          description: Client ID corresponding to the application, can be obtained from CloudBase Platform -> Identity Authentication -> Development Settings. Defaults to environment ID, can be omitted
          required: false
          schema:
            type: string
        - name: x-device-id
          in: header
          description: Device ID, the ID of the current logged-in device. The client should generate it randomly and cache it on the client. This parameter is related to the number of logged-in accounts.
          required: false
          example: ""
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/v1SignInRequest"
            example:
              username: zhangsan
              password: your-password
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema: *ref_1
              example:
                token_type: Bearer
                access_token: >-
                  your_access_token
                refresh_token: m.aB3cD4eF5gH6iJ7kL8mN9oP0qR1sT2uV3wX4yZ5aB6cD7eF8gH9iJ0kL1mN2oP3qR4sT5uV6wX7yZ8
                expires_in: 7200
          sub: "9876543210123456789"
          headers: {}
        "400":
          description: |-
            - invalid_username_or_password, incorrect username or password
            - captcha_required, too many login attempts, requires verification code
            - password_not_set, user password not set, needs to be set
            - invalid_status, account locked due to too many retries, please try again later
          content:
            application/json:
              schema: *ref_0
              example:
                error: invalid_username_or_password
                error_code: 4043
                error_description: Username or password incorrect.
          headers:
            X-Request-Id:
              example: 1e55ed89-4a2b-47f8-b7de-27b4775c2adb
              required: false
              description: Request ID
              schema:
                type: string
        "501":
          description: >-
            - username login is disabled by admin, username/password login is not enabled, go to https://tcb.cloud.tencent.com to enable identity authentication function
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  error_code:
                    type: integer
                  error_description:
                    type: string
                required:
                  - error
                  - error_code
                  - error_description
              example:
                error: unimplemented
                error_code: 12
                error_description: username login is disabled by admin
          headers: {}
      security: []
  /auth/v1/signin/anonymously:
    post:
      summary: Anonymous Login
      deprecated: false
      description: |-
        ## API Description
        Anonymous login API. A single device ID can register at most one anonymous user and generate an `access_token` for that anonymous user.
        
        ### Input Requirements
        - `x-device-id`: Device ID (required, passed in the request header)
        - `client_id`: Client ID corresponding to the application (optional, defaults to environment ID)
        
        ### Prerequisites
        - A single device ID can only register one anonymous user.
        - The device ID must be randomly generated by the client and cached locally.
        
        ### Output
        - Returns a standard token response (`access_token`, `refresh_token`, etc.).
        - The `scope` is `"anonymous"`, indicating an anonymous user.
        
        ### Request Example
        ```
        POST /auth/v1/signin/anonymously
        x-device-id: device_123456
        Content-Type: application/json
        
        {}
        ```
        
        ### Response Example
        ```json
        {
          "token_type": "Bearer",
          "access_token": "your_access_token",
          "expires_in": 7200,
          "scope": "anonymous",
          "sub": "7ft9WRremXrz-TfgoAR9Uw"
        }
        ```
        
        ### Key Characteristics
        - A single device ID can create only one anonymous user.
        - Anonymous users do not have personal information such as username or password.
        - Suitable for scenarios such as trial use or guest experience.
        - Can be upgraded to a regular user by binding other login methods.
      operationId: Auth_SignInAnonymously
      tags:
        - 登录认证
      parameters:
        - name: client_id
          in: query
          description: Client ID corresponding to the application, can be obtained from CloudBase Platform -> Identity Authentication -> Development Settings. Defaults to environment ID, can be omitted
          required: false
          schema:
            type: string
        - name: x-device-id
          in: header
          description: >-
            Required for anonymous login. Device ID, the ID of the current logged-in device. The client should generate it randomly and cache it on the client. This parameter is used to calculate the user ID during anonymous login, and if not cached, it will cause the anonymous user to log in again and the user ID to change
          required: true
          example: ""
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/v1SignInAnonymouslyRequest"
            example: {}
      responses:
        "200":
          description: A successful response.
          content:
            application/json:
              schema: *ref_1
              example:
                token_type: Bearer
                access_token: >-
                  your_access_token
                expires_in: 7200
                scope: anonymous
                sub: 1234567890
          headers: {}
        "400":
          description: |-
            - invalid_argument, please add device ID in the request header, x-device-id is not passed in the Header
            - unimplemented, please contact the administrator to enable anonymous login, anonymous login is not enabled, go to the CloudBase Platform to enable it
          content:
            application/json:
              schema:
                type: object
                properties: {}
          headers: {}
        "403":
          description: ""
          content:
            application/json:
              schema:
                title: ""
                type: object
                properties: {}
              example:
                error: permission_denied
                error_code: 7
                error_description: >-
                  cors permission denied, please check if
                  demo-app-3g4h5i6j7k8l-9876543210.example.com in
                  your client XyZ9aB1cD2eF3gH4iJ5 domains
          headers: {}
        "500":
          description: An unexpected error response.
          content:
            application/json:
              schema: *ref_0
          headers: {}
      security: []
  /auth/v1/signup:
    post:
      summary: Register New User
      deprecated: false
      description: |-
        Register new user, supports the following three registration scenarios:
        
        ### 1. Phone Number + Verification Code Registration
        #### Input Requirements:
        - `phone_number`: Phone number (required, format: "+86 13000000000")
        - `verification_token`: Verification code token (required), obtained from [Verify SMS/Email Verification Code](/http-api/auth/auth-verify-verification) API
        - `username`: Username (optional, 2-48 characters)
        - `password`: Password (optional)
        
        #### Output:
        - Returns standard token response (access_token, refresh_token, etc.)
        
        #### Phone Number + Verification Code Registration Request Example
        ```json
        {
          "phone_number": "+86 13000000000",
          "verification_token": "your_verification_token",
          "username": "user123",
          "password": "Password@123"
        }
        ```
        #### Phone Number + Verification Code Registration Response Example
        ```json
        {
          "token_type": "Bearer",
          "access_token": "your_access_token",
          "refresh_token": "m.xY9zA1bC2dE3fG4hI5jK6lM7nO8pQ9rS0tU1vW2xY3zA4bC5dE6fG7hI8jK9lM0nO1pQ2rS3tU4vW5",
          "expires_in": 7200,
          "sub": "9876543210123456789"
        }
        ```
        
        ### 2. Email + Verification Code Registration
        #### Input Requirements:
        - `email`: Email address (required)
        - `verification_token`: Verification code token (required), obtained from [Verify SMS/Email Verification Code](/http-api/auth/auth-verify-verification) API
        - `username`: Username (optional, 5-24 characters)
        - `password`: Password (optional)
        
        #### Output:
        - Returns standard token response (access_token, refresh_token, etc.)
        
        #### Email + Verification Code Registration Request Example
        ```json
        {
          "email": "user@example",
          "verification_token": "your_verification_token",
          "username": "user456",
          "password": "DemoPass123!@#"
        }
        ```
        #### Email + Verification Code Registration Response Example
        ```json
        {
          "token_type": "Bearer",
          "access_token": "your_access_token",
          "refresh_token": "m.xY9zA1bC2dE3fG4hI5jK6lM7nO8pQ9rS0tU1vW2xY3zA4bC5dE6fG7hI8jK9lM0nO1pQ2rS3tU4vW5",
          "expires_in": 7200,
          "sub": "9876543210123456789"
        }
        ```
        
        ### 3. Third-party Authorization Registration
        #### Input Requirements:
        - `provider_token`: Third-party identity source token (required)
        - `username`: Username (optional, 5-24 characters)
        - `password`: Password (optional)
        
        #### Output:
        - Returns standard token response (access_token, refresh_token, etc.)
        
        #### Third-party Authorization Registration Request Example
        ```json
        {
          "provider_token": "your_provider_token",
          "username": "github_user",
          "password": "SamplePass456$%^"
        }
        ```
        #### Third-party Authorization Registration Response Example
        ```json
        {
          "token_type": "Bearer",
          "access_token": "your_access_token",
          "refresh_token": "m.xY9zA1bC2dE3fG4hI5jK6lM7nO8pQ9rS0tU1vW2xY3zA4bC5dE6fG7hI8jK9lM0nO1pQ2rS3tU4vW5",
          "expires_in": 7200,
          "sub": "9876543210123456789"
        }
        ```
        
        ### General Notes:
        - Can set username and password during registration
        - For verification code registration, need to obtain verification_token from [Verify SMS/Email Verification Code](/http-api/auth/auth-verify-verification) API
        - Registration with only username and password is not supported. For username/password user creation, please go to cloud backend

      operationId: Auth_SignUp
      tags:
        - 登录认证
      parameters:
        - name: client_id
          in: query
          description: Client ID corresponding to the application, can be obtained from CloudBase Platform -> Identity Authentication -> Development Settings. Defaults to environment ID, can be omitted
          required: false
          schema:
            type: string
        - name: x-device-id
          in: header
          description: Device ID, the ID of the current logged-in device. The client should generate it randomly and cache it on the client. This parameter is related to the number of logged-in accounts.
          required: false
          example: ""
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/v1SignUpRequest"
            example:
              username: user03
              password: 123456ab@123
              email: demouser@123.com
              verification_token: >-
                your_verification_token
      responses:
        "200":
          description: A successful response.
          content:
            application/json:
              schema: *ref_1
              example:
                token_type: Bearer
                access_token: >-
                  your_access_token
                refresh_token: m.xY9zA1bC2dE3fG4hI5jK6lM7nO8pQ9rS0tU1vW2xY3zA4bC5dE6fG7hI8jK9lM0nO1pQ2rS3tU4vW5
                expires_in: 7200
                sub: "1870014161959620608"
          headers: {}
        "400":
          description: |-
            - you can not signup just by username and password, registration with only username and password is not allowed, user identity needs to be verified
            - phone number login is disabled by admin, phone number login is not enabled, needs to be enabled on the CloudBase Platform
            - you can not set phone number and email at same time, phone number and email cannot be set simultaneously
          content:
            application/json:
              schema: *ref_0
              example:
                error: unimplemented
                error_code: 12
                error_description: you can not signup just by username and password
          headers: {}
      security: []
  /auth/v1/user/signout:
    post:
      summary: Logout
      deprecated: false
      description: |-
        ## API Description
        User logout API, used to securely terminate a user session.
        
        ### Features
        - Cleans up the `refresh_token` record corresponding to the token on the backend.
        - Marks the `access_token` as invalid.
        - Supports clients proactively clearing locally cached tokens.
        - When logging out from third-party authorization sessions, whether a third-party logout URL is generated depends on the corresponding identity provider configuration.
        
        ## Input Requirements
        
        ### Required Parameters
        - `Authorization`: Bearer authentication in the request header, in the format `Bearer ${access_token}`.
        
        ### Optional Parameters
        - `client_id`: Client ID corresponding to the application, defaults to environment ID, can be omitted.
        - `x-device-id`: Device ID of the current logged-in device.
        - `redirect_uri`: Redirect URL after successful logout (optional).
        - `state`: State parameter to be appended to the redirect URL after logout (optional).
        
        ## Prerequisites
        - The user must be in a logged-in state.
        - The `access_token` must be valid and not expired.
        - The client must cache the `access_token` in order to call the logout API.
        
        ## Output
        
        ### Successful Response
        - HTTP 200 indicates logout succeeded.
        - Optional `redirect_uri` is returned for page redirection.
        
        ### Request Example
        ```
        POST /auth/v1/user/signout
        Authorization: Bearer your_access_token.hOKXMtMmtbeyZSlnlprXIGVtKpBw8t7Syq45sqMX3oC2TqZ4Gl4AieQCyQF6KMLh4BH3PHt_eoJxJGQYJXx-bXalP_S94A22KpiB0n5tVb8MAV_8YbTT0oNgQeQMkGgfMMfEECle82daASgxEIHUO0UyhY0mC3O3FoGpO6rrOXVL_mOCd3Ij80dMy59XjEJn3wmnnIS3bMLAIM2GodUYT9s9C1z_p6JPWlCbxlTxst6q_lHGwvpcO8UxWvra8zQbfStn0Kej3anEYfnuWYcgLAfkAPv3eeWHii0_nLTC300Kwnhk4RCFQ7U89XHoJ4O773DeA9c4ZFdXjHicysBDUQ
        x-device-id: device_123456
        Content-Type: application/json
        
        {}
        ```
        
        ## Response Examples
        
        ### Successful Response
        ```json
        {
          "redirect_uri": "https://example/logout-callback?state=logout_state_123"
        }
        ```
        
        ### Invalid Parameter Response
        ```json
        {
          "error": "invalid_argument",
          "error_code": 3,
          "error_description": "device id must less than 72"
        }
        ```
        
        ## Usage Flow
        
        ### 1. Client clears local tokens
        - Delete locally stored `access_token` and `refresh_token`.
        - Clear related user session information.
        
        ### 2. Call the logout API
        - Call the logout API with a valid `access_token`.
        - Optionally pass redirect URL and state parameters.
        
        ### 3. Handle server response
        - If a redirect URL is returned, perform page redirection.
        - If an error is returned, handle it accordingly.
        
        ### 4. Verify token status
        - Call the [Verify Token](/http-api/auth/auth-token-introspect) API to confirm that the token has become invalid.
        
        ## Notes
        
        ### Security Rules
        - The JWT token is stored on the client and must be cleared by the client proactively.
        - After logout, the `access_token` becomes invalid immediately.
        - The `refresh_token` is marked as unusable.
        
        ### Error Handling
        - If the `access_token` has already expired, the logout API still returns success.
        - If the device ID length exceeds the limit, a parameter error occurs.
        - For server internal errors, you should implement a retry mechanism.
      operationId: Auth_SignOut
      tags:
        - 登录认证
      parameters:
        - name: client_id
          in: query
          description: Client ID corresponding to the application, can be obtained from CloudBase Platform -> Identity Authentication -> Development Settings. Defaults to environment ID, can be omitted
          required: false
          schema:
            type: string
        - name: x-device-id
          in: header
          description: Device ID, the ID of the current logged-in device. The client should generate it randomly and cache it on the client. This parameter is related to the number of logged-in accounts.
          required: false
          example: ""
          schema:
            type: string
        - name: Authorization
          in: header
          description: The access_token of the current logged-in user, format is Bearer xxx
          required: true
          schema:
            type: string
          example: Bearer your_access_token
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/v1SignoutRequest"
      responses:
        "200":
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/v1SignoutResponse"
          headers: {}
        "400":
          description: An unexpected error response.
          content:
            application/json:
              schema: *ref_0
              example:
                error: invalid_argument
                error_code: 3
                error_description: device id must less than 72
          headers: {}
        "500":
          description: An unexpected error response.
          content:
            application/json:
              schema: *ref_0
          headers: {}
      security:
        - JWTAuth: []
  /auth/v1/token:
    post:
      summary: Get or Refresh Token
      deprecated: false
      operationId: Auth_GrantToken
      tags:
        - token管理
      parameters:
        - name: client_id
          in: query
          description: Client ID corresponding to the application, defaults to environment ID, can be omitted
          required: false
          schema:
            type: string
        - name: x-device-id
          in: header
          description: Device ID, the ID of the current logged-in device. The client should generate it randomly and cache it on the client. This parameter is related to the number of logged-in accounts.
          required: false
          example: ""
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/v1TokenRequest"
            example:
              client_id: your_client_id
              grant_type: refresh_token
              refresh_token: your_refresh_token

      responses:
        "200":
          description: A successful response.
          content:
            application/json:
              schema: *ref_1
          headers: {}
        "500":
          description: An unexpected error response.
          content:
            application/json:
              schema: *ref_0
          headers: {}
      security: []
      description: |-
        ## API Description
        Get or refresh token API, supports multiple OAuth 2.0 standard authorization modes, used to obtain access_token and refresh_token.
        
        ## Authorization Mode Description
        
        ### 1. Refresh Token Refresh Mode
        #### Input Requirements:
        - `grant_type`: Authorization type (required, fixed value "refresh_token")
        - `refresh_token`: Refresh token (required, used to obtain new access_token)
        - `client_id`: Client ID corresponding to the application (optional, defaults to environment ID)
        - `x-device-id`: Device ID (optional, passed in request header)
        
        #### Prerequisites:
        - Must hold a valid refresh_token
        - refresh_token is not expired and not revoked
        
        #### Output:
        - `token_type`: Token type, fixed as "Bearer"
        - `access_token`: Access token, used to access protected resources
        - `refresh_token`: New refresh token, original refresh_token becomes invalid immediately
        - `expires_in`: access_token expiration time (seconds)
        - `sub`: User unique identifier
        
        #### Refresh Token Refresh Request Example
        ```json
        {
          "client_id": "demo-app-2f8a9c3e1b4d",
          "grant_type": "refresh_token",
          "refresh_token": "m.pQ1rS2tU3vW4xY5zA6bC7dE8fG9hI0jK1lM2nO3pQ4rS5tU6vW7xY8zA9bC0dE1fG2hI3jK4lM5nO6"
        }
        ```
        
        #### Refresh Token Refresh Response Example
        ```json
        {
          "token_type": "Bearer",
          "access_token": "your_access_token",
          "refresh_token": "m.aB3cD4eF5gH6iJ7kL8mN9oP0qR1sT2uV3wX4yZ5aB6cD7eF8gH9iJ0kL1mN2oP3qR4sT5uV6wX7yZ8",
          "expires_in": 7200,
          "sub": "9876543210123456789"
        }
        ```
        
        ### 2. Password Mode Authentication
        #### Input Requirements:
        - `grant_type`: Authorization type (required, fixed value "password")
        - `username`: Username (required)
        - `password`: Password (required)
        - `client_id`: Client ID corresponding to the application (optional, defaults to environment ID)
        - `x-device-id`: Device ID (optional, passed in request header)
        
        #### Prerequisites:
        - User is registered and password is set
        - Username/password login method is enabled
        
        #### Output:
        - `token_type`: Token type, fixed as "Bearer"
        - `access_token`: Access token
        - `refresh_token`: Refresh token
        - `expires_in`: access_token expiration time (seconds)
        - `sub`: User unique identifier
        
        #### Password Mode Request Example
        ```json
        {
          "client_id": "demo-app-2f8a9c3e1b4d",
          "grant_type": "password",
          "username": "zhangsan",
          "password": "your-password"
        }
        ```
        
        #### Password Mode Response Example
        ```json
        {
          "token_type": "Bearer",
          "access_token": "your_access_token",
          "refresh_token": "m.aB3cD4eF5gH6iJ7kL8mN9oP0qR1sT2uV3wX4yZ5aB6cD7eF8gH9iJ0kL1mN2oP3qR4sT5uV6wX7yZ8",
          "expires_in": 7200,
          "sub": "9876543210123456789"
        }
        ```
        
        ### 3. Client Credentials Mode
        #### Input Requirements:
        - `grant_type`: Authorization type (required, fixed value "client_credentials")
        - `client_id`: Client ID corresponding to the application (optional, defaults to environment ID)
        - `Authorization`: Authentication information (required, passed in request header, format "Basic ${base64(SecretId:SecretKey)}")
        
        #### Prerequisites:
        - Must hold valid SecretId and SecretKey
        - Caller must have trusted server-side environment
        - SecretKey must be stored in secure medium
        
        #### Output:
        - `token_type`: Token type, fixed as "Bearer"
        - `access_token`: Access token with super administrator privileges
        - `expires_in`: access_token expiration time (seconds)
        - Note: Does not return refresh_token
        
        #### Client Credentials Mode Request Example
        ```
        POST /auth/v1/token
        Authorization: Basic bG93Y29kZS01ZzlhYzIwdTJhMjdkYTQ2OnNlY3JldF9rZXlfZXhhbXBsZQ==
        Content-Type: application/json
        
        {
          "client_id": "demo-app-2f8a9c3e1b4d",
          "grant_type": "client_credentials"
        }
        ```
        
        #### Client Credentials Mode Response Example
        ```json
        {
          "token_type": "Bearer",
          "access_token": "your_access_token",
          "expires_in": 7200
        }
        ```
        
        ## Field Description
        
        ### Request Parameters
        | Field Name | Type | Required | Description |
        |--------|------|------|------|
        | grant_type | string | Yes | Authorization type, optional values: refresh_token, password, client_credentials |
        | refresh_token | string | No | Refresh token, required when grant_type is refresh_token |
        | username | string | No | Username, required when grant_type is password |
        | password | string | No | Password, required when grant_type is password |
        | client_id | string | No | Client ID, defaults to environment ID |
        | x-device-id | string | No | Device ID, passed in request header |
        | Authorization | string | No | Authentication information, required when grant_type is client_credentials, passed in request header |
        
        ### Response Parameters
        | Field Name | Type | Description |
        |--------|------|------|
        | token_type | string | Token type, fixed as "Bearer" |
        | access_token | string | Access token, used to access protected resources |
        | refresh_token | string | Refresh token, used to obtain new access_token (not returned in client_credentials mode) |
        | expires_in | integer | access_token expiration time (seconds) |
        | sub | string | User unique identifier (service_account in client_credentials mode) |
        
        ## Key Characteristics
        
        ### Refresh Token Refresh Mechanism
        - Conforms to RFC 6749 Section 6 standard
        - Original refresh_token becomes invalid immediately after use
        - Returns new access_token and refresh_token
        - Supports seamless refresh, improving user experience
        
        ### Password Mode
        - Conforms to RFC 6749 Section 4.3 standard
        - Suitable for trusted clients
        - Directly uses username and password to obtain token
        - Returns access_token and refresh_token
        
        ### Client Credentials Mode
        - Conforms to RFC 6749 Section 4.4 standard
        - Suitable for server-side calls
        - Automatically grants super administrator privileges
        - Does not return refresh_token
        - Requires SecretId and SecretKey authentication
        
        ## Security Specifications
        
        ### Refresh Token Security
        - refresh_token should be stored securely on the client
        - Becomes invalid immediately after use, preventing replay attacks
        - Recommend regular rotation of refresh_token
        - Should be revoked immediately when anomalies are detected
        
        ### Password Mode Security
        - Use only in trusted clients
        - Password should be encrypted during transmission (HTTPS)
        - Recommend implementing login failure count limit
        - Support verification code protection mechanism
        
        ### Client Credentials Mode Security
        - SecretKey must be stored in secure medium
        - Use only in trusted server-side environment
        - Regularly rotate SecretKey
        - Record all call audit logs
        - Limit call frequency and IP whitelist
        
        ## Usage Scenarios
        
        ### Refresh Token Refresh
        - Automatically refresh when access_token is about to expire
        - Implement seamless login experience
        - Maintain long-term login state
        
        ### Password Mode
        - User first login
        - Trusted first-party applications
        - Internal management systems
        
        ### Client Credentials Mode
        - Server-side API calls
        - Backend management operations
        - System integration scenarios
        - Operations requiring administrator privileges
        
        ## Notes
        
        ### General Notes
        - All modes require HTTPS transmission
        - access_token should be stored in memory, not recommended for persistence
        - refresh_token should be stored securely to prevent leakage
        - Regularly check token validity
        
        ### Refresh Token Notes
        - Original refresh_token becomes invalid immediately after use
        - Need to handle refresh_token expiration
        - Recommend refreshing before access_token expires
        
        ### Password Mode Notes
        - Not recommended for third-party applications
        - Need to implement password security policy
        - Recommend using with verification code
        
        ### Client Credentials Mode Notes
        - Use only on server-side, not on client-side
        - SecretKey leakage will cause serious security issues
        - Need to implement IP whitelist restriction
        - Recommend implementing call frequency limit

  /auth/v1/revoke:
    post:
      summary: Revoke Token
      deprecated: false
      description: |-
        Revoke a token, similar to logging out, needs to be used in conjunction with the token verification interface. After the token is revoked, the client needs to call the interface to verify the validity of the token.
        - Refer to the API, [Verify Token](/http-api/auth/auth-token-introspect)
      operationId: Auth_Revoke
      tags:
        - token管理
      parameters:
        - name: client_id
          in: query
          description: Client ID corresponding to the application, can be obtained from CloudBase Platform -> Identity Authentication -> Development Settings. Defaults to environment ID, can be omitted
          required: false
          schema:
            type: string
        - name: x-device-id
          in: header
          description: Device ID, the ID of the current logged-in device. The client should generate it randomly and cache it on the client. This parameter is related to the number of logged-in accounts.
          required: false
          example: ""
          schema:
            type: string
        - name: Authorization
          in: header
          description: The user's access_token, format is Bearer xxx
          required: true
          schema:
            type: string
          example: Bearer your_access_token
      requestBody:
        content:
          application/json:
            schema: {}
      responses:
        "200":
          description: A successful response.
          content:
            application/json:
              schema: {}
          headers: {}
        "500":
          description: An unexpected error response.
          content:
            application/json:
              schema: *ref_0
          headers: {}
      security:
        - JWTAuth: []
  /auth/v1/token/introspect:
    get:
      summary: Verify Token
      deprecated: false
      description: |-
        ## API Description
        Verify if the token is valid. If the token is valid, it returns the token information (token_type, client_id, sub, scope, etc.)
        
        ### Input Requirements:
        - `Authorization`: Current logged-in user's access_token (required, passed in request header, format Bearer xxx)
        - `client_id`: Client ID corresponding to the application (optional, defaults to environment ID)
        - `x-device-id`: Device ID (optional, current logged-in device ID)
        
        ### Prerequisites:
        - Need valid access_token
        - Token is not expired and not revoked
        
        ### Output:
        - If token is valid, returns token information (token_type, client_id, sub, scope, etc.)
        - If token is invalid, returns empty object
        
        ### Verify Token Request Example
        ```
        GET /auth/v1/token/introspect
        Authorization: Bearer your_access_token
        x-device-id: device_123456
        ```
        
        ### Verify Token Response Example (Token Valid)
        ```json
        {
          "token_type": "Bearer",
          "client_id": "demo-app-2f8a9c3e1b4d",
          "sub": "9876543210123456789",
          "scope": "user sso"
        }
        ```
        
        ### Verify Token Response Example (Token Invalid)
        ```json
        {}
        ```
        
        ### Usage Scenarios:
        - Client needs to verify if token is still valid
        - Perform token validity check before sensitive operations
        - Verify current token status when implementing token auto-refresh mechanism
        
        ### Notes:
        - This API does not refresh token, only verifies current token validity
        - If token is expired or revoked, returns empty object
        - Recommend implementing token auto-refresh mechanism on client to avoid frequent calls to this API
      operationId: Auth_TokenIntrospect
      tags:
        - token管理
      parameters:
        - name: client_id
          in: query
          description: Client ID corresponding to the application, can be obtained from CloudBase Platform -> Identity Authentication -> Development Settings. Defaults to environment ID, can be omitted
          required: false
          schema:
            type: string
        - name: x-device-id
          in: header
          description: Device ID, the ID of the current logged-in device. The client should generate it randomly and cache it on the client. This parameter is related to the number of logged-in accounts.
          required: false
          example: ""
          schema:
            type: string
        - name: Authorization
          in: header
          description: The user's access_token, format is Bearer xxx
          required: true
          schema:
            type: string
          example: Bearer your_access_token
      requestBody:
        content:
          application/json:
            schema: {}
      responses:
        "200":
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/v1TokenIntrospectResponse"
          headers: {}
        "500":
          description: An unexpected error response.
          content:
            application/json:
              schema: *ref_0
          headers: {}
      security:
        - JWTAuth: []
  /auth/v1/captcha/data:
    post:
      summary: Get Image Verification Code
      deprecated: false
      description: |-
        ## API Description
        Get image verification code API, returns RFC 2397 standard inline image data URI for human-machine verification in login, registration and other scenarios.
        
        ## Input Requirements
        
        ### Request Parameters
        - No parameters required, call directly
        
        ## Prerequisites
        - No special prerequisites
        - Recommend calling when user login fails too many times
        - Can be used in sensitive operations such as registration, password recovery
        
        ## Output Description
        
        ### Successful Response
        - `data`: Image data (required, RFC 2397 standard inline image data URI, format data:image/gif;base64,xxx)
        - `type`: Resource type (required, fixed value "image")
        - `token`: Verification code token (required, used for subsequent verification API)
        - `expires_in`: Expiration time (required, in seconds, default 300 seconds)
        
        ## Request Example
        
        ### Get Image Verification Code Request Example
        ```
        POST /auth/v1/captcha/data
        Content-Type: application/json
        
        {}
        ```
        
        ## Response Example
        
        ### Successful Response Example
        ```json
        {
          "data": "data:image/gif;base64,R0lGODlhyAAyAIcAAAAAAAAARAA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kqf3UUi1OkKJQZQZSZ0LIQiuFh3lGH7fZK2alGF7mhqKSYQ3k6/wUg2jA6emqUsJBsQlUT1uUTT+OiQ5dzhwNmIOjDbXCxBpGVQu/Voxd4EA4nkCTaHF0pTM3CqJD2UGVZiWIpMk3pQjh5KLBADzfRSvh3SUVBf92wqS/qqLYTE+ZBe6/RJi2gma8oIq9BDl6QjfiHZDC0PZmqqilRmZaqEYEnELBaJKfRORMxeOaiHNUhMH+QiwfxQV9hHgVagevzrA8FAiukpq9xGl8SlkHBQgEBADs=",
          "type": "image",
          "token": "aC_raGNycHQOSR7w0V7U0Ble-edJud_-AJofUvLFga8v59WsZVRI_RUBxC9Tk5eUoBNrdPhqA0M_ZkT0V0le909Z7YmWHVT4Yead026_",
          "expires_in": 300
        }
        ```
        
        ## Field Description
        
        ### Response Parameters
        | Field Name | Type | Required | Description |
        |--------|------|------|------|
        | data | string | Yes | Image data, RFC 2397 standard inline image data URI, includes protocol header (data:), MIME type (image/gif), encoding method (base64) and actual data |
        | type | string | Yes | Resource type, fixed value "image" |
        | token | string | Yes | Verification code token, used for subsequent verification API |
        | expires_in | integer | Yes | Expiration time, in seconds, default 300 seconds |
        
        ## Usage Flow
        
        ### 1. Get Verification Code Image
        - Frontend calls this API to get verification code data
        - Assign data field directly to img tag's src attribute
        - Save token properly for subsequent verification
        - Implement refresh verification code function
        
        ### 2. User Inputs Verification Code
        - User recognizes verification code content in image
        - Inputs verification code in input box
        
        ### 3. Submit Verification Code Verification
        - Call [Verify Image Verification Code](/http-api/auth/auth-verify-captcha-data) API
        - Pass token and user input verification code
        - Get captcha_token
        
        ### 4. Business API Authorization
        - Attach request header in business requests requiring verification code protection
        - Request header format: `x-captcha-token: xxx`
        
        ## Key Characteristics
        
        ### Image Format
        - Conforms to RFC 2397 standard Data URI
        - Uses GIF format
        - Base64 encoding
        - Can be used directly in HTML
        
        ### Security
        - Verification code token valid for 300 seconds
        - New verification code generated each time
        - Verification code becomes invalid after use
        - Supports anti-brute-force mechanism
        
        ## Usage Scenarios
        
        ### Login Protection
        - Require verification code when user login fails too many times
        - Prevent brute-force password cracking
        - Protect account security
        
        ### Registration Protection
        - Prevent batch registration
        - Prevent malicious registration
        - Protect system resources
        
        ### Sensitive Operation Protection
        - Password recovery
        - Password modification
        - Binding information modification
        - Account deletion
        
        ## Notes
        
        ### Frontend Implementation
        - Assign data field directly to img tag's src attribute
        - Save token properly for subsequent verification
        - Implement refresh verification code function
        - Need to get new code after expiration
        
        ### Security Recommendations
        - Verification code should be generated on server-side
        - Verification code content should be random and unpredictable
        - Limit acquisition frequency for same IP
        - Record verification code acquisition logs
        
        ### Common Errors
        - Server error: Retry acquisition
        - Network timeout: Check network connection
        - Rate limit: Wait and retry
        
        ### Error Response Example
        ```json
        {
          "error": "rate_limit_exceeded",
          "error_code": 4029,
          "error_description": "Verification code acquisition frequency too high, please try again later"
        }
        ```
        
        ## Related APIs
        - [Verify Image Verification Code](/http-api/auth/auth-verify-captcha-data) - Verify user input verification code
        - [User Login](/http-api/auth/auth-sign-in) - Login API
        - [User Registration](/http-api/auth/auth-sign-up) - Registration API
        
      operationId: Auth_GetCaptchaData
      tags:
        - 验证码
      parameters: []
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: string
                    title: Image Data
                    description: >-
                      RFC 2397 standard inline image data URI, including the following parts: protocol header: data: MIME type: image/gif
                      encoding method: base64 actual data: Base64 encoded binary data conforming to RFC 4648
                  type:
                    type: string
                    title: Type
                    description: 'Enumerated value of resource type: "image" for image resources. Other values are reserved for future expansion.'
                  token:
                    type: string
                    title: Token
                    description: The token to be passed to the verification code verification API
                  expires_in:
                    type: integer
                    title: Expiration Time
                    description: Token expiration time, default 300 seconds
                required:
                  - data
                  - type
                  - token
                  - expires_in
              example:
                data: >-
                  data:image/gif;base64,R0lGODlhyAAyAIcAAAAAAAAARAAAiAAAzABEAABERABEiABEzACIAACIRACIiACIzADMAADMRADMiADMzADd3REREQAAVQAAmQAA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A6emqUsJBsQlUT1uUTT+OiQ5dzhwNmIOjDbXCxBpGVQu/Voxd4EA4nkCTaHF0pTM3CqJD2UGVZiWIpMk3pQjh5KLBADzfRSvh3SUVBf92wqS/qqLYTE+ZBe6/RJi2gma8oIq9BDl6QjfiHZDC0PZmqqilRmZaqEYEnELBaJKfRORMxeOaiHNUhMH+QiwfxQV9hHgVagevzrA8FAiukpq9xGl8SlkHBQgEBADs=
                type: image
                token: >-
                  aC_raGNycHQOSR7w0V7U0Ble-edJud_-AJofUvLFga8v59WsZVRI_RUBxC9Tk5eUoBNrdPhqA0M_ZkT0V0le909Z7YmWHVT4Yead026_
                expires_in: 300
          headers: {}
      security: []
  /auth/v1/captcha/data/verify:
    post:
      summary: Verify Image Verification Code
      deprecated: false
      description: |-
        ## API Description
        Verify image verification code API, used to verify if user input verification code is correct. Returns captcha_token after successful verification for subsequent business API human-machine verification.
        
        ## Input Requirements
        
        ### Required Parameters
        - `token`: Verification code token (required, obtained from [Get Image Verification Code](/http-api/auth/auth-get-captcha-data) API)
        - `key`: Verification code content (required, verification code text input by user after recognizing image)
        
        ## Prerequisites
        - Must first call [Get Image Verification Code](/http-api/auth/auth-get-captcha-data) API to get verification code
        - Token not expired (default validity 300 seconds)
        - Verification code not used
        
        ## Output Description
        
        ### Successful Response
        - `captcha_token`: Verification code token (required, used for subsequent business API human-machine verification)
        - `expires_in`: Expiration time (required, in seconds, default 300 seconds)
        
        ## Request Example
        
        ### Verify Image Verification Code Request Example
        ```json
        {
          "token": "aC_raGNycHQOSR7w0V7U0Ble-edJud_-AJofUvLFga8v59WsZVRI_RUBxC9Tk5eUoBNrdPhqA0M_ZkT0V0le909Z7YmWHVT4Yead026_",
          "key": "AB12"
        }
        ```
        
        ## Response Examples
        
        ### Verification Success Response Example
        ```json
        {
          "captcha_token": "your_access_token",
          "expires_in": 300
        }
        ```
        
        ### Verification Failure Response Example
        ```json
        {
          "error": "invalid_captcha",
          "error_code": 4001,
          "error_description": "Verification code error"
        }
        ```
        
        ### Verification Code Expired Response Example
        ```json
        {
          "error": "captcha_expired",
          "error_code": 4002,
          "error_description": "Verification code expired, please get new one"
        }
        ```
        
        ### Verification Code Already Used Response Example
        ```json
        {
          "error": "captcha_used",
          "error_code": 4003,
          "error_description": "Verification code already used, please get new one"
        }
        ```
        
        ## Field Description
        
        ### Request Parameters
        | Field Name | Type | Required | Description |
        |--------|------|------|------|
        | token | string | Yes | Verification code token, obtained from /auth/v1/captcha/data API |
        | key | string | Yes | Verification code text input by user after recognizing image, case-insensitive |
        
        ### Response Parameters
        | Field Name | Type | Required | Description |
        |--------|------|------|------|
        | captcha_token | string | Yes | Verification code token, used for subsequent business API human-machine verification |
        | expires_in | integer | Yes | Expiration time, in seconds, default 300 seconds |
        
        ## Usage Flow
        
        ### 1. Get Verification Code
        - Call [Get Image Verification Code](/http-api/auth/auth-get-captcha-data) API
        - Get verification code image and token
        
        ### 2. User Inputs Verification Code
        - User recognizes verification code in image
        - Inputs verification code in input box
        
        ### 3. Verify Verification Code
        - Call this API to verify user input
        - Pass token and user input key
        - Get captcha_token
        
        ### 4. Use captcha_token
        - In business APIs requiring verification code protection
        - Add request header: `x-captcha-token: xxx`
        - Complete human-machine verification
        
        ## Key Characteristics
        
        ### Verification Rules
        - Case-insensitive
        - Verification code length 4-6 characters
        - Supports numbers and letters
        - Verification failure does not affect token validity
        
        ### Security
        - Verification code becomes invalid immediately after use
        - Limit verification failure attempts
        - Prevent brute-force cracking
        - Record verification logs
        
        ## Usage Scenarios
        
        ### Login Protection
        - Require verification code when login fails too many times
        - Allow login after verification passes
        - Prevent brute-force cracking
        
        ### Registration Protection
        - Require verification code during registration
        - Prevent batch registration
        - Protect system resources
        
        ### Sensitive Operation Protection
        - Verify during password recovery
        - Verify during password modification
        - Verify during binding information modification
        - Verify during account deletion
        
        ## Notes
        
        ### Verification Code Input
        - Case-insensitive
        - Trim leading/trailing spaces
        - Can retry on verification failure
        - Need to get new code after expiration
        
        ### Error Handling Strategy
        - Verification code error: Allow retry, get new code after exceeding attempts
        - Verification code expired: Auto refresh verification code
        - Verification code already used: Auto refresh verification code
        - Network error: Retry mechanism
        
        ## Related APIs
        - [Get Image Verification Code](/http-api/auth/auth-get-captcha-data) - Get verification code image
        - [User Login](/http-api/auth/auth-sign-in) - Login API
        - [User Registration](/http-api/auth/auth-sign-up) - Registration API
        - [Modify Password](/http-api/auth/user-update-password) - Modify password API
        
      operationId: Auth_VerifyCaptchaData
      tags:
        - 验证码
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                token:
                  type: string
                  title: Verification code verification token
                  description: Obtained from the /auth/v1/captcha/data interface
                key:
                  type: string
                  title: Text content identified in the verification code
              required:
                - token
                - key
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  captcha_token:
                    type: string
                    title: Verification code token
                  expires_in:
                    type: integer
                    title: Expiration Time, default 600 seconds
                required:
                  - captcha_token
                  - expires_in
              example:
                captcha_token: >-
                  v1.aC_uW2NycHQOSR7w0V7U4RtK5aYN-pTwGMhoIenRvZI0rsCSeRNG80dA3DcSnJSOsRVoZu4tDU1-N1zsFgcdoEIZttimdkGtQpbJ3Dud9Oou
                expires_in: 600
          headers: {}
      security: []
  /auth/v1/verification:
    post:
      summary: Send SMS, Email Verification Code
      deprecated: false
      description: |-
        ## API Description
        Send SMS or email verification code API, used to send verification code to user's phone number or email, supports multiple scenarios such as login, registration, password recovery.
        
        This API supports two modes:
        - **Verification Code Mode (Default)**: Sends a 6-digit verification code to the user's phone or email. The user needs to manually enter the code to complete verification.
        - **Magic Link Mode**: Enabled when the `email_redirect_to` parameter is included in the request body. Only supports email (`email` parameter), not phone number. In this mode the email body is rendered from the **email template** of the email identity provider: the server injects the one-time login link into the template variable `{{.ConfirmationURL}}`. Clicking that link completes login/registration and redirects the user to the page specified by `email_redirect_to`. Therefore this mode **must be used together with an email template that contains the `{{.ConfirmationURL}}` variable**. See [Magic Link Email Template Configuration](#magic-link-email-template) for details.
        
        ## Input Requirements
        
        ### Required Parameters
        - `target`: Target for sending verification code (required, optional values: ANY, USER)
          - `ANY`: No restriction, send regardless of whether user exists
          - `USER`: Account must exist in system to send
        
        ### Optional Parameters (Choose One)
        - `phone_number`: Phone number (optional, valid domestic phone number, needs "+86 " prefix, e.g., "+86 15588665555")
        - `email`: Email (optional, valid email address, format abc@xxx)
        
        ### Magic Link Parameters
        - `email_redirect_to`: Redirect URL (optional, string type). The target page URL to redirect to after successful login. Including this parameter triggers Magic Link mode, changing email content from verification code text to a login link email rendered from the email template.
          - Must provide a full URL, e.g., `https://envId-appid.tcloudbaseapp.com/dashboard`
          - Only effective when `email` parameter is provided, does not support use with `phone_number`
          - Once provided, the server renders the `{{.ConfirmationURL}}` variable in the email template. If the template does not contain this variable, the email received by the user will not contain a login link
        
        ### Request Header Parameters
        - `x-captcha-token`: Verification code token (optional, obtained from [Verify Image Verification Code](/http-api/auth/auth-verify-captcha-data) API, required when API returns captcha_required error)
        
        ## Prerequisites
        - Need to enable phone number or email login on CloudBase Platform
        - Phone number and email cannot be passed simultaneously, must choose one
        - When API returns captcha_required error, need to complete image verification code verification first
        - **Magic Link Mode Additional Requirements**:
          - The email template of the email identity provider must contain the `{{.ConfirmationURL}}` variable, otherwise no login link appears in the email. See [Magic Link Email Template Configuration](#magic-link-email-template)
          - The domain in `email_redirect_to` must be a configured custom domain or CloudBase default domain, otherwise users may get a 404 error when clicking the link
        
        ## Magic Link Email Template Configuration {#magic-link-email-template}
        
        Magic Link mode does not send an email with a fixed layout. Instead, it reuses the email template of the email identity provider: when rendering the template, the server writes the generated one-time login link into the template variable `{{.ConfirmationURL}}`. Therefore you need to configure the template before using Magic Link.
        
        ### Template Variables
        
        | Variable | Applicable Mode | Description |
        |----------|-----------------|-------------|
        | `{{.ConfirmationURL}}` | Magic Link mode | One-time login link. After the user clicks it, the CloudBase authentication service verifies it and redirects to the page specified by `email_redirect_to` |
        | `{{.VerificationCode}}` | Verification code mode | 6-digit verification code |
        | `{{.Email}}` | Both modes | Recipient email address |
        | `{{.ExpireMinutes}}` | Both modes | Validity period, in minutes |
        | `{{.Usage}}` | Both modes | Usage description |
        
        ### Template Example
        
        ```html
        <h1>Confirm Login</h1>
        <p>Hi {{.Email}}, please click the button below to sign in:</p>
        <p>
          <a
            href="{{.ConfirmationURL}}"
            style="display:inline-block;padding:10px 20px;background:#0052d9;color:#ffffff;text-decoration:none;border-radius:4px;"
          >
            Confirm Email and Login
          </a>
        </p>
        <p>The link is valid for {{.ExpireMinutes}} minutes and can only be used once.</p>
        ```
        
        ### How to Configure
        
        Go to [CloudBase Platform/Authentication/Login Methods](https://tcb.cloud.tencent.com/dev?#/identity/login-manage) and configure the email template in the "Email Verification Code" card.
        
        :::warning Note
        If the email template does not contain the `{{.ConfirmationURL}}` variable, this API still returns success, but the email received by the user will not contain a login link and Magic Link login cannot be completed.
        :::
        
        ## Output Description
        
        ### Verification Code Mode (without email_redirect_to) Successful Response
        - `verification_id`: Verification code ID (required, used for subsequent verification API)
        - `expires_in`: Expiration time (required, in seconds, default 600 seconds)
        - `is_user`: Whether user exists (optional, true means registered, false or empty means not registered)
        
        ### Magic Link Mode (with email_redirect_to) Successful Response
        - `expires_in`: Expiration time (required, in seconds, default 600 seconds)
        - `is_user`: Whether user exists (optional, true means registered, false or empty means not registered)
        
        In Magic Link mode, the one-time login link is embedded in the email through the `{{.ConfirmationURL}}` template variable. Users do not need to manually verify, and the response does not include the `verification_id` field.
        
        ## Request Examples
        
        ### Send Email Verification Code Request Example (Verification Code Mode)
        ```json
        {
          "email": "user@example.com",
          "target": "ANY"
        }
        ```
        
        ### Send Phone Number Verification Code Request Example (Verification Code Mode)
        ```json
        {
          "phone_number": "+86 13800138000",
          "target": "ANY"
        }
        ```
        
        ### Send Verification Code to Existing User Request Example (Verification Code Mode)
        ```json
        {
          "email": "user@example.com",
          "target": "USER"
        }
        ```
        
        ### Send Magic Link Email Request Example (Magic Link Mode)
        ```json
        {
          "email": "user@example.com",
          "target": "ANY",
          "email_redirect_to": "https://envId-appid.tcloudbaseapp.com/dashboard"
        }
        ```
        
        ## Response Examples
        
        ### Verification Code Mode - Send Success Response Example
        ```json
        {
          "verification_id": "your_verification_id",
          "expires_in": 600,
          "is_user": true
        }
        ```
        
        ### Magic Link Mode - Send Success Response Example
        ```json
        {
          "expires_in": 600,
          "is_user": true
        }
        ```
        
        ### Image Verification Code Required Response Example
        ```json
        {
          "error": "captcha_required",
          "error_code": 4028,
          "error_description": "Need to complete image verification code verification"
        }
        ```
        
        ### Phone Number Format Error Response Example
        ```json
        {
          "error": "invalid_phone_number",
          "error_code": 4001,
          "error_description": "Phone number format error, needs +86 prefix"
        }
        ```
        
        ### User Not Found Response Example
        ```json
        {
          "error": "user_not_found",
          "error_code": 4004,
          "error_description": "User does not exist"
        }
        ```
        
        ### Send Frequency Too High Response Example
        ```json
        {
          "error": "rate_limit_exceeded",
          "error_code": 4029,
          "error_description": "Verification code send frequency too high, please try again in 60 seconds"
        }
        ```
        
        ## Field Description
        
        ### Request Parameters
        | Field Name | Type | Required | Description |
        |--------|------|------|------|
        | target | string | Yes | Send target, optional values: ANY (no restriction), USER (user must exist)|
        | phone_number | string | No | Phone number, format "+86 phone_number", choose one with email |
        | email | string | No | Email address, choose one with phone_number |
        | email_redirect_to | string | No | Redirect URL. Including this parameter triggers Magic Link mode, and the server renders the one-time login link into the `{{.ConfirmationURL}}` variable of the email template. Must provide full URL. Only used with email parameter |
        | x-captcha-token | string | No | Image verification code token, passed in request header, required when API returns captcha_required error |
        
        ### Response Parameters (Verification Code Mode - without email_redirect_to)
        | Field Name | Type | Required | Description |
        |--------|------|------|------|
        | verification_id | string | Yes | Verification code ID, used for subsequent verification API |
        | expires_in | integer | Yes | Expiration time, in seconds, default 600 seconds |
        | is_user | boolean | No | Whether user exists, true means registered |
        
        ### Response Parameters (Magic Link Mode - with email_redirect_to)
        | Field Name | Type | Required | Description |
        |--------|------|------|------|
        | expires_in | integer | Yes | Expiration time, in seconds, default 600 seconds |
        | is_user | boolean | No | Whether user exists, true means registered |
        
        ## Usage Flow
        
        ### Flow 1: Verification Code Mode (Default, without email_redirect_to)
        
        #### 1. Determine if Image Verification Code is Needed
        - Can call directly for first send
        - If returns captcha_required error, need to complete image verification code verification first
        
        #### 2. Send Verification Code
        - Call this API to send verification code
        - Choose target parameter based on scenario
        - Pass phone number or email
        
        #### 3. User Receives Verification Code
        - User receives verification code in phone or email
        - Verification code valid for 600 seconds (10 minutes)
        
        #### 4. Verify Verification Code
        - Call [Verify SMS, Email Verification Code](/http-api/auth/auth-verify-verification) API
        - Pass verification_id and user input verification code
        - Get verification_token
        
        #### 5. Subsequent Operations
        - If is_user is true, use verification_token to call login API
        - If is_user is false or empty, use verification_token to call registration API
        
        ### Flow 2: Magic Link Mode (with email_redirect_to)
        
        #### 1. Configure the Email Template
        - Add the `{{.ConfirmationURL}}` variable to the email template of the email identity provider. See [Magic Link Email Template Configuration](#magic-link-email-template)
        - This is a one-time configuration; afterwards all Magic Link emails are rendered from this template
        
        #### 2. Frontend Calls Send API
        - Call this API, include `email` and `email_redirect_to` parameters in the request body
        - Backend detects `email_redirect_to`, automatically switches to Magic Link mode, and renders the one-time login link at the `{{.ConfirmationURL}}` position of the template
        
        #### 3. User Receives Email and Clicks Link
        - User receives the email rendered from the template and clicks the login link inside it
        - The CloudBase authentication service verifies the one-time credential in the link, completes login/registration, and redirects to the target page specified by `email_redirect_to`
        - User is already logged in when arriving at the target page and can use the application directly
        
        ## Key Characteristics
        
        ### Verification Code Characteristics
        - Verification code length is 6 digits
        - Valid for 600 seconds (10 minutes)
        - Same phone number or email can only send once within 60 seconds
        - Verification code becomes invalid immediately after use
        
        ### Security
        - Limit send frequency to prevent SMS bombing
        - Support image verification code protection
        - Record send logs
        
        ## Usage Scenarios
        
        ### Scenario 1: Verification Code Login (target=ANY, without email_redirect_to)
        - User logs in with phone number or email
        - No restriction on whether user exists
        - Suitable for login or registration flow
        
        ### Scenario 2: Password Recovery (target=USER, without email_redirect_to)
        - User forgets password
        - Must be registered user
        - Prevent user information leakage
        
        ### Scenario 3: Registration Verification (target=ANY, without email_redirect_to)
        - User registers new account
        - Must be unregistered user
        - Prevent duplicate registration
        
        ### Scenario 4: Magic Link One-Click Login (target=ANY, with email_redirect_to)
        - User logs in via email with one click, no need to manually enter verification code
        - Email is rendered from the configured email template, in which `{{.ConfirmationURL}}` is the login link; clicking it completes login and redirects to the specified page
        - If user is not registered, clicking the link will automatically complete registration and login
        
        #### Magic Link Scenario Example: SaaS Application Invite Login
        1. SaaS application sends Magic Link to user's email, `email_redirect_to` set to application's Dashboard page
        2. User receives email and clicks the login link rendered from `{{.ConfirmationURL}}` in the template
        3. Browser automatically completes login, redirects to Dashboard page
        
        ```json
        // Request Example
        {
          "email": "invitee@company.com",
          "target": "ANY",
          "email_redirect_to": "https://envId-appid.tcloudbaseapp.com/dashboard?from=invite"
        }
        ```
        
        ```json
        // Response Example
        {
          "expires_in": 600,
          "is_user": false
        }
        ```
        
        #### Magic Link Scenario Example: Content Subscription Email with Embedded Login
        1. Content platform sends Magic Link to subscriber, `email_redirect_to` set to an article page
        2. User receives email in inbox, clicks the link
        3. Automatically logs in and redirects to article page for reading
        
        ```json
        // Request Example
        {
          "email": "reader@example.com",
          "target": "USER",
          "email_redirect_to": "https://envId-appid.tcloudbaseapp.com/articles/12345"
        }
        ```
        
        ## Notes
        
        ### Phone Number Format
        - Must add "+86 " prefix
        - Format example: "+86 13800138000"
        - Does not support other country phone numbers
        
        ### Email Format
        - Must be valid email address
        - Format example: "user@example.com"
        - Supports common email service providers
        
        ### Send Frequency Limit
        - Same phone number or email can only send once within 60 seconds
        - Same IP can send maximum 10 times per hour
        - Need to wait after exceeding limit
        
        ### Image Verification Code
        - Require image verification code when abnormal send behavior detected
        - Need to call image verification code API to complete verification first
        - Pass captcha_token in request header after obtaining
        
        ### email_redirect_to Parameter Rules (Magic Link Mode)
        - `email_redirect_to` only effective when `email` parameter is provided, does not support `phone_number`
        - Must provide a full URL (e.g., `https://envId-appid.tcloudbaseapp.com/dashboard`), relative paths are not supported
        - The domain in `email_redirect_to` must be a configured custom domain or CloudBase default domain, otherwise users may get a 404 error when clicking the link
        - The email body is rendered from the email template, which must contain the `{{.ConfirmationURL}}` variable, otherwise no login link appears in the email
        - Magic Link validity is the same as verification code, 600 seconds (10 minutes), link expires after that
        - Verification code is single-use, link becomes invalid after completing login, cannot be reused
        
        ### Magic Link Security
        - Links in email enforce HTTPS protocol
        - Token does not appear in URL
        - Verification parameters in URL are automatically cleared after login is complete
                
        ### Error Handling Strategy
        - Friendly error messages
        - Auto handle image verification code flow
        - Implement send countdown
        - Record error logs
        
        ## Related APIs
        - [Verify SMS, Email Verification Code](/http-api/auth/auth-verify-verification) - Verify verification code
        - [Verify Image Verification Code](/http-api/auth/auth-verify-captcha-data) - Get captcha_token
        - [Get Image Verification Code](/http-api/auth/auth-get-captcha-data) - Get image verification code
        - [User Login](/http-api/auth/auth-sign-in) - Use verification_token to login
        - [User Registration](/http-api/auth/auth-sign-up) - Use verification_token to register
        - [Email Template Configuration](../../api-reference/manager/node/login-config#emailtemplateconfig) - Configure the Magic Link email template

      operationId: Auth_SendVerification
      tags:
        - 验证码
      parameters:
        - name: x-captcha-token
          in: header
          description: Verification code token, obtained from the image verification code interface, needs to be passed when the interface reports captcha_required
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                phone_number:
                  type: string
                  title: Phone Number
                  description: Valid domestic phone number, needs to be prefixed with "+86 ", e.g., "+86 15588665555"
                email:
                  type: string
                  title: Email
                  description: Valid email, format abc@xxx
                target:
                  type: string
                  title: Target for sending verification code
                  description: Pass ANY, other optional values are USER (account must exist in the system)
                email_redirect_to:
                  type: string
                  title: Redirect URL
                  description: The target URL to redirect to after successful login. Including this parameter triggers Magic Link mode, and the server renders the one-time login link into the {{.ConfirmationURL}} variable of the email template, so it must be used together with a template containing that variable. Must provide a full URL (e.g., https://envId-appid.tcloudbaseapp.com/dashboard), relative paths are not supported. Only used with email parameter, does not support phone_number
              required:
                - target
            example:
              email: demouser@example.com
              target: ANY
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  verification_id:
                    type: string
                    title: Verification Code ID
                    description: Used to pass to the verify SMS, email verification code /auth/v1/verification/verify interface for verification code verification
                  expires_in:
                    type: integer
                    title: Verification code expiration time, in seconds
                  is_user:
                    type: boolean
                    title: User Exists
                    description: Determine whether this phone number or email has been registered as a user, returns true if registered
              example:
                verification_id: >-
                  your_verification_id
                expires_in: 600
          headers: {}
      security: []
  /auth/v1/verification/verify:
    post:
      summary: Verify SMS, Email Verification Code
      deprecated: false
      description: |-
        ## API Description
        Verification code verification API, used to verify if verification code received by phone or email is correct, returns verification_token for subsequent login or registration operations
        
        ### Features
        - Supports phone number verification code verification
        - Supports email verification code verification
        - Returns verification_token for subsequent identity verification flow
        - Verification code valid for 600 seconds (10 minutes)
        
        ## Input Requirements
        
        ### Required Parameters
        - `verification_id`: Verification code ID (required, obtained from send SMS, email verification code API response)
        - `verification_code`: Verification code (required, verification code received by phone or email)
        
        ### Optional Parameters
        - `client_id`: Client ID corresponding to the application (optional, defaults to environment ID)
        - `x-device-id`: Device ID (optional, current logged-in device ID)
        
        ## Prerequisites
        - Need to first call [Send SMS, Email Verification Code](/http-api/auth/auth-send-verification) API to get verification code
        - Verification code must be within validity period (default 600 seconds)
        - verification_id must match the ID returned when sending verification code
        
        ## Output Description
        
        ### Successful Response
        - `verification_token`: Verification code token, used for subsequent login or registration API
        - `expires_in`: Expiration time, default 600 seconds
        
        ## Request Example
        
        ### Verification Code Verification Request Example
        ```
        POST /auth/v1/verification/verify
        Content-Type: application/json
        
        {
          "verification_id": "your_verification_id",
          "verification_code": "123456"
        }
        ```
        
        ## Response Examples
        
        ### Verification Code Verification Success Response
        ```json
        {
          "verification_token": "your_verification_token",
          "expires_in": 600
        }
        ```
        
        ### Verification Code Verification Failure Response
        ```json
        {
          "error": "invalid_verification_code",
          "error_code": 4001,
          "error_description": "Verification code error, please re-enter"
        }
        ```
        
        ## Usage Flow
        
        ### 1. Send Verification Code
        - Call send SMS or email verification code API
        - Get verification_id and verification code
        
        ### 2. User Inputs Verification Code
        - User gets verification code from phone or email
        - Inputs verification code on client
        
        ### 3. Verify Verification Code
        - Call this API to verify verification code
        - Get verification_token
        
        ### 4. Use Verification Token
        - Use verification_token to call login or registration API
        
        ## Key Characteristics
        
        ### Security
        - Short verification code validity period prevents brute-force cracking
        - verification_id bound to verification code prevents replay attacks
        - Support verification code error count limit
        
        ### Compatibility
        - Supports phone number and email verification codes
        - Verification code format is 6 digits
        - Internationalization support, supports different country phone number formats
        
        ### Error Handling
        - Provide clear error message when verification code is wrong
        - Prompt to get new code when verification code expires
        - Prompt to resend verification code when verification code ID does not exist
        
        ## Notes
        
        ### Security Recommendations
        - Verification code should not be stored on client
        - Verification code send frequency should be limited
        - Recommend implementing verification code error count limit
        
        ### Usage Scenarios
        - Verify identity during login
        - Verify phone number or email during registration
        - Secondary verification when modifying sensitive information
        - Identity verification during password recovery
        
        ## Related APIs
        - [Send SMS, Email Verification Code](/http-api/auth/auth-send-verification) - Get verification code
        - [Login API](/http-api/auth/auth-sign-in) - Use verification_token to login
        - [Registration API](/http-api/auth/auth-sign-up) - Use verification_token to register
      operationId: Auth_VerifyVerification
      tags:
        - 验证码
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                verification_id:
                  type: string
                  title: Verification Code ID
                  description: Obtained from the response of the Send SMS, Email Verification Code API
                verification_code:
                  type: string
                  title: Verification Code
                  description: Verification code received by phone or email, expiration time defaults to 600 seconds
              required:
                - verification_id
                - verification_code
            example:
              verification_id: >-
                your_verification_id
              verification_code: "123456"
      responses:
        "200":
          description: ""
          content:
            application/json:
              schema:
                type: object
                properties:
                  verification_token:
                    type: string
                    title: Verification code token
                    description: Used to pass to the verify SMS, email verification code /auth/v1/signin interface login when logging in with phone number + verification code or email + verification code
                  expires_in:
                    type: integer
                    title: Expiration Time
                    description: default 600 seconds
          headers: {}
      security: []
  /auth/v1/user/reauthenticate:
    post:
      summary: Reauthenticate
      deprecated: false
      description: |-
        ## API Description
        Send an email or SMS verification code to the currently logged-in user for executing sensitive operations such as modifying user password and deleting user.
        
        ### Features
        - Send email or SMS verification code to the currently logged-in user
        - Verification code valid for 300 seconds (5 minutes)
        - Enhances security and prevents accidental operations
        - Used for secondary verification of sensitive operations
        
        ## Input Requirements
        
        ### Required Parameters
        - `Authorization`: Current logged-in user's access_token (required, Bearer format)
        - `client_id`: Client ID corresponding to the application (optional, defaults to environment ID)
        - `x-device-id`: Device ID (optional, current logged-in device ID)
        
        ### Request Body Parameters
        - `verify_opt`: Verification method (required, valid values: `phone_code` to send SMS verification code, `email_code` to send email verification code)
        
        ## Prerequisites
        - User must be logged in and hold valid access_token
        - User must have a phone number or email address bound to their account, otherwise the API call will fail
        - Sensitive operations require secondary verification to enhance security
        
        ## Output Description
        
        ### Successful Response
        - Returns empty object `{}`, indicating verification code sent successfully
        
        ## Request Examples
        
        ### Send Email Verification Code Request Example
        ```
        POST /auth/v1/user/reauthenticate
        Authorization: Bearer your_access_token
        Content-Type: application/json
        
        {
          "verify_opt": "email_code"
        }
        ```
        
        ### Send SMS Verification Code Request Example
        ```
        POST /auth/v1/user/reauthenticate
        Authorization: Bearer your_access_token
        Content-Type: application/json
        
        {
          "verify_opt": "phone_code"
        }
        ```
        
        ## Response Examples
        
        ### Send Success Response
        ```json
        {}
        ```
        
        ### Verification Failure Response
        ```json
        {
          "error": "invalid_argument",
          "error_code": 4001,
          "error_description": "Invalid verification method, please use phone_code or email_code"
        }
        ```
        
        ## Usage Flow
        
        ### 1. User Login
        - User obtains access_token through normal login process
        
        ### 2. Initiate Reauthentication
        - Call this API to choose verification method (SMS or email)
        - System sends verification code to user
        
        ### 3. User Receives Verification Code
        - User checks verification code in phone or email
        - Verification code valid for 300 seconds (5 minutes)
        
        ### 4. Execute Sensitive Operations
        - Pass verification code in subsequent sensitive operations (such as modifying password, deleting user) to complete secondary verification
        
        ## Key Characteristics
        
        ### Security
        - Secondary verification ensures operation security
        - Short verification code validity period (5 minutes) prevents abuse
        - Supports both SMS and email verification methods
        
        ### Verification Methods
        - `phone_code`: Send SMS verification code to user's bound phone number
        - `email_code`: Send email verification code to user's bound email address
        
        ## Related APIs
        - [Modify Password](/http-api/auth/user-update-password) - Modify user password
        - [Delete User](/http-api/auth/user-me) - Delete current user
        - [Get User Information](/http-api/auth/user-me) - Get current user information

      operationId: User_Reauthenticate
      tags:
        - 用户管理
      parameters:
        - name: client_id
          in: query
          description: Client ID corresponding to the application, can be obtained from CloudBase Platform -> Identity Authentication -> Development Settings. Defaults to environment ID, can be omitted
          required: false
          schema:
            type: string
        - name: x-device-id
          in: header
          description: Device ID, the ID of the current logged-in device. The client should generate it randomly and cache it on the client. This parameter is related to the number of logged-in accounts.
          required: false
          example: ""
          schema:
            type: string
        - name: Authorization
          in: header
          description: The access_token of the current logged-in user, format is Bearer xxx
          required: true
          schema:
            type: string
          example: Bearer your_access_token
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/v1ReauthenticateRequest"
      responses:
        "200":
          description: A successful response.
          content:
            application/json:
              schema:
                type: object
                properties: {}
          headers: {}
        "500":
          description: An unexpected error response.
          content:
            application/json:
              schema: *ref_0
          headers: {}
      security:
        - JWTAuth: []
  /auth/v1/user/me:
    get:
      summary: Get Current User Information
      deprecated: false
      description: |-
        ## API Description
        Get the current logged-in user's basic information, including user profile, bound identity sources, role permissions, etc.
        
        ### Input Requirements:
        - `Authorization`: Current logged-in user's access_token (required, passed in request header, format Bearer xxx)
        - `client_id`: Client ID corresponding to the application (optional, defaults to environment ID)
        - `x-device-id`: Device ID (optional, current logged-in device ID)
        
        ### Prerequisites:
        - Need valid access_token
        - User must be logged in
        
        ### Output:
        - Returns complete user information object (v1Profile)
        - Includes user basic information, bound identity sources, role permissions, status, etc.
        
        ### Get User Information Request Example
        ```
        GET /auth/v1/user/me
        Authorization: Bearer your_access_token
        x-device-id: device_123456
        ```
        
        ### Get User Information Response Example
        ```json
        {
          "sub": "9876543210123456789",
          "name": "Zhang San",
          "picture": "https://example/avatar.jpg",
          "username": "zhangsan",
          "email": "zhangsan@example",
          "phone_number": "+86 13000000000",
          "providers": [
            {
              "id": "email",
              "provider_user_id": "zhangsan@example",
              "name": "Email Login",
              "picture": "",
              "url": "",
              "meta": {}
            }
          ],
          "status": "ACTIVE",
          "gender": "MALE",
          "groups": [
            {
              "id": "user"
            }
          ],
          "meta": {
            "department": "Technology Department",
            "position": "Development Engineer"
          },
          "created_at": "2023-01-01T00:00:00Z",
          "updated_at": "2023-01-15T10:30:00Z",
          "password_updated_at": "2023-01-01T00:00:00Z",
          "user_id": "9876543210123456789",
          "has_password": true,
          "internal_user_type": "generalUser",
          "type": "external",
          "user_source": 1,
          "user_desc": "Regular User",
          "last_login": "2023-01-15T10:30:00Z"
        }
        ```
        
        ### Usage Scenarios:
        - Get personal information after user login
        - Display user profile page
        - Check user permissions and roles
        - Get user's bound login methods
        
        ### Key Characteristics:
        - Returns complete user information, including sensitive information (email, phone number, etc.)
        - Includes all identity sources bound to user
        - Shows user status and role permissions
        - Provides user extended information (meta field)
      operationId: User_Me
      tags:
        - 用户管理
      parameters:
        - name: client_id
          in: query
          description: Client ID corresponding to the application, can be obtained from CloudBase Platform -> Identity Authentication -> Development Settings. Defaults to environment ID, can be omitted
          required: false
          schema:
            type: string
        - name: x-device-id
          in: header
          description: Device ID, the ID of the current logged-in device. The client should generate it randomly and cache it on the client. This parameter is related to the number of logged-in accounts.
          required: false
          example: ""
          schema:
            type: string
        - name: Authorization
          in: header
          description: The access_token of the current logged-in user, format is Bearer xxx
          required: true
          schema:
            type: string
          example: Bearer your_access_token
      requestBody:
        content:
          application/json:
            schema: {}
      responses:
        "200":
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/v1Profile"
          headers: {}
        "500":
          description: An unexpected error response.
          content:
            application/json:
              schema: *ref_0
          headers: {}
      security:
        - JWTAuth: []
    delete:
      summary: Delete Current User Information
      deprecated: false
      description: |-
        ## API Description
        Delete current user information, requires sending a verification code via the [Reauthenticate](/http-api/auth/user-reauthenticate) API for secondary verification before execution. This operation will permanently delete the user account and related data, please use with caution.
        
        ### Features
        - Permanently delete current user account
        - Requires verification code from reauthenticate API for secondary verification to ensure security
        - Cannot be recovered after deletion, use with caution
        - Supports both soft delete and hard delete modes
        
        ## Input Requirements
        
        ### Required Parameters
        - `Authorization`: Current logged-in user's access_token (required, Bearer format)
        - `verify_code`: Verification code (required, the code sent to user's phone or email via [Reauthenticate](/http-api/auth/user-reauthenticate) API)
        - `client_id`: Client ID corresponding to the application (optional, defaults to environment ID)
        - `x-device-id`: Device ID (optional, current logged-in device ID)
        
        ### Request Body Parameters
        - No request body parameters
        
        ## Prerequisites
        - User must be logged in and hold valid access_token
        - Must send verification code via [Reauthenticate](/http-api/auth/user-reauthenticate) API and complete verification
        - Verification code valid for 300 seconds (5 minutes)
        - User confirms to delete their own account
        
        ## Output Description
        
        ### Successful Response
        - Returns empty object, indicating successful deletion
        
        ## Request Example
        
        ### Delete User Request Example
        ```
        DELETE /auth/v1/user/me?verify_code=121688
        Authorization: Bearer your_access_token
        Content-Type: application/json
        ```
        
        ## Response Examples
        
        ### Delete Success Response
        ```json
        {}
        ```
        
        ### Verification Token Invalid Response
        ```json
        {
          "error": "permission_denied",
          "error_code": 7,
          "error_description": "bad verification token"
        }
        ```
        
        ### User Not Found Response
        ```json
        {
          "error": "user_not_found",
          "error_code": 4004,
          "error_description": "User does not exist or has been deleted"
        }
        ```
        
        ## Usage Flow
        
        ### 1. Initiate Reauthentication
        - Call [Reauthenticate API](/http-api/auth/user-reauthenticate) to send verification code
        - Choose SMS or email method to receive verification code
        
        ### 2. User Receives Verification Code
        - User checks verification code in phone or email
        - Verification code valid for 300 seconds (5 minutes)
        
        ### 3. Confirm Deletion
        - Frontend should display confirmation dialog
        - User confirms deletion operation
        
        ### 4. Execute Deletion
        - Call this API to delete user
        - Pass verify_code (the verification code received by user) for secondary verification
        
        ### 5. Clean Client Data
        - Clean local storage after successful deletion
        - Redirect to login page
        
        ## Key Characteristics
        
        ### Security
        - Requires verification code secondary verification
        - Prevents accidental account deletion
        - Operation logs recorded for audit
        
        ### Data Cleanup
        - Delete user basic information
        - Clean user associated data
        - Retain operation log records
        
        ## Related APIs
        - [Reauthenticate](/http-api/auth/user-reauthenticate) - Send verification code for secondary verification
        - [Modify Password](/http-api/auth/user-update-password) - Modify user password
        - [Get User Information](/http-api/auth/user-me) - Get current user information
        - [Logout](/http-api/auth/auth-sign-out) - User logout
        
        ## Error Handling
        
        ### Common Error Scenarios
        - Verification code expired: Prompt user to resend verification code
        - Verification code incorrect: Check if verification code is correct
        - Network exception: Retry mechanism
        - Server error: Display friendly error message

      operationId: User_DeleteMe
      tags:
        - 用户管理
      parameters:
        - name: client_id
          in: query
          description: Client ID corresponding to the application, can be obtained from CloudBase Platform -> Identity Authentication -> Development Settings. Defaults to environment ID, can be omitted
          required: false
          schema:
            type: string
        - name: x-device-id
          in: header
          description: Device ID, the ID of the current logged-in device. The client should generate it randomly and cache it on the client. This parameter is related to the number of logged-in accounts.
          required: false
          example: ""
          schema:
            type: string
        - name: Authorization
          in: header
          description: The access_token of the current logged-in user, format is Bearer xxx
          required: true
          schema:
            type: string
          example: Bearer your_access_token
        - name: verify_code
          in: query
          description: Verification code, the code sent to user's phone or email via reauthenticate API
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema: {}
      responses:
        "200":
          description: A successful response.
          content:
            application/json:
              schema: {}
          headers: {}
        "400":
          description: An unexpected error response.
          content:
            application/json:
              schema: *ref_0
              example:
                error: permission_denied
                error_code: 7
                error_description: bad verify code
          headers: {}
        "500":
          description: An unexpected error response.
          content:
            application/json:
              schema: *ref_0
          headers: {}
      security:
        - JWTAuth: []
  /auth/v1/user/password:
    patch:
      summary: Modify Password
      deprecated: false
      description: |-
        ## API Description
        Modify the current user's password, requires sending a verification code via the [Reauthenticate](/http-api/auth/user-reauthenticate) API for secondary verification before execution. This operation is used for users to modify their own login password, requiring secondary verification to ensure security.
        
        ### Features
        - Modify current user's login password
        - Requires verification code from reauthenticate API for secondary verification
        - Supports password strength validation
        - Old password becomes invalid immediately after modification
        - Automatically logout other device logins
        
        ## Input Requirements
        
        ### Required Parameters
        - `Authorization`: Current logged-in user's access_token (required, Bearer format)
        - `client_id`: Client ID corresponding to the application (optional, defaults to environment ID)
        - `x-device-id`: Device ID (optional, current logged-in device ID)
        
        ### Request Body Parameters
        - `old_password`: Old password (optional, if user has password)
        - `new_password`: New password (required, 8-64 characters, including uppercase and lowercase letters, numbers, special characters)
        - `confirm_password`: Confirm password (optional, for frontend validation)
        - `verify_code`: Verification code (required, the code sent to user's phone or email via [Reauthenticate](/http-api/auth/user-reauthenticate) API)
        
        ## Prerequisites
        - User must be logged in and hold valid access_token
        - Must send verification code via [Reauthenticate](/http-api/auth/user-reauthenticate) API
        - Verification code valid for 300 seconds (5 minutes)
        - New password must meet password strength requirements
        - If user already has password, need to provide old password for verification
        
        ## Output Description
        
        ### Successful Response
        - Returns empty object, indicating password modification successful
        
        ## Request Examples
        
        ### Modify Password Request Example (with old password)
        ```
        PATCH /auth/v1/user/password
        Authorization: Bearer your_access_token
        Content-Type: application/json
        
        {
          "old_password": "your-password",
          "new_password": "your-new-password",
          "confirm_password": "your-new-password",
          "verify_code": "101894"
        }
        ```
        
        ### Modify Password Request Example (no old password, first time setting)
        ```
        PATCH /auth/v1/user/password
        Authorization: Bearer your_access_token
        Content-Type: application/json
        
        {
          "new_password": "your-password",
          "confirm_password": "your-password",
          "verify_code": "101894"
        }
        ```
        
        ## Response Examples
        
        ### Modification Success Response
        ```json
        {}
        ```
        
        ### Old Password Error Response
        ```json
        {
          "error": "invalid_password",
          "error_code": 4003,
          "error_description": "Old password error, please re-enter"
        }
        ```
        
        ### Password Strength Insufficient Response
        ```json
        {
          "error": "weak_password",
          "error_code": 4005,
          "error_description": "Password strength insufficient, please use combination of uppercase and lowercase letters, numbers and special characters"
        }
        ```
        
        ## Usage Flow
        
        ### 1. Initiate Reauthentication
        - Call [Reauthenticate API](/http-api/auth/user-reauthenticate) to send verification code
        - Choose SMS or email method to receive verification code
        
        ### 2. User Receives Verification Code
        - User checks verification code in phone or email
        - Verification code valid for 300 seconds (5 minutes)
        
        ### 3. Verify Password Rules
        - Frontend validates new password strength
        - Confirm password consistency
        - Check password history
        
        ### 4. Execute Modification
        - Call this API to modify password
        - Pass verify_code (the verification code received by user) in request body for secondary verification
        
        ### 5. Handle Result
        - Prompt user on successful modification
        - Display specific reason on error
        - Automatically logout other device logins
        
        ## Key Characteristics
        
        ### Security
        - Requires verification code secondary verification
        - Automatic password strength detection
        - Prevents password reuse
        - Automatically logout other devices
        
        ### Password Rules
        - Length: 8-64 characters
        - Must include uppercase and lowercase letters
        - Must include numbers
        - Must include special characters
        - Cannot be same as old password
        
        ## Notes
        
        ### Security Recommendations
        - Recommend regular password changes
        - Avoid using common password combinations
        - Don't use same password as other websites
        - Recommend enabling two-factor authentication
        
        ### Password Strength Requirements
        - At least 8 characters, maximum 64 characters
        - Include uppercase letters, lowercase letters, numbers, special characters
        - Cannot contain username or email address
        - Cannot use consecutive or repeated characters
        
        ### Impact Scope
        - Takes effect immediately after modification
        - Other device logins automatically invalidated
        - Need to re-login all devices
        - Third-party logins not affected
        
        ### Common Error Scenarios
        - Verification code expired: Prompt user to resend verification code
        - Old password error: Display specific error message
        - Password strength insufficient: Provide password rule explanation
        - Network exception: Retry mechanism
        
        ## Related APIs
        - [Reauthenticate](/http-api/auth/user-reauthenticate) - Send verification code for secondary verification
        - [Password Recovery](/http-api/auth/user-update-password) - Reset password when forgotten
        - [Get User Information](/http-api/auth/user-me) - Get current user information
        - [Logout](/http-api/auth/auth-sign-out) - User logout
      operationId: User_UpdatePassword
      tags:
        - 用户管理
      parameters:
        - name: client_id
          in: query
          description: Client ID corresponding to the application, can be obtained from CloudBase Platform -> Identity Authentication -> Development Settings. Defaults to environment ID, can be omitted
          required: false
          schema:
            type: string
        - name: x-device-id
          in: header
          description: Device ID, the ID of the current logged-in device. The client should generate it randomly and cache it on the client. This parameter is related to the number of logged-in accounts.
          required: false
          example: ""
          schema:
            type: string
        - name: Authorization
          in: header
          description: The access_token of the current logged-in user, format is Bearer xxx
          required: true
          schema:
            type: string
          example: Bearer your_access_token
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/v1UpdatePasswordRequest"
      responses:
        "200":
          description: A successful response.
          content:
            application/json:
              schema: {}
          headers: {}
        "500":
          description: An unexpected error response.
          content:
            application/json:
              schema: *ref_0
          headers: {}
      security:
        - JWTAuth: []
  /auth/v1/user/basic/edit:
    post:
      summary: Modify User Basic Information
      deprecated: false
      description: |-
        ## API Description
        Modify user basic information, supports modifying nickname, username, phone number, email, avatar, gender, description and other basic information
        
        ### Input Requirements:
        - `Authorization`: Current logged-in user's access_token (required, passed in request header, format Bearer xxx)
        - `client_id`: Client ID corresponding to the application (optional, defaults to environment ID)
        - `x-device-id`: Device ID (optional, current logged-in device ID)
        - Request body parameters:
          - `user_id`: User ID (optional, requires administrator privileges when modifying other users' information)
          - `nickname`: Nickname (optional, 2-48 characters)
          - `username`: Username (optional, 2-48 characters, supports English uppercase and lowercase, numbers, special characters)
          - `phone`: Phone number (optional, format: +86 13000000000)
          - `description`: Description (optional, user personal introduction)
          - `avatar_url`: Avatar URL (optional)
          - `gender`: Gender (optional, MALE-Male, FEMALE-Female)
          - `email`: Email (optional, valid email format)
        
        ### Prerequisites:
        - Need valid access_token
        - Can only modify own information unless have administrator privileges
        - Username modification requires uniqueness verification
        - Phone number and email modification may require verification code verification
        
        ### Output:
        - Returns empty object indicating successful modification
        - Returns error information on error
        
        ### Modify User Information Request Example
        ```
        POST /auth/v1/user/basic/edit
        Authorization: Bearer your_access_token
        x-device-id: device_123456
        Content-Type: application/json
        
        {
          "nickname": "Zhang San",
          "username": "zhangsan",
          "phone": "+86 13000000000",
          "description": "A developer who loves technology",
          "avatar_url": "https://example/avatar.jpg",
          "gender": "MALE",
          "email": "zhangsan@example"
        }
        ```
        
        ### Modify User Information Response Example (Success)
        ```json
        {}
        ```
        
        ### Modify User Information Response Example (Failure)
        ```json
        {
          "error": "username_already_exists",
          "error_code": 409,
          "error_description": "Username already exists"
        }
        ```
        
        ### Usage Scenarios:
        - User modifies personal profile
        - Administrator modifies user information
        - User binds or changes phone number, email
        - Update user avatar and basic information
        
        ### Notes:
        - Username modification requires uniqueness verification
        - Phone number and email modification require sending verification code
        - Sensitive information modification may require secondary verification
        - Administrator can modify other users' information, regular users can only modify their own information
      operationId: User_EditUserBasicInfo
      tags:
        - 用户管理
      parameters:
        - name: client_id
          in: query
          description: Client ID corresponding to the application, can be obtained from CloudBase Platform -> Identity Authentication -> Development Settings. Defaults to environment ID, can be omitted
          required: false
          schema:
            type: string
        - name: x-device-id
          in: header
          description: Device ID, the ID of the current logged-in device. The client should generate it randomly and cache it on the client. This parameter is related to the number of logged-in accounts.
          required: false
          example: ""
          schema:
            type: string
        - name: Authorization
          in: header
          description: The access_token of the current logged-in user, format is Bearer xxx
          required: true
          schema:
            type: string
          example: Bearer your_access_token
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                user_id:
                  type: string
                  description: User ID
                nickname:
                  type: string
                  description: Nickname
                username:
                  type: string
                  description: Username
                phone:
                  type: string
                  description: Phone number
                description:
                  type: string
                  description: Description
                avatar_url:
                  type: string
                  description: Avatar
                gender:
                  type: string
                  description: Gender, MALE-Male, FEMALE-Female
                email:
                  type: string
                  description: Email
      responses:
        "200":
          description: A successful response.
          content:
            application/json:
              schema: {}
          headers: {}
        "500":
          description: An unexpected error response.
          content:
            application/json:
              schema: *ref_0
          headers: {}
      security:
        - JWTAuth: []
  /auth/v1/user/provider/bind:
    post:
      summary: Bind Third-Party Account
      deprecated: false
      description: |-
        ## API Description
        Bind third-party account API, used to bind third-party identity sources (such as GitHub, WeChat, QQ, etc.) to the current logged-in user account, enabling multiple login methods.
        
        ## Input Requirements
        
        ### Required Parameters
        - `provider_token`: Third-party identity source token (required, obtained through /auth/v1/provider/token API)
        - `Authorization`: Current logged-in user's access_token (required, passed in request header, format Bearer xxx)
        
        ### Optional Parameters
        - `with_user_center`: Whether to record in user centralized security log (optional, boolean, default false)
        - `client_id`: Client ID (optional, defaults to environment ID)
        - `x-device-id`: Device ID (optional, passed in request header)
        
        ## Prerequisites
        - User must be logged in (need valid access_token)
        - User must complete authorization on third-party platform
        - Must call [Get Third-Party Authorization Info](/http-api/auth/auth-grant-provider-token) API to obtain provider_token
        - The third-party account cannot already be bound by other users
        
        ## Output Description
        
        ### Successful Response
        - Returns empty object `{}`, indicating successful binding
        
        ## Request Example
        
        ### Bind GitHub Account Request Example
        ```json
        {
          "provider_token": "your_provider_token",
          "with_user_center": true
        }
        ```
        
        ## Response Examples
        
        ### Binding Success Response Example
        ```json
        {}
        ```
        
        ### Provider Token Invalid Response Example
        ```json
        {
          "error": "invalid_grant",
          "error_code": 4001,
          "error_description": "Provider token invalid or expired"
        }
        ```
                
        ### Not Logged In Response Example
        ```json
        {
          "error": "unauthorized",
          "error_code": 4003,
          "error_description": "User not logged in or access_token invalid"
        }
        ```
        
        ## Field Description
        
        ### Request Parameters
        | Field Name | Type | Required | Description |
        |--------|------|------|------|
        | provider_token | string | Yes | Third-party identity source token, obtained through /auth/v1/provider/token API |
        | with_user_center | boolean | No | Whether to record in user centralized security log, default false |
        | client_id | string | No | Client ID, defaults to environment ID |
        | x-device-id | string | No | Device ID, passed in request header |
        | Authorization | string | Yes | Current logged-in user's access_token, format Bearer xxx, passed in request header |
        
        ### Response Parameters
        | Field Name | Type | Required | Description |
        |--------|------|------|------|
        | - | object | Yes | Returns empty object {} on success |
        
        ## Usage Flow
        
        ### Complete Binding Flow
        
        #### 1. User Login
        - User must first login to system
        - Obtain valid access_token
        
        #### 2. Get Authorization URL
        - Call [Get Third-Party Login Callback URL](/http-api/auth/auth-gen-provider-redirect-uri) API (optional, depends on third-party platform authorization flow)
        - Get third-party authorization URL
        - Open authorization page in new window or popup
        
        #### 3. User Authorization
        - User completes authorization on third-party platform
        - Third-party platform callbacks and returns authorization code
        
        #### 4. Get Provider Token
        - Call [Get Third-Party Authorization Info](/http-api/auth/auth-grant-provider-token) API
        - Pass authorization code
        - Obtain provider_token
        
        #### 5. Bind Account
        - Call this API
        - Pass provider_token and access_token
        - Complete account binding
        
        ## Core Features
        
        ### Multiple Account Binding
        - Supports binding multiple third-party identity sources
        - Same user can bind GitHub, WeChat, QQ and other accounts
        - Can login using any bound method after binding
        - Supports unbinding anytime
        
        ### Security
        - Requires user login status
        - Use within provider_token validity period
        - Prevents duplicate binding
        - Records binding logs
        
        ### Flexibility
        - Supports multiple identity sources
        - Supports custom identity sources
        - Supports security log recording
        - Supports device management
        
        ## Usage Scenarios
        
        ### Account Binding
        - User binds third-party account in personal settings
        - Convenient to login using multiple methods
        - Enhances account security
        
        ### Social Account Association
        - Bind GitHub account
        - Bind WeChat account
        - Bind QQ account
        - Bind Weibo account
        
        ### Enterprise Account Association
        - Bind Enterprise WeChat account
        - Bind DingTalk account
        - Bind Feishu account
        
        ## Notes
        
        ### Account Binding Restrictions
        - Same third-party account can only bind one user
        - Same user can bind multiple different third-party accounts
        - Cannot bind third-party account already bound by other users
        - Checks for existing binding relationship before binding
        
        ### Access Token
        - Must be valid access_token
        - Must be passed in request header
        - Format must be Bearer xxx
        - Need to re-login when token expires
        
        ### Unbinding Operation
        - Can unbind anytime after binding
        - Call [Unbind Third-Party Account](/http-api/auth/user-un-bind-provider) API
        - Can re-bind after unbinding
        
        ## Error Handling
        
        ### Common Errors
        - `invalid_grant`: Provider token invalid or expired
        - `unauthorized`: User not logged in or access_token invalid
        
        ### Error Handling Strategy
        - provider_token invalid: Re-obtain authorization
        - Account already bound: Prompt user that account is already in use
        - Not logged in: Redirect to login page
        - Identity source not configured: Contact administrator
        - Reached binding limit: Unbind infrequently used accounts
        
        ## Related APIs
        - [Get Third-Party Login Callback URL](/http-api/auth/auth-gen-provider-redirect-uri) - Get authorization URL
        - [Get Third-Party Authorization Info](/http-api/auth/auth-grant-provider-token) - Get provider_token
        - [Unbind Third-Party Account](/http-api/auth/user-un-bind-provider) - Unbind bound account
        - [Get List of Third-Party Identity Sources Bound to Account](/http-api/auth/user-providers) - View bound account list
      operationId: User_BindWithProvider
      tags:
        - 用户管理
      parameters:
        - name: client_id
          in: query
          description: Client ID corresponding to the application, can be obtained from CloudBase Platform -> Identity Authentication -> Development Settings. Defaults to environment ID, can be omitted
          required: false
          schema:
            type: string
        - name: x-device-id
          in: header
          description: Device ID, the ID of the current logged-in device. The client should generate it randomly and cache it on the client. This parameter is related to the number of logged-in accounts.
          required: false
          example: ""
          schema:
            type: string
        - name: Authorization
          in: header
          description: The access_token of the current logged-in user, format is Bearer xxx
          required: true
          schema:
            type: string
          example: Bearer your_access_token
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                provider_token:
                  type: string
                  description: Third-party identity source provider_token, obtained from /auth/v1/provider/token
                with_user_center:
                  type: boolean
                  description: Whether to record in the user centralized security log
      responses:
        "200":
          description: A successful response.
          content:
            application/json:
              schema: {}
          headers: {}
        "500":
          description: An unexpected error response.
          content:
            application/json:
              schema: *ref_0
          headers: {}
      security:
        - JWTAuth: []
  /auth/v1/user/provider/{provider_id}:
    delete:
      summary: Unbind Third-Party Account
      deprecated: false
      description: |-
        ## API Description
        Unbind third-party account API, used to remove the binding relationship between the current logged-in user and specified third-party identity source (such as GitHub, WeChat, QQ, etc.).
        
        ## Input Requirements
        
        ### Required Parameters
        - `provider_id`: Identity source ID (required, path parameter, such as wx_open, github, wechat, etc.)
        - `Authorization`: Current logged-in user's access_token (required, passed in request header, format Bearer xxx)
        
        ### Optional Parameters
        - `with_user_center`: Whether to record in user centralized security log (optional, boolean, default false)
        - `client_id`: Client ID (optional, defaults to environment ID)
        - `x-device-id`: Device ID (optional, passed in request header)
        
        ## Prerequisites
        - User must be logged in (need valid access_token)
        - The identity source must already be bound to current user
        - Can first call [Get List of Third-Party Identity Sources Bound to Account](/http-api/auth/user-providers) API to view bound identity sources
        
        ## Output Description
        
        ### Successful Response
        - Returns empty object `{}`, indicating successful unbinding
        
        ## Request Example
        
        ### Unbind GitHub Account Request Example
        ```bash
        DELETE /auth/v1/user/provider/github?with_user_center=true
        Headers:
          Authorization: Bearer your_access_token
          x-device-id: device_abc123
        ```
        
        ### Unbinding Success Response Example
        ```json
        {}
        ```
    
        ### Not Logged In Response Example
        ```json
        {
          "error": "unauthorized",
          "error_code": 4003,
          "error_description": "User not logged in or access_token invalid"
        }
        ```
        
        ### Identity Source Not Found Response Example
        ```json
        {
          "error": "provider_not_found",
          "error_code": 4004,
          "error_description": "Specified identity source does not exist"
        }
        ```
        
        ## Field Description
        
        ### Request Parameters
        | Field Name | Type | Required | Location | Description |
        |--------|------|------|------|------|
        | provider_id | string | Yes | path | Identity source ID, such as wx_open, github, wechat, qq, etc. |
        | Authorization | string | Yes | header | Current logged-in user's access_token, format Bearer xxx |
        | with_user_center | boolean | No | query | Whether to record in user centralized security log, default false |
        | client_id | string | No | query | Client ID, defaults to environment ID |
        | x-device-id | string | No | header | Device ID |
        
        ### Response Parameters
        | Field Name | Type | Required | Description |
        |--------|------|------|------|
        | - | object | Yes | Returns empty object {} on success |
        
        ## Usage Flow
        
        ### Complete Unbinding Flow
        
        #### 1. View Bound Identity Sources
        - Call [Get List of Third-Party Identity Sources Bound to Account](/http-api/auth/user-providers) API
        - Get list of identity sources currently bound to user
        - Confirm identity source ID to unbind
        
        #### 2. Confirm Unbinding Operation
        - Prompt user to confirm unbinding operation
        - Explain impact after unbinding
        - Ensure at least one login method is retained
        
        #### 3. Execute Unbinding
        - Call this API
        - Pass provider_id to unbind
        - Pass valid access_token
        
        #### 4. Handle Result
        - Unbinding success: Update UI, remove the identity source
        - Unbinding failure: Display error message, prompt user
                
        ## Notes
        
        ### AccessToken
        - Must be valid access_token
        - Must be passed in request header
        - Format must be Bearer xxx
        - Need to re-login when token expires
        
        ### Provider ID
        - Must be already bound identity source ID
        - Must be valid identity source
        - Can query through list API
        
        ### Impact After Unbinding
        - Cannot login using this identity source anymore
        - Need to use other bound methods to login
        - Can re-bind anytime
        - Does not affect user's other data
        
        ## Error Handling
        
        ### Common Errors
        - `unauthorized`: User not logged in or access_token invalid
        - `provider_not_found`: Specified identity source does not exist
        - `internal_error`: Server internal error
        
        ### Error Handling Strategy
        - Identity source not bound: Prompt user that identity source is not bound
        - Cannot unbind last one: Prompt user to keep at least one login method
        - Not logged in: Redirect to login page
        - Identity source does not exist: Prompt user to select valid identity source
        - Server error: Retry later or contact customer service
        
        ## Related APIs
        - [Get List of Third-Party Identity Sources Bound to Account](/http-api/auth/user-providers) - View bound identity sources
        - [Bind Third-Party Account](/http-api/auth/user-bind-with-provider) - Bind new third-party account
        - [Get Third-Party Login Callback URL](/http-api/auth/auth-gen-provider-redirect-uri) - Get authorization URL
        - [Get Third-Party Authorization Info](/http-api/auth/auth-grant-provider-token) - Get provider_token
      operationId: User_UnBindProvider
      tags:
        - 用户管理
      parameters:
        - name: client_id
          in: query
          description: Client ID corresponding to the application, can be obtained from CloudBase Platform -> Identity Authentication -> Development Settings. Defaults to environment ID, can be omitted
          required: false
          schema:
            type: string
        - name: x-device-id
          in: header
          description: Device ID, the ID of the current logged-in device. The client should generate it randomly and cache it on the client. This parameter is related to the number of logged-in accounts.
          required: false
          example: ""
          schema:
            type: string
        - name: Authorization
          in: header
          description: The access_token of the current logged-in user, format is Bearer xxx
          required: true
          schema:
            type: string
          example: Bearer your_access_token
        - name: provider_id
          in: path
          description: Identity source ID, such as wx_open, or WeChat Mini Program appid
          required: true
          schema:
            type: string
        - name: with_user_center
          in: query
          description: Whether to record in the user centralized security log
          schema:
            type: boolean
      requestBody:
        content:
          application/json:
            schema: {}
      responses:
        "200":
          description: A successful response.
          content:
            application/json:
              schema: {}
          headers: {}
        "500":
          description: An unexpected error response.
          content:
            application/json:
              schema: *ref_0
          headers: {}
      security:
        - JWTAuth: []
  /auth/v1/user/provider:
    get:
      summary: Get List of Third-Party Identity Sources Bound to Account
      deprecated: false
      description: |-
        ## API Description
        Get list of third-party identity sources bound to current user, including bound and bindable identity source information
        
        ### Input Requirements:
        - `Authorization`: Current logged-in user's access_token (required, passed in request header, format Bearer xxx)
        - `client_id`: Client ID corresponding to the application (optional, defaults to environment ID)
        - `x-device-id`: Device ID (optional, current logged-in device ID)
        
        ### Prerequisites:
        - Need valid access_token
        - User must be logged in
        
        ### Output:
        - Returns list of identity sources bound to user (v1ProvidersResponse)
        - Includes identity source identifier, name, homepage, avatar, binding status and other information
        
        ### Get Bound Identity Sources Request Example
        ```
        GET /auth/v1/user/provider
        Authorization: Bearer your_access_token
        x-device-id: device_123456
        ```
        
        ### Get Bound Identity Sources Response Example
        ```json
        {
          "total": 2,
          "data": [
            {
              "id": "github",
              "name": "GitHub",
              "homepage": "https://github.com",
              "picture": "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png",
              "provider_user_name": "zhangsan",
              "provider_type": "oauth",
              "bind": true
            },
            {
              "id": "wechat",
              "name": "WeChat",
              "homepage": "https://open.weixin.qq.com",
              "picture": "https://res.wx.qq.com/a/wx_fed/assets/res/NTI4MWU5.ico",
              "provider_user_name": "",
              "provider_type": "oauth",
              "bind": false
            },
            {
              "id": "google",
              "name": "Google",
              "homepage": "https://accounts.google.com",
              "picture": "https://www.google.com/favicon.ico",
              "provider_user_name": "",
              "provider_type": "oauth",
              "bind": false
            }
          ]
        }
        ```
        
        ### Usage Scenarios:
        - User views bound third-party login methods
        - Display bindable identity sources in account settings page
        - Check which login methods user has bound
        - Provide unbinding operation entry
        
        ### Key Characteristics:
        - Returns all available identity sources, including bound and unbindable
        - bind field indicates whether already bound
        - provider_user_name shows username on third-party platform (only for bound identity sources)
        - Supports multiple identity source types (OAuth, OIDC, SAML, etc.)
      operationId: User_Providers
      tags:
        - 用户管理
      parameters:
        - name: client_id
          in: query
          description: Client ID corresponding to the application, can be obtained from CloudBase Platform -> Identity Authentication -> Development Settings. Defaults to environment ID, can be omitted
          required: false
          schema:
            type: string
        - name: x-device-id
          in: header
          description: Device ID, the ID of the current logged-in device. The client should generate it randomly and cache it on the client. This parameter is related to the number of logged-in accounts.
          required: false
          example: ""
          schema:
            type: string
        - name: Authorization
          in: header
          description: The access_token of the current logged-in user, format is Bearer xxx
          required: true
          schema:
            type: string
          example: Bearer your_access_token
      requestBody:
        content:
          application/json:
            schema: {}
      responses:
        "200":
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/v1ProvidersResponse"
          headers: {}
        "500":
          description: An unexpected error response.
          content:
            application/json:
              schema: *ref_0
          headers: {}
      security:
        - JWTAuth: []
components:
  schemas:
    rpcStatus:
      type: object
      properties:
        error:
          type: string
          title: Error message
        error_code:
          type: integer
          format: int32
          title: Error code
        error_description:
          type: string
          title: Error description
    v1GenProviderRedirectURIResponse:
      type: object
      properties:
        uri:
          type: string
          title: Callback URL
      title: GenProviderRedirectUriResponse Callback URL
    v1GrantProviderTokenRequest:
      type: object
      properties:
        provider_id:
          type: string
          title: Identity provider ID, such as wx_open, or WeChat Mini Program appid
        provider_redirect_uri:
          type: string
          title: Identity source callback URL
        provider_code:
          type: string
          title: Login code obtained from third-party system, used to exchange user identity
        provider_id_token:
          type: string
          title: Third-party id_token or identityToken, such as the identityToken returned by Apple login
      title: GrantProviderToken Get Third-Party Token Request
      required:
        - provider_id
    v1GrantProviderTokenResponse:
      type: object
      properties:
        provider_token:
          type: string
          title: If automatic registration is not enabled, provider_token will be returned for further processing, such as through phone number.
        expires_in:
          type: integer
          format: int32
          title: Expiration time
        provider_profile:
          $ref: "#/components/schemas/v1ProviderProfile"
      title: GrantProviderTokenResponse Get Third-Party Token Response
    v1ProviderProfile:
      type: object
      properties:
        provider_id:
          type: string
          title: Identity source ID
        sub:
          type: string
          title: Main ID, identifies the unique identifier of the user
        name:
          type: string
          title: Name
        picture:
          type: string
          title: Avatar
        email:
          type: string
          title: Email
        phone_number:
          type: string
          title: Phone number
        gender:
          type: string
          title: Gender
        locale:
          type: string
          title: Region
        url:
          type: string
          title: Email
        groups:
          type: array
          items:
            type: string
          title: Associated roles
        sub_id:
          type: string
          title: >-
            sub_id If the customer needs SLO, sub_id may need to be returned,
            can refer to: urn:oasis:names:tc:SAML:attribute:subject-id
        token:
          type: string
          title: provider returned token, for example： in OAuth mode, this token is refresh_token
        at_hash:
          type: string
          title: at hash of provider profile
        meta:
          type: object
          additionalProperties:
            type: string
          title: Supplementary information of token
          properties: {}
        raw:
          type: string
          title: Original third-party information
        provider:
          type: string
          title: Identity source type
      title: |-
        If the returned information contains a phone number, check if the phone number exists in the system
        If yes: confirm password login, if no: prompt registration
    v1SignInAnonymouslyRequest:
      type: object
      properties: {}
      title: SignInAnonymouslyRequest Anonymous Registration Request
    v1SignInRequest:
      type: object
      properties:
        username:
          type: string
          title: Username
          description: Required when logging in with username and password. 2-48 characters, supports English letters (case-sensitive), numbers, special characters (only -_.:+ @), must start with a letter or number, Chinese characters not supported
        password:
          type: string
          title: Password
          description: Required when logging in with username and password
        verification_token:
          type: string
          title: Verification code token
          description: Required when logging in with verification code. When logging in with phone verification code, the verification code token returned after verification. Obtained through the [verify SMS/email verification code](/http-api/auth/auth-verify-verification) API
      title: SignInRequest Login Request
    v1SignInWithProviderRequest:
      type: object
      properties:
        provider_id:
          type: string
          title: Identity source ID
        provider_token:
          type: string
          title: Third-party providerToken obtained through /auth/v1/provider/token
        force_disable_sign_up:
          type: boolean
          title: Force disable auto registration. By default, the server configuration prevails. If the client wants a smooth upgrade, it can be configured to true.
        sync_profile:
          type: boolean
          title: Whether to force synchronization of nickname and other information from third-party
      title: SignInWithProviderRequest Login via Third-Party Callback
      required:
        - provider_id
        - provider_token
    v1SignUpRequest:
      type: object
      properties:
        email:
          type: string
          title: Email
          description: Required when registering with email + verification_token
        phone_number:
          type: string
          title: Phone number
          description: "Required when registering with phone + verification_token, +86 cannot be omitted. For example: '+86 13000000000'"
        username:
          type: string
          title: Username
          description: Length 2-48 characters, supports English letters (case-sensitive), numbers, special characters (only -_.:+ @), must start with a letter or number, Chinese characters not supported
        verification_token:
          type: string
          title: Received verification code Token
          description: Required when registering with phone + verification_token or email + verification_token
        password:
          type: string
          title: optional password
        name:
          type: string
          title: optional nickname, optional
        gender:
          type: string
          title: optional avatar, conforms to css encoding format
        picture:
          type: string
          title: optional avatar, conforms to css encoding format
        locale:
          type: string
          title: |-
            optional region, optional (If the region is empty, the backend will initialize the region based on various factors such as mobile number, IP address)
            Format: zh
        provider_token:
          type: string
          title: If third-party information has been obtained before, then third-party information can be bound to this account
          description: provider_token returned by /auth/v1/provider/token and other interfaces
      title: SignUpRequestRequest Registration Request
    v1Token:
      type: object
      properties:
        token_type:
          type: string
          description: Uniformly return Bearer
          title: Access token type
        access_token:
          type: string
          title: User's access token
          description: Token used to access CloudBase HTTP API, length within 4096 bits
        refresh_token:
          type: string
          title: User's refresh token
          description: access_token can be refreshed to get a new access_token when it expires through refresh_token, expiration time defaults to 31 days. Length within 128 bits
        expires_in:
          type: integer
          format: int32
          description: Expiration time of access_token, in seconds
          title: Access token expiration time
        scope:
          type: string
          title: Authorization scope
        sub:
          type: string
          title: User's unique ID
        groups:
          type: array
          items:
            type: string
          title: User role list
      title: Token Returned Token Information
    v1TokenRequest:
      type: object
      properties:
        grant_type:
          type: string
          title: Grant type for obtaining token
          nullable: true
        code:
          type: string
          title: Used when grant_type is authorization_code
        refresh_token:
          type: string
          title: Used when refreshing token via refresh_token
        username:
          type: string
          title: Used when grant_type is password
        password:
          type: string
          title: Used when grant_type is password
        scope:
          type: string
          title: scope, optional
        nonce:
          type: string
          title: Nonce string, optional
        code_verifier:
          type: string
          title: "PKCE: code_verifier"
        device_code:
          type: string
          title: Device Code Flow https://tools.ietf.org/html/rfc8628
      title: TokenRequest Exchange Token Request
    v1CheckIfUserExistResponse:
      type: object
      properties:
        exist:
          type: boolean
          description: Flag indicating if user exists; true means exists, false means does not exist
      description: Response for user existence check, used to verify if a username, email, or phone number is already registered before signup
    v1SignoutRequest:
      type: object
      description: Sign Out Request
      properties:
        redirect_uri:
          type: string
          description: Redirect URI after successful sign out, optional
        state:
          type: string
          description: State parameter carried in redirect URI after sign out, optional
    v1SignoutResponse:
      type: object
      description: Sign Out Response
      properties:
        redirect_uri:
          type: string
          description: Redirect URI after successful sign out, optional
    v1TokenIntrospectResponse:
      type: object
      description: Token introspection response, returns token information if valid, or an empty object if invalid
      properties:
        token_type:
          type: string
          description: Token type
        client_id:
          type: string
          description: Client ID of the application the token belongs to
        sub:
          type: string
          description: User ID the token belongs to
        scope:
          type: string
          description: Allowed scope of the token
    v1Profile:
      type: object
      description: User information
      properties:
        sub:
          type: string
          description: User subject
        name:
          type: string
          description: User nickname
        picture:
          type: string
          description: User avatar
        username:
          type: string
          description: Username
        email:
          type: string
          description: Email
        phone_number:
          type: string
          description: Phone number
        providers:
          type: array
          description: Linked login methods
          items:
            $ref: "#/components/schemas/v1ProfileProvider"
        status:
          description: User status
          $ref: "#/components/schemas/ProfileProfileStatus"
        gender:
          type: string
          description: Gender
        groups:
          type: array
          description: User groups, list of role identifiers bound to the user
          items:
            $ref: "#/components/schemas/v1ProfileGroup"
        meta:
          type: object
          additionalProperties:
            type: string
          description: User metadata
        created_at:
          type: string
          format: date-time
          description: Creation time
        updated_at:
          type: string
          format: date-time
          description: Update time
        password_updated_at:
          type: string
          format: date-time
          description: Password update time
        user_id:
          type: string
          description: Micro-app user ID
        has_password:
          type: boolean
          description: Indicates if a password is set
        internal_user_type:
          type: string
          description: Internal user type： built-in super admin (administrator), general user (generalUser)
        type:
          type: string
          description: User type： internal, external
        user_source:
          type: integer
          format: int32
          description: User source： 1-self-built, 2-WeCom enterprise, 3-external registration
        user_desc:
          type: string
          description: User description
        open_id:
          type: string
          description: WeChat or WeCom openID
        corp_id:
          type: string
          description: Corporation ID
        parent_user_id:
          type: string
          description: Direct supervisor ID
        main_dep:
          type: string
          description: Main department ID
        sort:
          type: integer
          format: int32
          description: Sort value; lower sort means higher priority
        last_login:
          type: string
          format: date-time
          description: Last login time
    v1ProfileProvider:
      type: object
      description: User-bound identity provider information
      properties:
        id:
          type: string
          description: Identity provider ID
        provider_user_id:
          type: string
          description: Provider user ID
        name:
          type: string
          description: Identity provider name
        picture:
          type: string
          description: Identity provider avatar
        url:
          type: string
          description: Identity provider URL
        meta:
          type: object
          additionalProperties:
            type: string
          description: Identity provider metadata
    v1ProfileGroup:
      type: object
      description: User group information
      properties:
        id:
          type: string
          description: Role identifier
    ProfileProfileStatus:
      type: string
      enum: [DEFAULT, ACTIVE, PENDING, BLOCKED]
      description: User status： DEFAULT (default), ACTIVE (activated), PENDING (pending), BLOCKED (blocked)
    v1UpdatePasswordRequest:
      type: object
      description: Change password request
      properties:
        verify_code:
          type: string
          description: Verification code, the code sent to user's phone or email via reauthenticate API. If the original account has no password and both phone number and email are empty, no verification code is needed for direct modification
        new_password:
          type: string
          description: New Password
          required: true
    v1ReauthenticateRequest:
      type: object
      description: Reauthenticate request, send verification code to current logged-in user
      properties:
        verify_opt:
          type: string
          description: "Verification method, valid values: phone_code (send SMS verification code), email_code (send email verification code)"
          enum:
            - phone_code
            - email_code
      required:
        - verify_opt
    v1ProvidersResponse:
      type: object
      description: Response for retrieving user's linked identity providers
      properties:
        total:
          type: integer
          format: int32
          description: Total count
        data:
          type: array
          items:
            $ref: "#/components/schemas/v1UserProvider"
          description: Linked identity provider data
    v1UserProvider:
      type: object
      description: User-bound identity provider information
      properties:
        id:
          type: string
          description: Identity provider identifier
        name:
          type: string
          description: Identity provider name
        homepage:
          type: string
          description: Identity provider homepage
        picture:
          type: string
          description: Identity provider avatar
        provider_user_name:
          type: string
          description: Identity provider username
        provider_type:
          type: string
          description: Identity provider type
        bind:
          type: boolean
          description: Is it bound
  securitySchemes: {}
