> ## Documentation Index
> Fetch the complete documentation index at: https://docs.molesignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 登录

> 用邮箱和密码换取 JWT。

```http theme={null}
POST /api/v1/auth/signin
```

用邮箱 + 密码换取 JWT。该路由**免认证**。

**请求体**

| 字段         | 类型     | 必填 |
| ---------- | ------ | -- |
| `email`    | string | ✅  |
| `password` | string | ✅  |

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST http://localhost:5080/api/v1/auth/signin \
    -H 'content-type: application/json' \
    -d '{"email":"admin@example.com","password":"admin"}'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "token": "eyJhbGciOi...",
    "user_id": "<user-id>",
    "email": "admin@example.com",
    "display_name": "Administrator",
    "org_id": "<organization-id>",
    "org_name": "Default",
    "display_role": "Owner",
    "roles": [
      {
        "id": "<role-id>",
        "key": "owner",
        "name": "Owner",
        "builtin": true
      }
    ]
  }
  ```
</ResponseExample>

后续请求使用 `Authorization: Bearer <token>`。登录会选择用户的第一个组织成员关系；无人值守的集成应
使用 API token。
