---
title: "用户注册"
method: POST
path: "/auth/register"
tags: ["认证"]
---

# 用户注册

`POST /auth/register`

注册新用户账号

## Request body

- GithubComTencentWeKnoraInternalTypesRegisterRequest
  - `email` string, required
  - `password` string, required
  - `username` string, required

## Response `201`

Created

- GithubComTencentWeKnoraInternalTypesRegisterResponse
  - `message` string
  - `success` boolean
  - `tenant` GithubComTencentWeKnoraInternalTypesTenant
    - `business` string — Business
    - `chat_history_config` GithubComTencentWeKnoraInternalTypesChatHistoryConfig
      - `embedding_model_id` string — EmbeddingModelID is the ID of the embedding model used for vectorizing chat messages. Once messages have been indexed, the model cannot be changed (requires re-indexing).
      - `enabled` boolean — Enabled controls whether chat history indexing is active
      - `knowledge_base_id` string — KnowledgeBaseID is the auto-managed hidden knowledge base for chat history. This is set internally when the feature is first enabled; users should not set this directly.
    - `context_config` GithubComTencentWeKnoraInternalTypesContextConfig
      - `compression_strategy` 'sliding_window' | 'smart'
      - `max_tokens` integer — Maximum tokens allowed in LLM context
      - `recent_message_count` integer — For sliding_window: number of messages to keep For smart: number of recent messages to keep uncompressed
      - `summarize_threshold` integer — Summarize threshold: number of messages before summarization
    - `created_at` string — Creation time
    - `credentials` GithubComTencentWeKnoraInternalTypesCredentialsConfig
      - `weknoracloud` GithubComTencentWeKnoraInternalTypesWeKnoraCloudCredentials
        - `app_id` string
        - `app_secret` string
    - `default_storage_backend_id` string — DefaultStorageBackendID is the workspace default concrete storage instance.
    - `deleted_at` GormDeletedAt
      - `time` string
      - `valid` boolean — Valid is true if Time is not NULL
    - `description` string — Description
    - `id` integer — ID
    - `name` string — Name
    - `parser_engine_config` GithubComTencentWeKnoraInternalTypesParserEngineConfig
      - `chat_parser_engine_rules` GithubComTencentWeKnoraInternalTypesParserEngineRule[] — ChatParserEngineRules selects parser engines for session-scoped chat documents. Knowledge bases keep their own rules in ChunkingConfig.
        - `engine` string
        - `file_types` string[]
        - `xlsx_first_row_as_header` boolean — XLSXFirstRowAsHeader restores row-1 column context for flat XLSX tables. nil preserves the parser default; an explicit false disables the mode.
      - `mineru_api_key` string — MinerU 云 API Key
      - `mineru_cloud_enable_formula` boolean
      - `mineru_cloud_enable_ocr` boolean
      - `mineru_cloud_enable_table` boolean
      - `mineru_cloud_language` string
      - `mineru_cloud_model` string — MinerU 云 API 解析参数
      - `mineru_enable_formula` boolean
      - `mineru_enable_ocr` boolean — MinerUEnableOCR is retained for compatibility with configurations saved before parse_method supported auto/ocr/txt.
      - `mineru_enable_table` boolean
      - `mineru_endpoint` string — MinerU 自建服务端点
      - `mineru_language` string
      - `mineru_model` string — MinerU 自建解析参数
      - `mineru_parse_method` string
      - `mineru_vlm_server_url` string — vLLM 服务器地址 (vlm-http-client / hybrid-http-client)
      - `odl_hybrid` string — OpenDataLoader PDF (docreader engine); hybrid requires opendataloader-pdf-hybrid service.
      - `odl_hybrid_fallback` boolean
      - `odl_hybrid_mode` string — auto, full
      - `odl_hybrid_url` string — e.g. http://odl-hybrid:5002
      - `odl_markdown_with_html` boolean
      - `paddleocr_vl_cloud_model` string — e.g. PaddleOCR-VL-1.6
      - `paddleocr_vl_cloud_token` string — PaddleOCR-VL AI Studio cloud API.
      - `paddleocr_vl_cloud_use_chart_recognition` boolean
      - `paddleocr_vl_cloud_use_seal_recognition` boolean
      - `paddleocr_vl_endpoint` string — PaddleOCR-VL self-hosted pipeline service (full /layout-parsing API).
      - `paddleocr_vl_use_chart_recognition` boolean
      - `paddleocr_vl_use_seal_recognition` boolean
    - `retrieval_config` GithubComTencentWeKnoraInternalTypesRetrievalConfig
      - `embedding_top_k` integer — EmbeddingTopK is the maximum number of chunks returned by vector search (default: 50)
      - `keyword_threshold` number — KeywordThreshold is the minimum keyword match score (0-1, default: 0.3)
      - `rerank_model_id` string — RerankModelID is the ID of the rerank model to use (required for search)
      - `rerank_threshold` number — RerankThreshold is the minimum rerank score (-10 to 10, default: 0.2)
      - `rerank_top_k` integer — RerankTopK is the maximum number of results after reranking (default: 10)
      - `rrf_k` integer — RRFK is the smoothing constant of Reciprocal Rank Fusion. Larger values flatten the curve, reducing the bias towards top-1 results. Default: 60. Sensible range: 30..100 depending on corpus size.
      - `rrf_keyword_weight` number — RRFKeywordWeight is the keyword counterpart. Default: 0.3.
      - `rrf_vector_weight` number — RRFVectorWeight is the weight applied to the vector retriever inside RRF. RRFVectorWeight + RRFKeywordWeight should usually sum to 1.0 but the math works for any positive weights. Default: 0.7.
      - `vector_threshold` number — VectorThreshold is the minimum vector similarity score (0-1, default: 0.15)
    - `retriever_engines` GithubComTencentWeKnoraInternalTypesRetrieverEngines
      - `engines` GithubComTencentWeKnoraInternalTypesRetrieverEngineParams[]
        - `retriever_engine_type` 'postgres' | 'elasticsearch' | 'infinity' | 'elasticfaiss' | 'qdrant' | 'milvus' | 'weaviate' | 'doris' | 'sqlite' | 'tencent_vectordb' | 'opensearch'
        - `retriever_type` 'keywords' | 'vector' | 'websearch'
    - `status` string — Status
    - `storage_engine_config` GithubComTencentWeKnoraInternalTypesStorageEngineConfig
      - `cos` GithubComTencentWeKnoraInternalTypesCOSEngineConfig
        - `app_id` string
        - `bucket_name` string
        - `path_prefix` string
        - `region` string
        - `secret_id` string
        - `secret_key` string
        - `temp_bucket_name` string
        - `temp_region` string
      - `default_provider` string — "local", "minio", "cos", "tos", "s3", "oss", "ks3", "obs"
      - `ks3` GithubComTencentWeKnoraInternalTypesKS3EngineConfig
        - `access_key` string
        - `bucket_name` string
        - `endpoint` string
        - `path_prefix` string
        - `region` string
        - `secret_key` string
      - `local` GithubComTencentWeKnoraInternalTypesLocalEngineConfig
        - `path_prefix` string
      - `minio` GithubComTencentWeKnoraInternalTypesMinIOEngineConfig
        - `access_key_id` string
        - `bucket_name` string
        - `endpoint` string
        - `mode` string — "docker" or "remote"
        - `path_prefix` string
        - `secret_access_key` string
        - `use_ssl` boolean
      - `obs` GithubComTencentWeKnoraInternalTypesOBSEngineConfig
        - `access_key` string
        - `bucket_name` string
        - `endpoint` string
        - `path_prefix` string
        - `region` string
        - `secret_key` string
        - `use_ssl` boolean
      - `oss` GithubComTencentWeKnoraInternalTypesOSSEngineConfig
        - `access_key` string
        - `bucket_name` string
        - `endpoint` string
        - `path_prefix` string
        - `region` string
        - `secret_key` string
        - `temp_bucket_name` string
        - `temp_region` string
        - `use_temp_bucket` boolean
      - `s3` GithubComTencentWeKnoraInternalTypesS3EngineConfig
        - `access_key` string
        - `bucket_name` string
        - `endpoint` string
        - `force_path_style` boolean
        - `path_prefix` string
        - `region` string
        - `secret_key` string
        - `use_ssl` boolean
      - `tos` GithubComTencentWeKnoraInternalTypesTOSEngineConfig
        - `access_key` string
        - `bucket_name` string
        - `endpoint` string
        - `path_prefix` string
        - `region` string
        - `secret_key` string
        - `temp_bucket_name` string
        - `temp_region` string
    - `storage_quota` integer — Storage quota (Bytes), default is 10GB, including vector, original file, text, index, etc.
    - `storage_used` integer — Storage used (Bytes)
    - `updated_at` string — Last updated time
    - `web_search_config` GithubComTencentWeKnoraInternalTypesWebSearchConfig
      - `api_key` string — Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.
      - `blacklist` string[] — 黑名单规则列表
      - `compression_method` string — 压缩方法：none, summary, extract, rag
      - `document_fragments` integer — 文档片段数量（用于RAG压缩）
      - `embedding_dimension` integer — 嵌入维度（用于RAG压缩）
      - `embedding_model_id` string — RAG压缩相关配置
      - `include_date` boolean — 是否包含日期
      - `max_results` integer — 最大搜索结果数
      - `provider` string — Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.
      - `proxy_url` string — Optional per-request proxy override; normally empty — use WebSearchProviderEntity.Parameters.proxy_url. Merged at call time when set.
      - `rerank_model_id` string — 重排模型ID（用于RAG压缩）
  - `user` GithubComTencentWeKnoraInternalTypesUser
    - `avatar` string — Avatar URL of the user
    - `can_access_all_tenants` boolean — Whether the user can access all workspaces (cross-workspace access)
    - `created_at` string — Creation time of the user
    - `deleted_at` GormDeletedAt
      - `time` string
      - `valid` boolean — Valid is true if Time is not NULL
    - `email` string — Email address of the user
    - `id` string — Unique identifier of the user
    - `is_active` boolean — Whether the user is active
    - `is_system_admin` boolean — Whether the user is a system administrator (independent of workspace roles)
    - `preferences` GithubComTencentWeKnoraInternalTypesUserPreferences
      - `last_active_tenant_id` integer — LastActiveTenantID remembers the last workspace the user actively switched into, so a fresh login (new device, cleared browser, new refresh token) lands them back in that workspace instead of always bouncing to their home workspace. Login / RefreshToken validate that the workspace still exists and the user still has an active membership (or CanAccessAllTenants) before honouring this preference; an invalid pointer is best-effort cleared and the user falls back to home. nil = no preference (use user.TenantID, i.e. home) *0 = "clear preference" sentinel for the partial-update endpoint (UpdateUserPreferences turns this into nil). Otherwise treat a stored *0 the same as nil. *N = preferred workspace id.
      - `oidc_only_login` boolean — OidcOnlyLogin is set server-side when an account is auto-provisioned via OIDC with a random password the user never received. The profile UI hides self-service password rotation until the user sets a known password via ChangePassword (which clears this flag).
    - `tenant` GithubComTencentWeKnoraInternalTypesTenant
      - `business` string — Business
      - `chat_history_config` GithubComTencentWeKnoraInternalTypesChatHistoryConfig
        - `embedding_model_id` string — EmbeddingModelID is the ID of the embedding model used for vectorizing chat messages. Once messages have been indexed, the model cannot be changed (requires re-indexing).
        - `enabled` boolean — Enabled controls whether chat history indexing is active
        - `knowledge_base_id` string — KnowledgeBaseID is the auto-managed hidden knowledge base for chat history. This is set internally when the feature is first enabled; users should not set this directly.
      - `context_config` GithubComTencentWeKnoraInternalTypesContextConfig
        - `compression_strategy` 'sliding_window' | 'smart'
        - `max_tokens` integer — Maximum tokens allowed in LLM context
        - `recent_message_count` integer — For sliding_window: number of messages to keep For smart: number of recent messages to keep uncompressed
        - `summarize_threshold` integer — Summarize threshold: number of messages before summarization
      - `created_at` string — Creation time
      - `credentials` GithubComTencentWeKnoraInternalTypesCredentialsConfig
        - `weknoracloud` GithubComTencentWeKnoraInternalTypesWeKnoraCloudCredentials
          - `app_id` string
          - `app_secret` string
      - `default_storage_backend_id` string — DefaultStorageBackendID is the workspace default concrete storage instance.
      - `deleted_at` GormDeletedAt
        - `time` string
        - `valid` boolean — Valid is true if Time is not NULL
      - `description` string — Description
      - `id` integer — ID
      - `name` string — Name
      - `parser_engine_config` GithubComTencentWeKnoraInternalTypesParserEngineConfig
        - `chat_parser_engine_rules` GithubComTencentWeKnoraInternalTypesParserEngineRule[] — ChatParserEngineRules selects parser engines for session-scoped chat documents. Knowledge bases keep their own rules in ChunkingConfig.
          - `engine` string
          - `file_types` string[]
          - `xlsx_first_row_as_header` boolean — XLSXFirstRowAsHeader restores row-1 column context for flat XLSX tables. nil preserves the parser default; an explicit false disables the mode.
        - `mineru_api_key` string — MinerU 云 API Key
        - `mineru_cloud_enable_formula` boolean
        - `mineru_cloud_enable_ocr` boolean
        - `mineru_cloud_enable_table` boolean
        - `mineru_cloud_language` string
        - `mineru_cloud_model` string — MinerU 云 API 解析参数
        - `mineru_enable_formula` boolean
        - `mineru_enable_ocr` boolean — MinerUEnableOCR is retained for compatibility with configurations saved before parse_method supported auto/ocr/txt.
        - `mineru_enable_table` boolean
        - `mineru_endpoint` string — MinerU 自建服务端点
        - `mineru_language` string
        - `mineru_model` string — MinerU 自建解析参数
        - `mineru_parse_method` string
        - `mineru_vlm_server_url` string — vLLM 服务器地址 (vlm-http-client / hybrid-http-client)
        - `odl_hybrid` string — OpenDataLoader PDF (docreader engine); hybrid requires opendataloader-pdf-hybrid service.
        - `odl_hybrid_fallback` boolean
        - `odl_hybrid_mode` string — auto, full
        - `odl_hybrid_url` string — e.g. http://odl-hybrid:5002
        - `odl_markdown_with_html` boolean
        - `paddleocr_vl_cloud_model` string — e.g. PaddleOCR-VL-1.6
        - `paddleocr_vl_cloud_token` string — PaddleOCR-VL AI Studio cloud API.
        - `paddleocr_vl_cloud_use_chart_recognition` boolean
        - `paddleocr_vl_cloud_use_seal_recognition` boolean
        - `paddleocr_vl_endpoint` string — PaddleOCR-VL self-hosted pipeline service (full /layout-parsing API).
        - `paddleocr_vl_use_chart_recognition` boolean
        - `paddleocr_vl_use_seal_recognition` boolean
      - `retrieval_config` GithubComTencentWeKnoraInternalTypesRetrievalConfig
        - `embedding_top_k` integer — EmbeddingTopK is the maximum number of chunks returned by vector search (default: 50)
        - `keyword_threshold` number — KeywordThreshold is the minimum keyword match score (0-1, default: 0.3)
        - `rerank_model_id` string — RerankModelID is the ID of the rerank model to use (required for search)
        - `rerank_threshold` number — RerankThreshold is the minimum rerank score (-10 to 10, default: 0.2)
        - `rerank_top_k` integer — RerankTopK is the maximum number of results after reranking (default: 10)
        - `rrf_k` integer — RRFK is the smoothing constant of Reciprocal Rank Fusion. Larger values flatten the curve, reducing the bias towards top-1 results. Default: 60. Sensible range: 30..100 depending on corpus size.
        - `rrf_keyword_weight` number — RRFKeywordWeight is the keyword counterpart. Default: 0.3.
        - `rrf_vector_weight` number — RRFVectorWeight is the weight applied to the vector retriever inside RRF. RRFVectorWeight + RRFKeywordWeight should usually sum to 1.0 but the math works for any positive weights. Default: 0.7.
        - `vector_threshold` number — VectorThreshold is the minimum vector similarity score (0-1, default: 0.15)
      - `retriever_engines` GithubComTencentWeKnoraInternalTypesRetrieverEngines
        - `engines` GithubComTencentWeKnoraInternalTypesRetrieverEngineParams[]
          - `retriever_engine_type` 'postgres' | 'elasticsearch' | 'infinity' | 'elasticfaiss' | 'qdrant' | 'milvus' | 'weaviate' | 'doris' | 'sqlite' | 'tencent_vectordb' | 'opensearch'
          - `retriever_type` 'keywords' | 'vector' | 'websearch'
      - `status` string — Status
      - `storage_engine_config` GithubComTencentWeKnoraInternalTypesStorageEngineConfig
        - `cos` GithubComTencentWeKnoraInternalTypesCOSEngineConfig
          - `app_id` string
          - `bucket_name` string
          - `path_prefix` string
          - `region` string
          - `secret_id` string
          - `secret_key` string
          - `temp_bucket_name` string
          - `temp_region` string
        - `default_provider` string — "local", "minio", "cos", "tos", "s3", "oss", "ks3", "obs"
        - `ks3` GithubComTencentWeKnoraInternalTypesKS3EngineConfig
          - `access_key` string
          - `bucket_name` string
          - `endpoint` string
          - `path_prefix` string
          - `region` string
          - `secret_key` string
        - `local` GithubComTencentWeKnoraInternalTypesLocalEngineConfig
          - `path_prefix` string
        - `minio` GithubComTencentWeKnoraInternalTypesMinIOEngineConfig
          - `access_key_id` string
          - `bucket_name` string
          - `endpoint` string
          - `mode` string — "docker" or "remote"
          - `path_prefix` string
          - `secret_access_key` string
          - `use_ssl` boolean
        - `obs` GithubComTencentWeKnoraInternalTypesOBSEngineConfig
          - `access_key` string
          - `bucket_name` string
          - `endpoint` string
          - `path_prefix` string
          - `region` string
          - `secret_key` string
          - `use_ssl` boolean
        - `oss` GithubComTencentWeKnoraInternalTypesOSSEngineConfig
          - `access_key` string
          - `bucket_name` string
          - `endpoint` string
          - `path_prefix` string
          - `region` string
          - `secret_key` string
          - `temp_bucket_name` string
          - `temp_region` string
          - `use_temp_bucket` boolean
        - `s3` GithubComTencentWeKnoraInternalTypesS3EngineConfig
          - `access_key` string
          - `bucket_name` string
          - `endpoint` string
          - `force_path_style` boolean
          - `path_prefix` string
          - `region` string
          - `secret_key` string
          - `use_ssl` boolean
        - `tos` GithubComTencentWeKnoraInternalTypesTOSEngineConfig
          - `access_key` string
          - `bucket_name` string
          - `endpoint` string
          - `path_prefix` string
          - `region` string
          - `secret_key` string
          - `temp_bucket_name` string
          - `temp_region` string
      - `storage_quota` integer — Storage quota (Bytes), default is 10GB, including vector, original file, text, index, etc.
      - `storage_used` integer — Storage used (Bytes)
      - `updated_at` string — Last updated time
      - `web_search_config` GithubComTencentWeKnoraInternalTypesWebSearchConfig
        - `api_key` string — Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.
        - `blacklist` string[] — 黑名单规则列表
        - `compression_method` string — 压缩方法：none, summary, extract, rag
        - `document_fragments` integer — 文档片段数量（用于RAG压缩）
        - `embedding_dimension` integer — 嵌入维度（用于RAG压缩）
        - `embedding_model_id` string — RAG压缩相关配置
        - `include_date` boolean — 是否包含日期
        - `max_results` integer — 最大搜索结果数
        - `provider` string — Deprecated: Use WebSearchProviderEntity.Parameters.APIKey instead.
        - `proxy_url` string — Optional per-request proxy override; normally empty — use WebSearchProviderEntity.Parameters.proxy_url. Merged at call time when set.
        - `rerank_model_id` string — 重排模型ID（用于RAG压缩）
    - `tenant_id` integer — Workspace ID that the user belongs to
    - `updated_at` string — Last updated time of the user
    - `username` string — Username of the user

## Other responses

- `400` — 请求参数错误
- `403` — 注册功能已禁用

---

[API](https://skmtc.net/tencentblueking/apis/weknora-api.md) · [All operations](https://skmtc.net/tencentblueking/apis/weknora-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tencentblueking/weknora-api/versions/d6921ae22ce0/schema)
