Auth & Organizations

Registration API

Detailed documentation for the customer registration API endpoint.


Customer Registration

The registration endpoint allows you to create new customer accounts within a specific project.

Endpoint

POST /api/v1/auth/register

Authentication

Requires a valid Publishable Key (x-publishable-key) or Secret Key (x-api-key) in the headers.

Request Body

| Field | Type | Required | Description |
| :---------- | :------- | :------- | :------------------------------------------ |
| email | string | Yes | The customer's email address. |
| password | string | Yes | The customer's password (must meet policy). |
| firstName | string | No | Customer's first name. |
| lastName | string | No | Customer's last name. |

Example Request

json
{
  "email": "jane.doe@example.com",
  "password": "SecurePassword123!",
  "firstName": "Jane",
  "lastName": "Doe"
}

Response

Success (201 Created)

Returns the customer object and a set of authentication tokens.

json
{
  "tokens": {
    "accessToken": "...",
    "refreshToken": "...",
    "expiresIn": 3600
  },
  "customer": {
    "id": "...",
    "email": "jane.doe@example.com",
    "firstName": "Jane",
    "lastName": "Doe",
    "emailVerified": false
  }
}

Password Policy

AuthSetu enforces a default password policy:

  • Minimum 8 characters.

  • Must contain at least one uppercase letter.

  • Must contain at least one lowercase letter.

  • Must contain at least one digit.

Was this page helpful?