Sign up a new user
Creates a new user account. Registration policy depends on tenant configuration.
POST
/
v1
/
auth
/
signup
Sign up a new user
curl --request POST \
--url https://api.kerne.io/v1/auth/signup \
--header 'Content-Type: application/json' \
--header 'x-app-id: <api-key>' \
--data '
{
"email": "[email protected]",
"password": "SecurePassword123!",
"first_name": "John",
"last_name": "Doe",
"invitationToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"invitationCode": "ABC12345"
}
'import requests
url = "https://api.kerne.io/v1/auth/signup"
payload = {
"email": "[email protected]",
"password": "SecurePassword123!",
"first_name": "John",
"last_name": "Doe",
"invitationToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"invitationCode": "ABC12345"
}
headers = {
"x-app-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-app-id': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: '[email protected]',
password: 'SecurePassword123!',
first_name: 'John',
last_name: 'Doe',
invitationToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...',
invitationCode: 'ABC12345'
})
};
fetch('https://api.kerne.io/v1/auth/signup', 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.kerne.io/v1/auth/signup",
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' => '[email protected]',
'password' => 'SecurePassword123!',
'first_name' => 'John',
'last_name' => 'Doe',
'invitationToken' => 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...',
'invitationCode' => 'ABC12345'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-app-id: <api-key>"
],
]);
$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.kerne.io/v1/auth/signup"
payload := strings.NewReader("{\n \"email\": \"[email protected]\",\n \"password\": \"SecurePassword123!\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"invitationToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\",\n \"invitationCode\": \"ABC12345\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-app-id", "<api-key>")
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.kerne.io/v1/auth/signup")
.header("x-app-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"[email protected]\",\n \"password\": \"SecurePassword123!\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"invitationToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\",\n \"invitationCode\": \"ABC12345\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kerne.io/v1/auth/signup")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-app-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"[email protected]\",\n \"password\": \"SecurePassword123!\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"invitationToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\",\n \"invitationCode\": \"ABC12345\"\n}"
response = http.request(request)
puts response.read_body{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"user": {
"id": "usr_01234567890abcdef",
"email": "[email protected]"
},
"refresh_token": "ref_0123456789abcdef",
"expires_at": "2025-01-01T01:00:00.000Z"
}Authorizations
App identifier (App.id, sent as the x-app-id header)
Body
application/json
User email address
Example:
User password (minimum 8 characters)
Required string length:
8 - 128Example:
"SecurePassword123!"
User first name
Example:
"John"
User last name
Example:
"Doe"
JWT invitation token received via email
Example:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
8-character invitation code
Required string length:
8Example:
"ABC12345"
Response
201 - application/json
JWT authentication token
Example:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
Authenticated user information
Show child attributes
Show child attributes
Refresh token for obtaining new access tokens
Example:
"ref_0123456789abcdef"
Token expiration timestamp (ISO)
Example:
"2025-01-01T01:00:00.000Z"
⌘I
Sign up a new user
curl --request POST \
--url https://api.kerne.io/v1/auth/signup \
--header 'Content-Type: application/json' \
--header 'x-app-id: <api-key>' \
--data '
{
"email": "[email protected]",
"password": "SecurePassword123!",
"first_name": "John",
"last_name": "Doe",
"invitationToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"invitationCode": "ABC12345"
}
'import requests
url = "https://api.kerne.io/v1/auth/signup"
payload = {
"email": "[email protected]",
"password": "SecurePassword123!",
"first_name": "John",
"last_name": "Doe",
"invitationToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"invitationCode": "ABC12345"
}
headers = {
"x-app-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-app-id': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: '[email protected]',
password: 'SecurePassword123!',
first_name: 'John',
last_name: 'Doe',
invitationToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...',
invitationCode: 'ABC12345'
})
};
fetch('https://api.kerne.io/v1/auth/signup', 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.kerne.io/v1/auth/signup",
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' => '[email protected]',
'password' => 'SecurePassword123!',
'first_name' => 'John',
'last_name' => 'Doe',
'invitationToken' => 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...',
'invitationCode' => 'ABC12345'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-app-id: <api-key>"
],
]);
$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.kerne.io/v1/auth/signup"
payload := strings.NewReader("{\n \"email\": \"[email protected]\",\n \"password\": \"SecurePassword123!\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"invitationToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\",\n \"invitationCode\": \"ABC12345\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-app-id", "<api-key>")
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.kerne.io/v1/auth/signup")
.header("x-app-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"[email protected]\",\n \"password\": \"SecurePassword123!\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"invitationToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\",\n \"invitationCode\": \"ABC12345\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kerne.io/v1/auth/signup")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-app-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"[email protected]\",\n \"password\": \"SecurePassword123!\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"invitationToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\",\n \"invitationCode\": \"ABC12345\"\n}"
response = http.request(request)
puts response.read_body{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"user": {
"id": "usr_01234567890abcdef",
"email": "[email protected]"
},
"refresh_token": "ref_0123456789abcdef",
"expires_at": "2025-01-01T01:00:00.000Z"
}
