Registros
Actualizar relaciones de un registro
Agrega o quita vínculos de relación de forma segura.
PATCH
/
databases
/
{databaseId}
/
records
/
{recordId}
/
relation-links
Actualizar relaciones de un registro
curl --request PATCH \
--url https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links \
--header 'Content-Type: application/json' \
--header 'x-ib-api-key: <api-key>' \
--data '
{
"fieldKey": "cliente",
"add": [
"<record-id-por-vincular>"
],
"remove": [
"<record-id-por-desvincular>"
]
}
'import requests
url = "https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links"
payload = {
"fieldKey": "cliente",
"add": ["<record-id-por-vincular>"],
"remove": ["<record-id-por-desvincular>"]
}
headers = {
"x-ib-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-ib-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fieldKey: 'cliente',
add: ['<record-id-por-vincular>'],
remove: ['<record-id-por-desvincular>']
})
};
fetch('https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'PATCH',
headers: {'x-ib-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fieldKey: 'cliente',
add: ['<record-id-por-vincular>'],
remove: ['<record-id-por-desvincular>']
})
};
fetch('https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links';
const options = {
method: 'PATCH',
headers: {'x-ib-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fieldKey: 'cliente',
add: ['<record-id-por-vincular>'],
remove: ['<record-id-por-desvincular>']
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.patch("https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links")
.header("x-ib-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"fieldKey\": \"cliente\",\n \"add\": [\n \"<record-id-por-vincular>\"\n ],\n \"remove\": [\n \"<record-id-por-desvincular>\"\n ]\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-ib-api-key", "<api-key>");
request.AddJsonBody("{\n \"fieldKey\": \"cliente\",\n \"add\": [\n \"<record-id-por-vincular>\"\n ],\n \"remove\": [\n \"<record-id-por-desvincular>\"\n ]\n}", false);
var response = await client.PatchAsync(request);
Console.WriteLine("{0}", response.Content);
using RestSharp;
var options = new RestClientOptions("https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-ib-api-key", "<api-key>");
request.AddJsonBody("{\n \"fieldKey\": \"cliente\",\n \"add\": [\n \"<record-id-por-vincular>\"\n ],\n \"remove\": [\n \"<record-id-por-desvincular>\"\n ]\n}", false);
var response = await client.PatchAsync(request);
Console.WriteLine("{0}", response.Content);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links"
payload := strings.NewReader("{\n \"fieldKey\": \"cliente\",\n \"add\": [\n \"<record-id-por-vincular>\"\n ],\n \"remove\": [\n \"<record-id-por-desvincular>\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-ib-api-key", "<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))
}require 'uri'
require 'net/http'
url = URI("https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-ib-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fieldKey\": \"cliente\",\n \"add\": [\n \"<record-id-por-vincular>\"\n ],\n \"remove\": [\n \"<record-id-por-desvincular>\"\n ]\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links",
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([
'fieldKey' => 'cliente',
'add' => [
'<record-id-por-vincular>'
],
'remove' => [
'<record-id-por-desvincular>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-ib-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"fieldKey\": \"cliente\",\n \"add\": [\n \"<record-id-por-vincular>\"\n ],\n \"remove\": [\n \"<record-id-por-desvincular>\"\n ]\n}")
val request = Request.Builder()
.url("https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links")
.patch(body)
.addHeader("x-ib-api-key", "<api-key>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute()falseimport Foundation
let parameters = [
"fieldKey": "cliente",
"add": ["<record-id-por-vincular>"],
"remove": ["<record-id-por-desvincular>"]
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links")!
var request = URLRequest(url: url)
request.httpMethod = "PATCH"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"x-ib-api-key": "<api-key>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))$headers=@{}
$headers.Add("x-ib-api-key", "<api-key>")
$headers.Add("Content-Type", "application/json")
$response = Invoke-WebRequest -Uri 'https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"fieldKey": "cliente",
"add": [
"<record-id-por-vincular>"
],
"remove": [
"<record-id-por-desvincular>"
]
}'{
"id": "<string>",
"databaseId": "<string>",
"values": {},
"createdAt": 123,
"updatedAt": 123,
"createdBy": "<string>",
"updatedBy": "<string>"
}{
"message": "<string>",
"error": "<string>"
}{
"message": "<string>",
"error": "<string>"
}{
"message": "<string>",
"error": "<string>"
}{
"message": "<string>",
"error": "<string>"
}Agrega o elimina IDs en un campo de relación sin reenviar el arreglo completo. Usa esta operación cuando varias integraciones pueden modificar relaciones al mismo tiempo.
Incluye al menos un ID en
Respuesta exitosa (
Devuelve el registro completo con el campo de relación actualizado.
Endpoint
PATCH /databases/{databaseId}/records/{recordId}/relation-links
Body
| Campo | Tipo | Requerido | Descripción |
|---|---|---|---|
fieldKey | string | Sí | key de un campo relation_single o relation_multi. |
add | string[] | Condicional | IDs de registros relacionados que quieres agregar. |
remove | string[] | Condicional | IDs que quieres quitar. |
add o remove. Para relation_single, add acepta un solo ID y reemplaza la relación actual.
Ejemplo de solicitud
curl -X PATCH "https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links" \
-H "Content-Type: application/json" \
-H "x-ib-api-key: TU_API_KEY" \
-d '{
"fieldKey": "documentosRelacionados",
"add": ["<related-record-id>"],
"remove": ["<old-related-record-id>"]
}'
Respuesta exitosa (200)
Devuelve el registro completo con el campo de relación actualizado.
Errores frecuentes
| HTTP | Qué significa | Qué hacer |
|---|---|---|
400 | Falta fieldKey, no hay IDs que cambiar o el campo no es una relación compatible. | Corrige el body. |
404 | El tablero, registro o campo no existe. | Confirma los IDs y la fieldKey. |
500 | No fue posible actualizar la relación. | Reintenta; si continúa, contacta soporte. |
Authorizations
API key de Insurance Boosters.
Body
application/json
Was this page helpful?
Actualizar relaciones de un registro
curl --request PATCH \
--url https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links \
--header 'Content-Type: application/json' \
--header 'x-ib-api-key: <api-key>' \
--data '
{
"fieldKey": "cliente",
"add": [
"<record-id-por-vincular>"
],
"remove": [
"<record-id-por-desvincular>"
]
}
'import requests
url = "https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links"
payload = {
"fieldKey": "cliente",
"add": ["<record-id-por-vincular>"],
"remove": ["<record-id-por-desvincular>"]
}
headers = {
"x-ib-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-ib-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fieldKey: 'cliente',
add: ['<record-id-por-vincular>'],
remove: ['<record-id-por-desvincular>']
})
};
fetch('https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'PATCH',
headers: {'x-ib-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fieldKey: 'cliente',
add: ['<record-id-por-vincular>'],
remove: ['<record-id-por-desvincular>']
})
};
fetch('https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links';
const options = {
method: 'PATCH',
headers: {'x-ib-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fieldKey: 'cliente',
add: ['<record-id-por-vincular>'],
remove: ['<record-id-por-desvincular>']
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.patch("https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links")
.header("x-ib-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"fieldKey\": \"cliente\",\n \"add\": [\n \"<record-id-por-vincular>\"\n ],\n \"remove\": [\n \"<record-id-por-desvincular>\"\n ]\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-ib-api-key", "<api-key>");
request.AddJsonBody("{\n \"fieldKey\": \"cliente\",\n \"add\": [\n \"<record-id-por-vincular>\"\n ],\n \"remove\": [\n \"<record-id-por-desvincular>\"\n ]\n}", false);
var response = await client.PatchAsync(request);
Console.WriteLine("{0}", response.Content);
using RestSharp;
var options = new RestClientOptions("https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-ib-api-key", "<api-key>");
request.AddJsonBody("{\n \"fieldKey\": \"cliente\",\n \"add\": [\n \"<record-id-por-vincular>\"\n ],\n \"remove\": [\n \"<record-id-por-desvincular>\"\n ]\n}", false);
var response = await client.PatchAsync(request);
Console.WriteLine("{0}", response.Content);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links"
payload := strings.NewReader("{\n \"fieldKey\": \"cliente\",\n \"add\": [\n \"<record-id-por-vincular>\"\n ],\n \"remove\": [\n \"<record-id-por-desvincular>\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-ib-api-key", "<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))
}require 'uri'
require 'net/http'
url = URI("https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-ib-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fieldKey\": \"cliente\",\n \"add\": [\n \"<record-id-por-vincular>\"\n ],\n \"remove\": [\n \"<record-id-por-desvincular>\"\n ]\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links",
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([
'fieldKey' => 'cliente',
'add' => [
'<record-id-por-vincular>'
],
'remove' => [
'<record-id-por-desvincular>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-ib-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"fieldKey\": \"cliente\",\n \"add\": [\n \"<record-id-por-vincular>\"\n ],\n \"remove\": [\n \"<record-id-por-desvincular>\"\n ]\n}")
val request = Request.Builder()
.url("https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links")
.patch(body)
.addHeader("x-ib-api-key", "<api-key>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute()falseimport Foundation
let parameters = [
"fieldKey": "cliente",
"add": ["<record-id-por-vincular>"],
"remove": ["<record-id-por-desvincular>"]
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links")!
var request = URLRequest(url: url)
request.httpMethod = "PATCH"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"x-ib-api-key": "<api-key>",
"Content-Type": "application/json"
]
request.httpBody = postData
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))$headers=@{}
$headers.Add("x-ib-api-key", "<api-key>")
$headers.Add("Content-Type", "application/json")
$response = Invoke-WebRequest -Uri 'https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}/relation-links' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"fieldKey": "cliente",
"add": [
"<record-id-por-vincular>"
],
"remove": [
"<record-id-por-desvincular>"
]
}'{
"id": "<string>",
"databaseId": "<string>",
"values": {},
"createdAt": 123,
"updatedAt": 123,
"createdBy": "<string>",
"updatedBy": "<string>"
}{
"message": "<string>",
"error": "<string>"
}{
"message": "<string>",
"error": "<string>"
}{
"message": "<string>",
"error": "<string>"
}{
"message": "<string>",
"error": "<string>"
}
