curl --request POST \
--url https://api.example.com/api/auth/register \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"nombre": "<string>",
"apellido": "<string>",
"password": "<string>",
"telefono": "<string>"
}
'{
"201": {},
"400": {},
"409": {},
"success": true,
"data": {
"user": {
"id": 123,
"email": "<string>",
"nombre": "<string>",
"apellido": "<string>",
"telefono": "<string>",
"role": "<string>"
},
"token": "<string>"
}
}Create a new user account
curl --request POST \
--url https://api.example.com/api/auth/register \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"nombre": "<string>",
"apellido": "<string>",
"password": "<string>",
"telefono": "<string>"
}
'{
"201": {},
"400": {},
"409": {},
"success": true,
"data": {
"user": {
"id": 123,
"email": "<string>",
"nombre": "<string>",
"apellido": "<string>",
"telefono": "<string>",
"role": "<string>"
},
"token": "<string>"
}
}POST /api/auth/register
Show data properties
{
"success": false,
"error": "El email ya está registrado"
}
curl -X POST https://api.pcfix.com/api/auth/register \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"nombre": "María",
"apellido": "García",
"telefono": "+1234567890",
"password": "miPassword123"
}'
const response = await fetch('https://api.pcfix.com/api/auth/register', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: '[email protected]',
nombre: 'María',
apellido: 'García',
telefono: '+1234567890',
password: 'miPassword123'
})
});
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'https://api.pcfix.com/api/auth/register',
json={
'email': '[email protected]',
'nombre': 'María',
'apellido': 'García',
'telefono': '+1234567890',
'password': 'miPassword123'
}
)
data = response.json()
print(data)
{
"success": true,
"data": {
"user": {
"id": 456,
"email": "[email protected]",
"nombre": "María",
"apellido": "García",
"telefono": "+1234567890",
"role": "USER"
},
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
}
telefono field is optional and can be omitted from the request