Auth
Register Tenant
Register a new tenant account and receive an API key.
POST
/
auth
/
register
Register a tenant + owner user (signup)
curl --request POST \
--url https://billing.example.com/auth/register \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"company_name": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"password": "<string>",
"country": "<string>"
}
'import requests
url = "https://billing.example.com/auth/register"
payload = {
"company_name": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"password": "<string>",
"country": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
company_name: '<string>',
name: '<string>',
email: 'jsmith@example.com',
password: '<string>',
country: '<string>'
})
};
fetch('https://billing.example.com/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_URL => "https://billing.example.com/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([
'company_name' => '<string>',
'name' => '<string>',
'email' => 'jsmith@example.com',
'password' => '<string>',
'country' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://billing.example.com/auth/register"
payload := strings.NewReader("{\n \"company_name\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"password\": \"<string>\",\n \"country\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://billing.example.com/auth/register")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"company_name\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"password\": \"<string>\",\n \"country\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/auth/register")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"company_name\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"password\": \"<string>\",\n \"country\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"tenant": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "jsmith@example.com",
"data_region": "<string>",
"base_currency": "<string>",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"api_key": "<string>",
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "jsmith@example.com",
"name": "<string>",
"role": "owner"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | The name of the tenant or organization. |
email | string | Yes | Email address for the account. Must be unique. |
password | string | Yes | Account password. Minimum 8 characters. |
Example Request
curl -X POST https://api.recurso.dev/auth/register \
-H "Content-Type: application/json" \
-d '{
"name": "Acme Corporation",
"email": "admin@acme.com",
"password": "s3cur3P@ssw0rd"
}'
Response
Returns the new tenant ID and API key.{
"tenant_id": "ten_d4c3b2a1-0f9e-8765-4321-abcdef012345",
"api_key": "rsk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
"message": "Account created"
}
Store the
api_key securely — it is only shown once. If lost, you will need to
generate a new key from the dashboard. Recurso cannot retrieve your existing key.Use the returned
api_key as a Bearer token in the Authorization header for all
subsequent API requests.Authorizations
Body
application/json
The tenant / company name.
The owner user's display name.
Minimum string length:
8Optional ISO-2 business country (e.g. "US"). Stamped on the tenant's primary legal entity, which is the seller tax jurisdiction — a US signup invoices under US sales tax from day one. Omit to configure later in settings.
Required string length:
2⌘I
Register a tenant + owner user (signup)
curl --request POST \
--url https://billing.example.com/auth/register \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"company_name": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"password": "<string>",
"country": "<string>"
}
'import requests
url = "https://billing.example.com/auth/register"
payload = {
"company_name": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"password": "<string>",
"country": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
company_name: '<string>',
name: '<string>',
email: 'jsmith@example.com',
password: '<string>',
country: '<string>'
})
};
fetch('https://billing.example.com/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_URL => "https://billing.example.com/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([
'company_name' => '<string>',
'name' => '<string>',
'email' => 'jsmith@example.com',
'password' => '<string>',
'country' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://billing.example.com/auth/register"
payload := strings.NewReader("{\n \"company_name\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"password\": \"<string>\",\n \"country\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://billing.example.com/auth/register")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"company_name\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"password\": \"<string>\",\n \"country\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/auth/register")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"company_name\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"password\": \"<string>\",\n \"country\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"tenant": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"email": "jsmith@example.com",
"data_region": "<string>",
"base_currency": "<string>",
"organization_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"api_key": "<string>",
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "jsmith@example.com",
"name": "<string>",
"role": "owner"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}