curl --request POST \
--url https://api.example.com/api/auth/users \
--header 'Content-Type: application/json' \
--data '
{
"email": "user@example.com",
"password": "securepassword123",
"name": "John Doe",
"redirectTo": "<string>"
}
'import requests
url = "https://api.example.com/api/auth/users"
payload = {
"email": "user@example.com",
"password": "securepassword123",
"name": "John Doe",
"redirectTo": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'user@example.com',
password: 'securepassword123',
name: 'John Doe',
redirectTo: '<string>'
})
};
fetch('https://api.example.com/api/auth/users', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/auth/users",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'user@example.com',
'password' => 'securepassword123',
'name' => 'John Doe',
'redirectTo' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/auth/users"
payload := strings.NewReader("{\n \"email\": \"user@example.com\",\n \"password\": \"securepassword123\",\n \"name\": \"John Doe\",\n \"redirectTo\": \"<string>\"\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(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/auth/users")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"user@example.com\",\n \"password\": \"securepassword123\",\n \"name\": \"John Doe\",\n \"redirectTo\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/auth/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 \"email\": \"user@example.com\",\n \"password\": \"securepassword123\",\n \"name\": \"John Doe\",\n \"redirectTo\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "jsmith@example.com",
"profile": {
"name": "<string>",
"avatar_url": "<string>"
},
"metadata": {},
"emailVerified": true,
"providers": [
"<string>"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"accessToken": "<string>",
"csrfToken": "<string>",
"refreshToken": "<string>",
"requireEmailVerification": true
}{
"error": "AUTH_SIGNUP_DISABLED",
"message": "User signups are disabled for this project.",
"statusCode": 403
}{
"error": "AUTH_VERIFICATION_EMAIL_DELIVERY_FAILED",
"message": "The user account was created, but the verification email could not be sent.",
"statusCode": 429,
"nextActions": "The user account already exists. Retry delivery with POST /api/auth/email/send-verification instead of registering again."
}{
"error": "AUTH_VERIFICATION_EMAIL_DELIVERY_FAILED",
"message": "The user account was created, but the verification email could not be sent.",
"statusCode": 500,
"nextActions": "The user account already exists. Retry delivery with POST /api/auth/email/send-verification instead of registering again."
}Register new user
Creates a new user account. When email verification is required, a delivery failure is returned as an error after the account is created. Retry delivery with POST /api/auth/email/send-verification instead of registering the same email again.
curl --request POST \
--url https://api.example.com/api/auth/users \
--header 'Content-Type: application/json' \
--data '
{
"email": "user@example.com",
"password": "securepassword123",
"name": "John Doe",
"redirectTo": "<string>"
}
'import requests
url = "https://api.example.com/api/auth/users"
payload = {
"email": "user@example.com",
"password": "securepassword123",
"name": "John Doe",
"redirectTo": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'user@example.com',
password: 'securepassword123',
name: 'John Doe',
redirectTo: '<string>'
})
};
fetch('https://api.example.com/api/auth/users', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/auth/users",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'user@example.com',
'password' => 'securepassword123',
'name' => 'John Doe',
'redirectTo' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/auth/users"
payload := strings.NewReader("{\n \"email\": \"user@example.com\",\n \"password\": \"securepassword123\",\n \"name\": \"John Doe\",\n \"redirectTo\": \"<string>\"\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(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/auth/users")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"user@example.com\",\n \"password\": \"securepassword123\",\n \"name\": \"John Doe\",\n \"redirectTo\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/auth/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 \"email\": \"user@example.com\",\n \"password\": \"securepassword123\",\n \"name\": \"John Doe\",\n \"redirectTo\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "jsmith@example.com",
"profile": {
"name": "<string>",
"avatar_url": "<string>"
},
"metadata": {},
"emailVerified": true,
"providers": [
"<string>"
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"accessToken": "<string>",
"csrfToken": "<string>",
"refreshToken": "<string>",
"requireEmailVerification": true
}{
"error": "AUTH_SIGNUP_DISABLED",
"message": "User signups are disabled for this project.",
"statusCode": 403
}{
"error": "AUTH_VERIFICATION_EMAIL_DELIVERY_FAILED",
"message": "The user account was created, but the verification email could not be sent.",
"statusCode": 429,
"nextActions": "The user account already exists. Retry delivery with POST /api/auth/email/send-verification instead of registering again."
}{
"error": "AUTH_VERIFICATION_EMAIL_DELIVERY_FAILED",
"message": "The user account was created, but the verification email could not be sent.",
"statusCode": 500,
"nextActions": "The user account already exists. Retry delivery with POST /api/auth/email/send-verification instead of registering again."
}Query Parameters
Client type determines how refresh tokens are returned:
- web: Refresh token stored in httpOnly cookie, csrfToken returned in response
- mobile/desktop/server: refreshToken returned directly in response body
web, mobile, desktop, server Body
"user@example.com"
Password meeting configured requirements (check /api/auth/email/config for current requirements)
"securepassword123"
"John Doe"
Used for link-based email verification. The email link always opens an InsForge backend endpoint first; after the token is verified, InsForge redirects the browser to this URL. This URL must be included in allowedRedirectUrls. Recommended: use your app's sign-in page.
Response
User created successfully
Show child attributes
Show child attributes
JWT authentication token (null if email verification required)
CSRF token for use with refresh endpoint (web clients only, null if email verification required)
Refresh token for mobile/desktop/server clients (null for web clients or if email verification required)
Whether email verification is required before login
Was this page helpful?