Register
curl --request POST \
--url https://api.example.com/api/auth/register \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"password": "<string>",
"nombre": "<string>",
"apellido": "<string>",
"telefono": "<string>"
}
'import requests
url = "https://api.example.com/api/auth/register"
payload = {
"email": "<string>",
"password": "<string>",
"nombre": "<string>",
"apellido": "<string>",
"telefono": "<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: '<string>',
password: '<string>',
nombre: '<string>',
apellido: '<string>',
telefono: '<string>'
})
};
fetch('https://api.example.com/api/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://api.example.com/api/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([
'email' => '<string>',
'password' => '<string>',
'nombre' => '<string>',
'apellido' => '<string>',
'telefono' => '<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/register"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"password\": \"<string>\",\n \"nombre\": \"<string>\",\n \"apellido\": \"<string>\",\n \"telefono\": \"<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/register")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"password\": \"<string>\",\n \"nombre\": \"<string>\",\n \"apellido\": \"<string>\",\n \"telefono\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/auth/register")
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\": \"<string>\",\n \"password\": \"<string>\",\n \"nombre\": \"<string>\",\n \"apellido\": \"<string>\",\n \"telefono\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"user": {
"id": "<string>",
"email": "<string>",
"nombre": {},
"apellido": {},
"telefono": {},
"email_verified": true,
"tour_version": {},
"tour_completed_at": {}
},
"error": "<string>"
}Authentication
Register
Create a new user account
POST
/
api
/
auth
/
register
Register
curl --request POST \
--url https://api.example.com/api/auth/register \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"password": "<string>",
"nombre": "<string>",
"apellido": "<string>",
"telefono": "<string>"
}
'import requests
url = "https://api.example.com/api/auth/register"
payload = {
"email": "<string>",
"password": "<string>",
"nombre": "<string>",
"apellido": "<string>",
"telefono": "<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: '<string>',
password: '<string>',
nombre: '<string>',
apellido: '<string>',
telefono: '<string>'
})
};
fetch('https://api.example.com/api/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://api.example.com/api/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([
'email' => '<string>',
'password' => '<string>',
'nombre' => '<string>',
'apellido' => '<string>',
'telefono' => '<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/register"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"password\": \"<string>\",\n \"nombre\": \"<string>\",\n \"apellido\": \"<string>\",\n \"telefono\": \"<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/register")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"password\": \"<string>\",\n \"nombre\": \"<string>\",\n \"apellido\": \"<string>\",\n \"telefono\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/auth/register")
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\": \"<string>\",\n \"password\": \"<string>\",\n \"nombre\": \"<string>\",\n \"apellido\": \"<string>\",\n \"telefono\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"user": {
"id": "<string>",
"email": "<string>",
"nombre": {},
"apellido": {},
"telefono": {},
"email_verified": true,
"tour_version": {},
"tour_completed_at": {}
},
"error": "<string>"
}Registers a new user in the Contafy platform. After successful registration, a verification email is sent to the provided email address.
400 Bad Request
Authentication
No authentication required.Request Body
string
required
User’s email address. Must be a valid email format and unique in the system.
string
required
User’s password. Should meet security requirements (minimum 8 characters recommended).
string
User’s first name (optional).
string
User’s last name (optional).
string
User’s phone number (optional).
Response
string
Success message confirming registration.
object
The newly created user object.
string
Unique user identifier.
string
User’s email address.
string | null
User’s first name.
string | null
User’s last name.
string | null
User’s phone number.
boolean
Email verification status. Will be
false for newly registered users.string | null
Version of the product tour completed by the user.
string | null
Timestamp when the tour was completed.
Example Request
curl -X POST https://api.contafy.com/api/auth/register \
-H "Content-Type: application/json" \
-d '{
"email": "usuario@ejemplo.com",
"password": "SecurePass123!",
"nombre": "Juan",
"apellido": "Pérez",
"telefono": "+52 55 1234 5678"
}'
Example Response
{
"message": "Usuario registrado exitosamente. Por favor verifica tu correo electrónico.",
"user": {
"id": "usr_1a2b3c4d5e6f7g8h",
"email": "usuario@ejemplo.com",
"nombre": "Juan",
"apellido": "Pérez",
"telefono": "+52 55 1234 5678",
"email_verified": false,
"tour_version": null,
"tour_completed_at": null
}
}
Error Responses
string
Error type identifier.
string
Human-readable error message.
Common Errors
400 Bad Request{
"error": "VALIDATION_ERROR",
"message": "El email ya está registrado"
}
{
"error": "VALIDATION_ERROR",
"message": "El formato del email es inválido"
}
⌘I