curl --request PATCH \
--url https://api.tupana.ai/v2/honorary/authorized-users/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"master_entity_id": 1,
"rut": "12.345.678-9",
"action": "enroll"
}
'import requests
url = "https://api.tupana.ai/v2/honorary/authorized-users/"
payload = {
"master_entity_id": 1,
"rut": "12.345.678-9",
"action": "enroll"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({master_entity_id: 1, rut: '12.345.678-9', action: 'enroll'})
};
fetch('https://api.tupana.ai/v2/honorary/authorized-users/', 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.tupana.ai/v2/honorary/authorized-users/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'master_entity_id' => 1,
'rut' => '12.345.678-9',
'action' => 'enroll'
]),
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://api.tupana.ai/v2/honorary/authorized-users/"
payload := strings.NewReader("{\n \"master_entity_id\": 1,\n \"rut\": \"12.345.678-9\",\n \"action\": \"enroll\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.tupana.ai/v2/honorary/authorized-users/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"master_entity_id\": 1,\n \"rut\": \"12.345.678-9\",\n \"action\": \"enroll\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tupana.ai/v2/honorary/authorized-users/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"master_entity_id\": 1,\n \"rut\": \"12.345.678-9\",\n \"action\": \"enroll\"\n}"
response = http.request(request)
puts response.read_body{
"status": "enrolled",
"message": "<string>",
"rut": "<string>",
"master_entity": {
"id": 123,
"name": "<string>",
"tax_id": "<string>"
}
}{
"error": "Se requiere el parámetro master_entity_id"
}{
"error": "Usuario sin permisos para acceder a la entidad"
}{
"error": "No se encontró una credencial válida para la entidad"
}{
"error": "Error al gestionar usuario autorizador"
}Enrolar usuario autorizado
Enrola un usuario autorizado del SII para emitir boletas de honorarios. El RUT se valida contra el caché local (poblado por POST …/authorized-users/sync/), no contra el SII en vivo — sincroniza primero si la entidad nunca fue sincronizada. El master_entity_id y rut se proporcionan en el body o query parameters. Para desenrolar, usa el endpoint de desenrolar.
curl --request PATCH \
--url https://api.tupana.ai/v2/honorary/authorized-users/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"master_entity_id": 1,
"rut": "12.345.678-9",
"action": "enroll"
}
'import requests
url = "https://api.tupana.ai/v2/honorary/authorized-users/"
payload = {
"master_entity_id": 1,
"rut": "12.345.678-9",
"action": "enroll"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({master_entity_id: 1, rut: '12.345.678-9', action: 'enroll'})
};
fetch('https://api.tupana.ai/v2/honorary/authorized-users/', 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.tupana.ai/v2/honorary/authorized-users/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'master_entity_id' => 1,
'rut' => '12.345.678-9',
'action' => 'enroll'
]),
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://api.tupana.ai/v2/honorary/authorized-users/"
payload := strings.NewReader("{\n \"master_entity_id\": 1,\n \"rut\": \"12.345.678-9\",\n \"action\": \"enroll\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.tupana.ai/v2/honorary/authorized-users/")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"master_entity_id\": 1,\n \"rut\": \"12.345.678-9\",\n \"action\": \"enroll\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tupana.ai/v2/honorary/authorized-users/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"master_entity_id\": 1,\n \"rut\": \"12.345.678-9\",\n \"action\": \"enroll\"\n}"
response = http.request(request)
puts response.read_body{
"status": "enrolled",
"message": "<string>",
"rut": "<string>",
"master_entity": {
"id": 123,
"name": "<string>",
"tax_id": "<string>"
}
}{
"error": "Se requiere el parámetro master_entity_id"
}{
"error": "Usuario sin permisos para acceder a la entidad"
}{
"error": "No se encontró una credencial válida para la entidad"
}{
"error": "Error al gestionar usuario autorizador"
}Authorizations
API Key para autenticación. Debe proporcionarse en el header Authorization con el formato: 'Api-Key YOUR-API-KEY' (incluye el prefijo 'Api-Key ' seguido de tu API key)
Query Parameters
ID de la entidad emisora
RUT del usuario a gestionar. Puede proporcionarse en query parameter o en el body. RUT del usuario autorizado
Body
ID de la entidad emisora (requerido si no se proporciona en query parameter)
1
RUT del usuario autorizado (requerido si no se proporciona en query parameter)
"12.345.678-9"
Acción a realizar. Por defecto 'enroll'
enroll, unenroll "enroll"
Response
Operación exitosa (enrolar o desenrolar)
- Option 1
- Option 2
Respuesta al enrolar
