---
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
    - `agent_config` GithubComTencentWeKnoraInternalTypesAgentConfig
      - `allowed_tools` string[] — List of allowed tool names
      - `knowledge_bases` string[] — Accessible knowledge base IDs
      - `knowledge_ids` string[] — Accessible knowledge IDs (individual documents)
      - `max_iterations` integer — Maximum number of ReAct iterations
      - `reflection_enabled` boolean — Whether to enable reflection
      - `system_prompt_web_disabled` string — Custom prompt when web search is disabled
      - `system_prompt_web_enabled` string — Custom prompt when web search is enabled
      - `temperature` number — LLM temperature for agent
      - `use_custom_system_prompt` boolean — Whether to use custom system prompt instead of default
      - `web_search_enabled` boolean — Whether web search tool is enabled
      - `web_search_max_results` integer — Maximum number of web search results (default: 5)
    - `api_key` string — API key
    - `business` string — Business
    - `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
    - `conversation_config` GithubComTencentWeKnoraInternalTypesConversationConfig
      - `context_template` string — ContextTemplate is the prompt template for summarizing retrieval results
      - `embedding_top_k` integer
      - `enable_query_expansion` boolean
      - `enable_rewrite` boolean
      - `fallback_prompt` string
      - `fallback_response` string
      - `fallback_strategy` string — Fallback strategy
      - `keyword_threshold` number
      - `max_completion_tokens` integer — MaxTokens is the maximum number of tokens to generate
      - `max_rounds` integer — Retrieval & strategy parameters
      - `prompt` string
      - `rerank_model_id` string
      - `rerank_threshold` number
      - `rerank_top_k` integer
      - `rewrite_prompt_system` string — Rewrite prompts
      - `rewrite_prompt_user` string
      - `summary_model_id` string — Model configuration
      - `temperature` number — Temperature controls the randomness of the model output
      - `use_custom_context_template` boolean
      - `use_custom_system_prompt` boolean — Prompt is the system prompt for normal mode
      - `vector_threshold` number
    - `created_at` string — Creation time
    - `deleted_at` GormDeletedAt
      - `time` string
      - `valid` boolean — Valid is true if Time is not NULL
    - `description` string — Description
    - `id` integer — ID
    - `name` string — Name
    - `retriever_engines` GithubComTencentWeKnoraInternalTypesRetrieverEngines
      - `engines` GithubComTencentWeKnoraInternalTypesRetrieverEngineParams[]
        - `retriever_engine_type` 'postgres' | 'elasticsearch' | 'infinity' | 'elasticfaiss' | 'qdrant'
        - `retriever_type` 'keywords' | 'vector' | 'websearch'
    - `status` string — Status
    - `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 — API密钥（如果需要）
      - `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 — 搜索引擎提供商ID
      - `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 tenants (cross-tenant 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
    - `tenant` GithubComTencentWeKnoraInternalTypesTenant
      - `agent_config` GithubComTencentWeKnoraInternalTypesAgentConfig
        - `allowed_tools` string[] — List of allowed tool names
        - `knowledge_bases` string[] — Accessible knowledge base IDs
        - `knowledge_ids` string[] — Accessible knowledge IDs (individual documents)
        - `max_iterations` integer — Maximum number of ReAct iterations
        - `reflection_enabled` boolean — Whether to enable reflection
        - `system_prompt_web_disabled` string — Custom prompt when web search is disabled
        - `system_prompt_web_enabled` string — Custom prompt when web search is enabled
        - `temperature` number — LLM temperature for agent
        - `use_custom_system_prompt` boolean — Whether to use custom system prompt instead of default
        - `web_search_enabled` boolean — Whether web search tool is enabled
        - `web_search_max_results` integer — Maximum number of web search results (default: 5)
      - `api_key` string — API key
      - `business` string — Business
      - `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
      - `conversation_config` GithubComTencentWeKnoraInternalTypesConversationConfig
        - `context_template` string — ContextTemplate is the prompt template for summarizing retrieval results
        - `embedding_top_k` integer
        - `enable_query_expansion` boolean
        - `enable_rewrite` boolean
        - `fallback_prompt` string
        - `fallback_response` string
        - `fallback_strategy` string — Fallback strategy
        - `keyword_threshold` number
        - `max_completion_tokens` integer — MaxTokens is the maximum number of tokens to generate
        - `max_rounds` integer — Retrieval & strategy parameters
        - `prompt` string
        - `rerank_model_id` string
        - `rerank_threshold` number
        - `rerank_top_k` integer
        - `rewrite_prompt_system` string — Rewrite prompts
        - `rewrite_prompt_user` string
        - `summary_model_id` string — Model configuration
        - `temperature` number — Temperature controls the randomness of the model output
        - `use_custom_context_template` boolean
        - `use_custom_system_prompt` boolean — Prompt is the system prompt for normal mode
        - `vector_threshold` number
      - `created_at` string — Creation time
      - `deleted_at` GormDeletedAt
        - `time` string
        - `valid` boolean — Valid is true if Time is not NULL
      - `description` string — Description
      - `id` integer — ID
      - `name` string — Name
      - `retriever_engines` GithubComTencentWeKnoraInternalTypesRetrieverEngines
        - `engines` GithubComTencentWeKnoraInternalTypesRetrieverEngineParams[]
          - `retriever_engine_type` 'postgres' | 'elasticsearch' | 'infinity' | 'elasticfaiss' | 'qdrant'
          - `retriever_type` 'keywords' | 'vector' | 'websearch'
      - `status` string — Status
      - `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 — API密钥（如果需要）
        - `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 — 搜索引擎提供商ID
        - `rerank_model_id` string — 重排模型ID（用于RAG压缩）
    - `tenant_id` integer — Tenant 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` — 注册功能已禁用

## Changes

- **2025-12-24** `a7ea016b0504` — 1 info
  - added the non-success response with the status `403`
- **2025-12-16** `edf61e68559d` — 1 info
  - removed the non-success response with the status `403`

[Change history](https://skmtc.dev/tencentblueking/apis/weknora-api/changes/auth/register/post.md)

---

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