---
title: "Register"
method: POST
path: "/auth/register"
---

# Register

`POST /auth/register`

## Request

- Base URL: `https://api.twtapi.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.twtapi.com/auth/register`
- Auth: none declared

注册账号：校验密码长度 -> 图形验证码 -> 邮箱验证码 -> 建号并记录风控。

返回：成功时回传 user_id / api_key / mcp_key；各类失败返回带 sub_code 的 error。
副作用：写库（建 User、last_lang、风控事件/画像）、写 Redis（消费验证码）。
注意：注册成功后不会自动登录、不下发 session cookie，前端需要再调一次 /login。

## Query parameters

- `lang` string

## Request body

- RegisterRequest: 注册请求。图形验证码 + 邮箱验证码双重校验，两者缺一不可。
  - `email` string, required
  - `password` string, required
  - `captcha` string, required
  - `email_code` string, required

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/twtapi/apis/twtapi-backend.md) · [All operations](https://skmtc.dev/twtapi/apis/twtapi-backend/llms.txt) · [OpenAPI document](https://skmtc.dev/twtapi/apis/twtapi-backend/revisions/5295976febaf?raw)
