> ## Documentation Index
> Fetch the complete documentation index at: https://replyke-feat-push-rich-payload-fields.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Sign Up

> Register a new user with credentials and optional profile data

Register a new user by providing required credentials and optional profile data. Returns access and refresh tokens along with user data.

## Body Parameters

<ParamField body="email" type="string" required>
  User's email address
</ParamField>

<ParamField body="password" type="string" required>
  User's password
</ParamField>

<ParamField body="name" type="string">
  Full name of the user
</ParamField>

<ParamField body="username" type="string">
  Unique username (will be automatically lowercased)
</ParamField>

<ParamField body="avatar" type="string">
  URL to the user's avatar image
</ParamField>

<ParamField body="bio" type="string">
  Short biography or description
</ParamField>

<ParamField body="location" type="object">
  Geolocation object with `longitude` and `latitude` properties
</ParamField>

<ParamField body="birthdate" type="string">
  User's birthdate in ISO 8601 format
</ParamField>

<ParamField body="metadata" type="object">
  Custom public metadata that will be returned in API responses
</ParamField>

<ParamField body="secureMetadata" type="object">
  Custom secure metadata (not returned to client, server-side only)
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Indicates whether the registration was successful
</ResponseField>

<ResponseField name="accessToken" type="string">
  JWT access token for authenticating API requests
</ResponseField>

<ResponseField name="refreshToken" type="string">
  JWT refresh token for obtaining new access tokens
</ResponseField>

<ResponseField name="user" type="User Object">
  The newly created user object

  <Expandable title="properties">
    <ResponseField name="id" type="string">
      Unique user identifier
    </ResponseField>

    <ResponseField name="email" type="string">
      User's email address
    </ResponseField>

    <ResponseField name="username" type="string">
      User's unique username
    </ResponseField>

    <ResponseField name="name" type="string">
      User's full name
    </ResponseField>

    <ResponseField name="avatar" type="string">
      URL to user's avatar image
    </ResponseField>

    <ResponseField name="bio" type="string">
      User's biography
    </ResponseField>

    <ResponseField name="location" type="object">
      <Expandable title="properties">
        <ResponseField name="type" type="string">
          GeoJSON type (always "Point")
        </ResponseField>

        <ResponseField name="coordinates" type="number[]">
          Array of \[longitude, latitude]
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="birthdate" type="string">
      User's birthdate in ISO 8601 format
    </ResponseField>

    <ResponseField name="metadata" type="object">
      Custom public metadata
    </ResponseField>

    <ResponseField name="suspensions" type="array">
      Array of active suspensions (empty for new users)
    </ResponseField>

    <ResponseField name="reputation" type="number">
      User's reputation score (starts at 0)
    </ResponseField>

    <ResponseField name="createdAt" type="string">
      Account creation timestamp
    </ResponseField>

    <ResponseField name="updatedAt" type="string">
      Last update timestamp
    </ResponseField>
  </Expandable>
</ResponseField>

## Error Responses

<AccordionGroup>
  <Accordion title="Missing Required Fields - 400 Bad Request">
    ```json theme={null}
    {
      "error": "Missing required fields",
      "code": "auth/missing-fields"
    }
    ```
  </Accordion>

  <Accordion title="Server Error - 500 Internal Server Error">
    ```json theme={null}
    {
      "error": "Internal server error",
      "code": "auth/server-error",
      "details": "<Error message>"
    }
    ```
  </Accordion>
</AccordionGroup>

***

## Notes

* Sets an HttpOnly cookie named `replyke-refresh-jwt` with the refresh token.
* Access token is returned in the response body.
* Sensitive user data is excluded in the response.
* A webhook is called before user creation to allow project-specific validation.
