> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://customerhub.com/api/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://customerhub.com/api/_mcp/server.

# Register (Create User)

POST https://api.customerhub.com/web_api/users
Content-Type: application/json

Request a new account signup. Sends a confirmation email with a link to complete registration.

**Authentication:** Public — no auth required.

**Request body:**

* `first_name` (required) — User's first name
* `last_name` (required) — User's last name
* `email` (required) — User's email address
* `recaptcha_token` (required) — Google reCAPTCHA v3 token for bot prevention
* `to` (optional) — Redirect path after account confirmation
* `callback_url` (optional) — Full base URL for the confirmation link in the email. The confirmation token will be appended as a path segment (e.g. `https://yourapp.example.com/confirm/{token}`). When omitted, the default platform URL is used.

**Response (201):**

* `message` — "Please check your email to confirm your account."

**Side effects:** Triggers a `VisitorAccountRequested` event which sends a confirmation email with a token link.

**Errors:**

* `422` — reCAPTCHA verification failed, or validation errors (e.g. email already taken, missing fields)

Reference: https://customerhub.com/api/api-reference/users-registration/register-create-user

## Request

### Body (application/json)

This endpoint expects an object.

- `first_name` (string, optional)
- `last_name` (string, optional)
- `email` (string, optional)
- `recaptcha_token` (string, optional)
- `to` (string, optional)
- `callback_url` (string, optional)

## Response

### 201

Created

## Examples

**Request**

```json
{
  "first_name": "John",
  "last_name": "Doe",
  "email": "john@example.com",
  "recaptcha_token": "",
  "to": "/dashboard",
  "callback_url": "https://yourapp.example.com/confirm"
}
```

**Response**

```json
{
  "data": {
    "message": "Please check your email to confirm your account."
  }
}
```

**SDK Code**

```python Users & Registration_registerCreateUser_example
import requests

url = "https://api.customerhub.com/web_api/users"

payload = {
    "first_name": "John",
    "last_name": "Doe",
    "email": "john@example.com",
    "recaptcha_token": "",
    "to": "/dashboard",
    "callback_url": "https://yourapp.example.com/confirm"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Users & Registration_registerCreateUser_example
const url = 'https://api.customerhub.com/web_api/users';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"first_name":"John","last_name":"Doe","email":"john@example.com","recaptcha_token":"","to":"/dashboard","callback_url":"https://yourapp.example.com/confirm"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Users & Registration_registerCreateUser_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.customerhub.com/web_api/users"

	payload := strings.NewReader("{\n  \"first_name\": \"John\",\n  \"last_name\": \"Doe\",\n  \"email\": \"john@example.com\",\n  \"recaptcha_token\": \"\",\n  \"to\": \"/dashboard\",\n  \"callback_url\": \"https://yourapp.example.com/confirm\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Users & Registration_registerCreateUser_example
require 'uri'
require 'net/http'

url = URI("https://api.customerhub.com/web_api/users")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"first_name\": \"John\",\n  \"last_name\": \"Doe\",\n  \"email\": \"john@example.com\",\n  \"recaptcha_token\": \"\",\n  \"to\": \"/dashboard\",\n  \"callback_url\": \"https://yourapp.example.com/confirm\"\n}"

response = http.request(request)
puts response.read_body
```

```java Users & Registration_registerCreateUser_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.customerhub.com/web_api/users")
  .header("Content-Type", "application/json")
  .body("{\n  \"first_name\": \"John\",\n  \"last_name\": \"Doe\",\n  \"email\": \"john@example.com\",\n  \"recaptcha_token\": \"\",\n  \"to\": \"/dashboard\",\n  \"callback_url\": \"https://yourapp.example.com/confirm\"\n}")
  .asString();
```

```php Users & Registration_registerCreateUser_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.customerhub.com/web_api/users', [
  'body' => '{
  "first_name": "John",
  "last_name": "Doe",
  "email": "john@example.com",
  "recaptcha_token": "",
  "to": "/dashboard",
  "callback_url": "https://yourapp.example.com/confirm"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Users & Registration_registerCreateUser_example
using RestSharp;

var client = new RestClient("https://api.customerhub.com/web_api/users");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"first_name\": \"John\",\n  \"last_name\": \"Doe\",\n  \"email\": \"john@example.com\",\n  \"recaptcha_token\": \"\",\n  \"to\": \"/dashboard\",\n  \"callback_url\": \"https://yourapp.example.com/confirm\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Users & Registration_registerCreateUser_example
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "first_name": "John",
  "last_name": "Doe",
  "email": "john@example.com",
  "recaptcha_token": "",
  "to": "/dashboard",
  "callback_url": "https://yourapp.example.com/confirm"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.customerhub.com/web_api/users")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```