Update Profile
curl --request PUT \
--url https://api.example.com/api/profiles/{profileId} \
--header 'Content-Type: application/json' \
--data '
{
"nombre": "<string>",
"rfc": "<string>",
"tipo_persona": {},
"regimenes_fiscales": [
"<string>"
],
"validaciones_habilitadas": {
"validarRFCIngresos": true,
"validarRFCGastos": true,
"validarRegimenFiscal": true,
"validarUUIDDuplicado": true,
"bloquearSiRFCNoCoincide": true,
"bloquearSiRegimenNoCoincide": true
}
}
'import requests
url = "https://api.example.com/api/profiles/{profileId}"
payload = {
"nombre": "<string>",
"rfc": "<string>",
"tipo_persona": {},
"regimenes_fiscales": ["<string>"],
"validaciones_habilitadas": {
"validarRFCIngresos": True,
"validarRFCGastos": True,
"validarRegimenFiscal": True,
"validarUUIDDuplicado": True,
"bloquearSiRFCNoCoincide": True,
"bloquearSiRegimenNoCoincide": True
}
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
nombre: '<string>',
rfc: '<string>',
tipo_persona: {},
regimenes_fiscales: ['<string>'],
validaciones_habilitadas: {
validarRFCIngresos: true,
validarRFCGastos: true,
validarRegimenFiscal: true,
validarUUIDDuplicado: true,
bloquearSiRFCNoCoincide: true,
bloquearSiRegimenNoCoincide: true
}
})
};
fetch('https://api.example.com/api/profiles/{profileId}', 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/profiles/{profileId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'nombre' => '<string>',
'rfc' => '<string>',
'tipo_persona' => [
],
'regimenes_fiscales' => [
'<string>'
],
'validaciones_habilitadas' => [
'validarRFCIngresos' => true,
'validarRFCGastos' => true,
'validarRegimenFiscal' => true,
'validarUUIDDuplicado' => true,
'bloquearSiRFCNoCoincide' => true,
'bloquearSiRegimenNoCoincide' => true
]
]),
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/profiles/{profileId}"
payload := strings.NewReader("{\n \"nombre\": \"<string>\",\n \"rfc\": \"<string>\",\n \"tipo_persona\": {},\n \"regimenes_fiscales\": [\n \"<string>\"\n ],\n \"validaciones_habilitadas\": {\n \"validarRFCIngresos\": true,\n \"validarRFCGastos\": true,\n \"validarRegimenFiscal\": true,\n \"validarUUIDDuplicado\": true,\n \"bloquearSiRFCNoCoincide\": true,\n \"bloquearSiRegimenNoCoincide\": true\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.example.com/api/profiles/{profileId}")
.header("Content-Type", "application/json")
.body("{\n \"nombre\": \"<string>\",\n \"rfc\": \"<string>\",\n \"tipo_persona\": {},\n \"regimenes_fiscales\": [\n \"<string>\"\n ],\n \"validaciones_habilitadas\": {\n \"validarRFCIngresos\": true,\n \"validarRFCGastos\": true,\n \"validarRegimenFiscal\": true,\n \"validarUUIDDuplicado\": true,\n \"bloquearSiRFCNoCoincide\": true,\n \"bloquearSiRegimenNoCoincide\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/profiles/{profileId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"nombre\": \"<string>\",\n \"rfc\": \"<string>\",\n \"tipo_persona\": {},\n \"regimenes_fiscales\": [\n \"<string>\"\n ],\n \"validaciones_habilitadas\": {\n \"validarRFCIngresos\": true,\n \"validarRFCGastos\": true,\n \"validarRegimenFiscal\": true,\n \"validarUUIDDuplicado\": true,\n \"bloquearSiRFCNoCoincide\": true,\n \"bloquearSiRegimenNoCoincide\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"data": {
"id": "<string>",
"user_id": "<string>",
"nombre": "<string>",
"rfc": "<string>",
"tipo_persona": {},
"regimenes_fiscales": [
"<string>"
],
"validaciones_habilitadas": {},
"created_at": "<string>",
"updated_at": "<string>",
"frozen": true,
"frozen_reason": {},
"frozen_at": {}
}
}Profiles
Update Profile
Update an existing profile configuration
PUT
/
api
/
profiles
/
{profileId}
Update Profile
curl --request PUT \
--url https://api.example.com/api/profiles/{profileId} \
--header 'Content-Type: application/json' \
--data '
{
"nombre": "<string>",
"rfc": "<string>",
"tipo_persona": {},
"regimenes_fiscales": [
"<string>"
],
"validaciones_habilitadas": {
"validarRFCIngresos": true,
"validarRFCGastos": true,
"validarRegimenFiscal": true,
"validarUUIDDuplicado": true,
"bloquearSiRFCNoCoincide": true,
"bloquearSiRegimenNoCoincide": true
}
}
'import requests
url = "https://api.example.com/api/profiles/{profileId}"
payload = {
"nombre": "<string>",
"rfc": "<string>",
"tipo_persona": {},
"regimenes_fiscales": ["<string>"],
"validaciones_habilitadas": {
"validarRFCIngresos": True,
"validarRFCGastos": True,
"validarRegimenFiscal": True,
"validarUUIDDuplicado": True,
"bloquearSiRFCNoCoincide": True,
"bloquearSiRegimenNoCoincide": True
}
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
nombre: '<string>',
rfc: '<string>',
tipo_persona: {},
regimenes_fiscales: ['<string>'],
validaciones_habilitadas: {
validarRFCIngresos: true,
validarRFCGastos: true,
validarRegimenFiscal: true,
validarUUIDDuplicado: true,
bloquearSiRFCNoCoincide: true,
bloquearSiRegimenNoCoincide: true
}
})
};
fetch('https://api.example.com/api/profiles/{profileId}', 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/profiles/{profileId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'nombre' => '<string>',
'rfc' => '<string>',
'tipo_persona' => [
],
'regimenes_fiscales' => [
'<string>'
],
'validaciones_habilitadas' => [
'validarRFCIngresos' => true,
'validarRFCGastos' => true,
'validarRegimenFiscal' => true,
'validarUUIDDuplicado' => true,
'bloquearSiRFCNoCoincide' => true,
'bloquearSiRegimenNoCoincide' => true
]
]),
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/profiles/{profileId}"
payload := strings.NewReader("{\n \"nombre\": \"<string>\",\n \"rfc\": \"<string>\",\n \"tipo_persona\": {},\n \"regimenes_fiscales\": [\n \"<string>\"\n ],\n \"validaciones_habilitadas\": {\n \"validarRFCIngresos\": true,\n \"validarRFCGastos\": true,\n \"validarRegimenFiscal\": true,\n \"validarUUIDDuplicado\": true,\n \"bloquearSiRFCNoCoincide\": true,\n \"bloquearSiRegimenNoCoincide\": true\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.example.com/api/profiles/{profileId}")
.header("Content-Type", "application/json")
.body("{\n \"nombre\": \"<string>\",\n \"rfc\": \"<string>\",\n \"tipo_persona\": {},\n \"regimenes_fiscales\": [\n \"<string>\"\n ],\n \"validaciones_habilitadas\": {\n \"validarRFCIngresos\": true,\n \"validarRFCGastos\": true,\n \"validarRegimenFiscal\": true,\n \"validarUUIDDuplicado\": true,\n \"bloquearSiRFCNoCoincide\": true,\n \"bloquearSiRegimenNoCoincide\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/profiles/{profileId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"nombre\": \"<string>\",\n \"rfc\": \"<string>\",\n \"tipo_persona\": {},\n \"regimenes_fiscales\": [\n \"<string>\"\n ],\n \"validaciones_habilitadas\": {\n \"validarRFCIngresos\": true,\n \"validarRFCGastos\": true,\n \"validarRegimenFiscal\": true,\n \"validarUUIDDuplicado\": true,\n \"bloquearSiRFCNoCoincide\": true,\n \"bloquearSiRegimenNoCoincide\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"data": {
"id": "<string>",
"user_id": "<string>",
"nombre": "<string>",
"rfc": "<string>",
"tipo_persona": {},
"regimenes_fiscales": [
"<string>"
],
"validaciones_habilitadas": {},
"created_at": "<string>",
"updated_at": "<string>",
"frozen": true,
"frozen_reason": {},
"frozen_at": {}
}
}Authentication
This endpoint requires authentication using a JWT token in the Authorization header.Path Parameters
string
required
The unique identifier of the profile to update
Request Body
All fields are optional. Only include the fields you want to update.string
Name of the profile or business entity
string
RFC (Registro Federal de Contribuyentes) - Mexican tax identification number. Must be valid according to SAT format rules.
enum
Type of taxpayer entity:
FISICA: Individual taxpayer (Persona Física)MORAL: Corporation or legal entity (Persona Moral)
string[]
Array of tax regime codes applicable to this profile. These are official SAT regime codes (e.g., “601”, “603”, “605”).
object
Configuration object for validation rules to enable for this profile
boolean
Validate RFC on income invoices
boolean
Validate RFC on expense invoices
boolean
Validate tax regime matches profile configuration
boolean
Check for duplicate invoice UUIDs
boolean
Block invoice processing if RFC doesn’t match
boolean
Block invoice processing if tax regime doesn’t match
Response
string
required
Success message confirming profile update
Profile
required
The updated profile object
string
required
Unique identifier for the profile
string
required
ID of the user who owns this profile
string
required
Name of the profile or business entity
string
required
RFC (Registro Federal de Contribuyentes)
enum
required
Type of taxpayer entity (
FISICA or MORAL)string[]
required
Array of tax regime codes
object
required
Configuration object for validation rules
string
required
ISO 8601 timestamp of when the profile was created
string
required
ISO 8601 timestamp of when the profile was last updated
boolean
Whether the profile is frozen
enum
Reason why the profile is frozen
string | null
ISO 8601 timestamp of when the profile was frozen
Example Request
curl -X PUT https://api.contafy.com/api/profiles/prof_1234567890 \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"nombre": "Mi Empresa Actualizada SA de CV",
"regimenes_fiscales": ["601", "603", "612"],
"validaciones_habilitadas": {
"validarRFCIngresos": true,
"validarRFCGastos": true,
"validarRegimenFiscal": true,
"validarUUIDDuplicado": true,
"bloquearSiRFCNoCoincide": true,
"bloquearSiRegimenNoCoincide": false
}
}'
Example Response
{
"message": "Profile updated successfully",
"data": {
"id": "prof_1234567890",
"user_id": "user_0987654321",
"nombre": "Mi Empresa Actualizada SA de CV",
"rfc": "XAXX010101000",
"tipo_persona": "MORAL",
"regimenes_fiscales": ["601", "603", "612"],
"validaciones_habilitadas": {
"validarRFCIngresos": true,
"validarRFCGastos": true,
"validarRegimenFiscal": true,
"validarUUIDDuplicado": true,
"bloquearSiRFCNoCoincide": true,
"bloquearSiRegimenNoCoincide": false
},
"created_at": "2024-01-15T10:30:00.000Z",
"updated_at": "2024-03-04T16:45:00.000Z",
"frozen": false
}
}
Error Responses
400 Bad Request
{
"error": "Bad Request",
"message": "Invalid RFC format"
}
401 Unauthorized
{
"error": "Unauthorized",
"message": "Invalid or missing authentication token"
}
403 Forbidden
{
"error": "Forbidden",
"message": "You do not have permission to update this profile"
}
404 Not Found
{
"error": "Not Found",
"message": "Profile not found"
}
422 Unprocessable Entity
{
"error": "Validation Error",
"message": "Invalid tipo_persona value"
}
500 Internal Server Error
{
"error": "Internal Server Error",
"message": "An error occurred while updating the profile"
}