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

# Sign Up

> Create a new account using your email, password, and a verified OTP.

Create or update an account by submitting your details along with the OTP you received from [Request OTP](/api-reference/auth/request-otp). All four required fields must be present and the OTP must still be valid.

## Request

**`POST /auth/signup`**

<ParamField body="name" type="string" required>
  The user's display name.
</ParamField>

<ParamField body="email" type="string" required>
  The email address associated with the account.
</ParamField>

<ParamField body="password" type="string" required>
  The password for the new account.
</ParamField>

<ParamField body="otp" type="string" required>
  The one-time password sent to your email via the Request OTP endpoint.
</ParamField>

<ParamField body="role" type="string">
  The account role. Accepted values: `USER`, `RIDER`, `DRIVER`, `ADMIN`. Defaults to the application's default role if omitted.
</ParamField>

## Response

<ResponseField name="message" type="string">
  Returns `"Account created/updated successfully."` on success.
</ResponseField>

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST http://localhost:8080/auth/signup \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Alex",
      "email": "alex@example.com",
      "password": "s3cur3P@ss",
      "otp": "482910"
    }'
  ```

  ```json Response theme={null}
  {
    "message": "Account created/updated successfully."
  }
  ```
</CodeGroup>

<Note>
  The OTP must be valid and not expired. Request a new OTP via [Request OTP](/api-reference/auth/request-otp) if yours has expired.
</Note>

## Error codes

| Status | Meaning                                                                                   |
| ------ | ----------------------------------------------------------------------------------------- |
| 400    | One or more required fields are missing, the OTP is absent, or the OTP is invalid/expired |
