Register a new user
curl --request POST \
--url http://localhost:7701/api/v1/auth/register \
--header 'Content-Type: application/json' \
--header 'x-client-id: <x-client-id>' \
--data '
{
"name": "John Doe",
"email": "john@example.com",
"password": "secret123",
"password_confirmation": "secret123",
"company_name": "Acme Corp",
"company_cnpj": "12345678000190",
"company_financial_email": "fin@empresa.com",
"company_phone": "11900000000"
}
'import requests
url = "http://localhost:7701/api/v1/auth/register"
payload = {
"name": "John Doe",
"email": "john@example.com",
"password": "secret123",
"password_confirmation": "secret123",
"company_name": "Acme Corp",
"company_cnpj": "12345678000190",
"company_financial_email": "fin@empresa.com",
"company_phone": "11900000000"
}
headers = {
"x-client-id": "<x-client-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-client-id': '<x-client-id>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'John Doe',
email: 'john@example.com',
password: 'secret123',
password_confirmation: 'secret123',
company_name: 'Acme Corp',
company_cnpj: '12345678000190',
company_financial_email: 'fin@empresa.com',
company_phone: '11900000000'
})
};
fetch('http://localhost:7701/api/v1/auth/register', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "7701",
CURLOPT_URL => "http://localhost:7701/api/v1/auth/register",
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([
'name' => 'John Doe',
'email' => 'john@example.com',
'password' => 'secret123',
'password_confirmation' => 'secret123',
'company_name' => 'Acme Corp',
'company_cnpj' => '12345678000190',
'company_financial_email' => 'fin@empresa.com',
'company_phone' => '11900000000'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-client-id: <x-client-id>"
],
]);
$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 := "http://localhost:7701/api/v1/auth/register"
payload := strings.NewReader("{\n \"name\": \"John Doe\",\n \"email\": \"john@example.com\",\n \"password\": \"secret123\",\n \"password_confirmation\": \"secret123\",\n \"company_name\": \"Acme Corp\",\n \"company_cnpj\": \"12345678000190\",\n \"company_financial_email\": \"fin@empresa.com\",\n \"company_phone\": \"11900000000\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-id", "<x-client-id>")
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("http://localhost:7701/api/v1/auth/register")
.header("x-client-id", "<x-client-id>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"John Doe\",\n \"email\": \"john@example.com\",\n \"password\": \"secret123\",\n \"password_confirmation\": \"secret123\",\n \"company_name\": \"Acme Corp\",\n \"company_cnpj\": \"12345678000190\",\n \"company_financial_email\": \"fin@empresa.com\",\n \"company_phone\": \"11900000000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:7701/api/v1/auth/register")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["x-client-id"] = '<x-client-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"John Doe\",\n \"email\": \"john@example.com\",\n \"password\": \"secret123\",\n \"password_confirmation\": \"secret123\",\n \"company_name\": \"Acme Corp\",\n \"company_cnpj\": \"12345678000190\",\n \"company_financial_email\": \"fin@empresa.com\",\n \"company_phone\": \"11900000000\"\n}"
response = http.request(request)
puts response.read_body{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
"token_type": "Bearer",
"expires_at": "2026-05-27T12:00:00+00:00",
"user": {
"id": 1,
"name": "John Doe",
"email": "john@example.com",
"company_id": 1
},
"company": {
"name": "Acme Corp",
"client_id": "client_a1b2c3d4e5f6g7h8",
"api_key": "sk_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
"warning": "Save your api_key safely, it won't be shown again."
}
}Auth
Register a new user
Creates a user account and automatically provisions a company for them. Returns a JWT token for immediate authentication.
POST
/
api
/
v1
/
auth
/
register
Register a new user
curl --request POST \
--url http://localhost:7701/api/v1/auth/register \
--header 'Content-Type: application/json' \
--header 'x-client-id: <x-client-id>' \
--data '
{
"name": "John Doe",
"email": "john@example.com",
"password": "secret123",
"password_confirmation": "secret123",
"company_name": "Acme Corp",
"company_cnpj": "12345678000190",
"company_financial_email": "fin@empresa.com",
"company_phone": "11900000000"
}
'import requests
url = "http://localhost:7701/api/v1/auth/register"
payload = {
"name": "John Doe",
"email": "john@example.com",
"password": "secret123",
"password_confirmation": "secret123",
"company_name": "Acme Corp",
"company_cnpj": "12345678000190",
"company_financial_email": "fin@empresa.com",
"company_phone": "11900000000"
}
headers = {
"x-client-id": "<x-client-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-client-id': '<x-client-id>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'John Doe',
email: 'john@example.com',
password: 'secret123',
password_confirmation: 'secret123',
company_name: 'Acme Corp',
company_cnpj: '12345678000190',
company_financial_email: 'fin@empresa.com',
company_phone: '11900000000'
})
};
fetch('http://localhost:7701/api/v1/auth/register', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "7701",
CURLOPT_URL => "http://localhost:7701/api/v1/auth/register",
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([
'name' => 'John Doe',
'email' => 'john@example.com',
'password' => 'secret123',
'password_confirmation' => 'secret123',
'company_name' => 'Acme Corp',
'company_cnpj' => '12345678000190',
'company_financial_email' => 'fin@empresa.com',
'company_phone' => '11900000000'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-client-id: <x-client-id>"
],
]);
$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 := "http://localhost:7701/api/v1/auth/register"
payload := strings.NewReader("{\n \"name\": \"John Doe\",\n \"email\": \"john@example.com\",\n \"password\": \"secret123\",\n \"password_confirmation\": \"secret123\",\n \"company_name\": \"Acme Corp\",\n \"company_cnpj\": \"12345678000190\",\n \"company_financial_email\": \"fin@empresa.com\",\n \"company_phone\": \"11900000000\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-client-id", "<x-client-id>")
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("http://localhost:7701/api/v1/auth/register")
.header("x-client-id", "<x-client-id>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"John Doe\",\n \"email\": \"john@example.com\",\n \"password\": \"secret123\",\n \"password_confirmation\": \"secret123\",\n \"company_name\": \"Acme Corp\",\n \"company_cnpj\": \"12345678000190\",\n \"company_financial_email\": \"fin@empresa.com\",\n \"company_phone\": \"11900000000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:7701/api/v1/auth/register")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["x-client-id"] = '<x-client-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"John Doe\",\n \"email\": \"john@example.com\",\n \"password\": \"secret123\",\n \"password_confirmation\": \"secret123\",\n \"company_name\": \"Acme Corp\",\n \"company_cnpj\": \"12345678000190\",\n \"company_financial_email\": \"fin@empresa.com\",\n \"company_phone\": \"11900000000\"\n}"
response = http.request(request)
puts response.read_body{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
"token_type": "Bearer",
"expires_at": "2026-05-27T12:00:00+00:00",
"user": {
"id": 1,
"name": "John Doe",
"email": "john@example.com",
"company_id": 1
},
"company": {
"name": "Acme Corp",
"client_id": "client_a1b2c3d4e5f6g7h8",
"api_key": "sk_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
"warning": "Save your api_key safely, it won't be shown again."
}
}Headers
Client identifier for the company in the request.
Example:
"client_abc123"
Body
application/json
Example:
"John Doe"
Example:
"john@example.com"
Minimum string length:
8Example:
"secret123"
Example:
"secret123"
Example:
"Acme Corp"
Example:
"12345678000190"
Example:
"fin@empresa.com"
Example:
"11900000000"