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

# アカウント登録

> 新規ユーザーがアカウントを登録するエンドポイントです。

## POST /auth/register

新しいユーザーアカウントを作成します。公開エンドポイントで認証は不要です。登録に成功すると、確認用メールがユーザーに送信されます。

### リクエストボディ

<ParamField body="email" type="string" required>
  ユーザーのメールアドレス。有効かつ一意である必要があります。
</ParamField>

<ParamField body="password" type="string" required>
  パスワード。8 文字以上で、強度要件を満たす必要があります。
</ParamField>

<ParamField body="firstName" type="string" required>
  名。最大 50 文字。
</ParamField>

<ParamField body="lastName" type="string">
  姓。最大 50 文字。
</ParamField>

<ParamField body="company" type="string">
  会社名。最大 100 文字。
</ParamField>

### レスポンス

<ResponseField name="success" type="boolean">
  登録が成功したかどうか。
</ResponseField>

<ResponseField name="message" type="string">
  読みやすいステータスメッセージ。
</ResponseField>

<ResponseField name="user" type="object">
  新規作成ユーザーの情報。

  <Expandable title="user のプロパティ">
    <ResponseField name="id" type="string">
      ユーザーの一意な識別子。
    </ResponseField>

    <ResponseField name="email" type="string">
      ユーザーのメールアドレス。
    </ResponseField>

    <ResponseField name="name" type="string">
      ユーザーの氏名。
    </ResponseField>

    <ResponseField name="emailVerified" type="boolean">
      メール確認済みかどうか（初期は `false`）。
    </ResponseField>

    <ResponseField name="createdAt" type="string">
      アカウント作成日時の ISO 8601 タイムスタンプ。
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="tokens" type="object">
  認証トークンを含むオブジェクト。

  <Expandable title="tokens のプロパティ">
    <ResponseField name="accessToken" type="string">
      以降のリクエスト認証用のアクセストークン。有効期限は 15 分です。
    </ResponseField>

    <ResponseField name="refreshToken" type="string">
      新しいアクセストークンを取得するためのリフレッシュトークン。有効期限は 7 日です。
    </ResponseField>

    <ResponseField name="expiresIn" type="number">
      トークンの有効期限（秒）。900 は 15 分を意味します。
    </ResponseField>

    <ResponseField name="tokenType" type="string">
      トークン種別（常に `Bearer`）。
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.llmgenerator.com/api/v1/auth/register \
    -H "Content-Type: application/json" \
    -d '{
          "email": "user@example.com",
          "password": "securePassword123!",
          "firstName": "John",
          "lastName": "Doe",
          "company": "Acme Inc"
        }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.llmgenerator.com/api/v1/auth/register', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      email: 'user@example.com',
      password: 'securePassword123!',
      firstName: 'John',
      lastName: 'Doe'
    })
  });

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://api.llmgenerator.com/api/v1/auth/register',
      json={
          'email': 'user@example.com',
          'password': 'securePassword123!',
          'firstName': 'John',
          'lastName': 'Doe'
      }
  )

  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 成功 (201) theme={null}
  {
    "success": true,
    "message": "Account created successfully",
    "user": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "email": "user@example.com",
      "name": "John Doe",
      "emailVerified": false,
      "createdAt": "2026-01-29T12:00:00.000Z"
    },
    "tokens": {
      "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
      "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
      "expiresIn": 900,
      "tokenType": "Bearer"
    }
  }
  ```

  ```json メールアドレスは既に登録済み (409) theme={null}
  {
    "message": "Email already registered"
  }
  ```

  ```json パスワードが弱い (400) theme={null}
  {
    "message": "Weak password: Password must contain at least one uppercase letter, one number"
  }
  ```
</ResponseExample>
