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

# Register

> Create a new user account.

Creates a new user account and returns a JWT token. An organization and default project are automatically created for the new user.

## Request body

<ParamField body="first_name" type="string" required>
  User's first name. Max 100 characters.
</ParamField>

<ParamField body="last_name" type="string">
  User's last name. Max 100 characters.
</ParamField>

<ParamField body="email" type="string" required>
  Valid email address. Max 255 characters.
</ParamField>

<ParamField body="password" type="string" required>
  Password. Minimum 8 characters.
</ParamField>

<ParamField body="invitation_token" type="string">
  Invitation token if registering via an invite link.
</ParamField>

<ParamField body="signup_source" type="string">
  Source of the signup (e.g., `widget`, `invitation`). Max 100 characters.
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  `true` on success.
</ResponseField>

<ResponseField name="data" type="object">
  <Expandable title="data fields">
    <ResponseField name="token" type="string">
      JWT bearer token for subsequent requests.
    </ResponseField>

    <ResponseField name="user" type="object">
      The newly created user object including `id`, `email`, `first_name`, `last_name`.
    </ResponseField>

    <ResponseField name="organization" type="object">
      The auto-created organization for this user.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json 201 theme={null}
  {
    "success": true,
    "data": {
      "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
      "user": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "email": "jane@example.com",
        "first_name": "Jane",
        "last_name": "Smith"
      },
      "organization": {
        "id": "660e8400-e29b-41d4-a716-446655440001",
        "name": "Jane's Organization"
      }
    }
  }
  ```

  ```json 422 theme={null}
  {
    "success": false,
    "message": "Validation failed",
    "errors": {
      "email": ["The email has already been taken."]
    }
  }
  ```
</ResponseExample>
