Registros
Actualizar registro
Modifica uno o más valores de un registro.
PATCH
/
databases
/
{databaseId}
/
records
/
{recordId}
Actualizar registro
curl --request PATCH \
--url https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId} \
--header 'Content-Type: application/json' \
--header 'x-ib-api-key: <api-key>' \
--data '
{
"values": {
"prima": 1625,
"estado": "cancelada"
}
}
'import requests
url = "https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}"
payload = { "values": {
"prima": 1625,
"estado": "cancelada"
} }
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({values: {prima: 1625, estado: 'cancelada'}})
};
fetch('https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}', 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({values: {prima: 1625, estado: 'cancelada'}})
};
fetch('https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}', 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}';
const options = {
method: 'PATCH',
headers: {'x-ib-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({values: {prima: 1625, estado: 'cancelada'}})
};
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}")
.header("x-ib-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"values\": {\n \"prima\": 1625,\n \"estado\": \"cancelada\"\n }\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-ib-api-key", "<api-key>");
request.AddJsonBody("{\n \"values\": {\n \"prima\": 1625,\n \"estado\": \"cancelada\"\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}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-ib-api-key", "<api-key>");
request.AddJsonBody("{\n \"values\": {\n \"prima\": 1625,\n \"estado\": \"cancelada\"\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}"
payload := strings.NewReader("{\n \"values\": {\n \"prima\": 1625,\n \"estado\": \"cancelada\"\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}")
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 \"values\": {\n \"prima\": 1625,\n \"estado\": \"cancelada\"\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}",
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([
'values' => [
'prima' => 1625,
'estado' => 'cancelada'
]
]),
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 \"values\": {\n \"prima\": 1625,\n \"estado\": \"cancelada\"\n }\n}")
val request = Request.Builder()
.url("https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}")
.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 = ["values": [
"prima": 1625,
"estado": "cancelada"
]] 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}")!
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}' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"values": {
"prima": 1625,
"estado": "cancelada"
}
}'{
"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>"
}Actualiza los valores indicados sin reemplazar los demás campos del registro.
No envíes propiedades diferentes de
Respuesta exitosa (
Devuelve el registro completo con los valores actualizados.
Endpoint
PATCH /databases/{databaseId}/records/{recordId}
Body
| Campo | Tipo | Requerido | Descripción |
|---|---|---|---|
values | object | Sí | Valores que quieres modificar, indexados por fieldKey. |
upsertEnumOptions | boolean | No | Permite crear opciones enum desconocidas. |
values y upsertEnumOptions.
Consulta Valores por tipo de campo para construir values.
Ejemplo de solicitud
curl -X PATCH "https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}" \
-H "Content-Type: application/json" \
-H "x-ib-api-key: TU_API_KEY" \
-d '{
"values": {
"estado": "cancelada",
"prima": 0
}
}'
Respuesta exitosa (200)
Devuelve el registro completo con los valores actualizados.
{
"id": "<record-id>",
"databaseId": "<database-id>",
"values": {
"numeroPoliza": "POL-1001",
"estado": "cancelada",
"prima": 0
},
"updatedAt": 1720000100000
}
Errores frecuentes
| HTTP | Qué significa | Qué hacer |
|---|---|---|
400 | values no es un objeto, hay propiedades no soportadas o un valor no cumple el esquema. | Corrige el body. |
404 | El tablero o el registro no existe. | Confirma ambos IDs. |
500 | No fue posible actualizar el registro. | Reintenta; si continúa, contacta soporte. |
Authorizations
API key de Insurance Boosters.
Body
application/json
Was this page helpful?
Actualizar registro
curl --request PATCH \
--url https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId} \
--header 'Content-Type: application/json' \
--header 'x-ib-api-key: <api-key>' \
--data '
{
"values": {
"prima": 1625,
"estado": "cancelada"
}
}
'import requests
url = "https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}"
payload = { "values": {
"prima": 1625,
"estado": "cancelada"
} }
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({values: {prima: 1625, estado: 'cancelada'}})
};
fetch('https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}', 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({values: {prima: 1625, estado: 'cancelada'}})
};
fetch('https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}', 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}';
const options = {
method: 'PATCH',
headers: {'x-ib-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({values: {prima: 1625, estado: 'cancelada'}})
};
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}")
.header("x-ib-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"values\": {\n \"prima\": 1625,\n \"estado\": \"cancelada\"\n }\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-ib-api-key", "<api-key>");
request.AddJsonBody("{\n \"values\": {\n \"prima\": 1625,\n \"estado\": \"cancelada\"\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}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-ib-api-key", "<api-key>");
request.AddJsonBody("{\n \"values\": {\n \"prima\": 1625,\n \"estado\": \"cancelada\"\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}"
payload := strings.NewReader("{\n \"values\": {\n \"prima\": 1625,\n \"estado\": \"cancelada\"\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}")
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 \"values\": {\n \"prima\": 1625,\n \"estado\": \"cancelada\"\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}",
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([
'values' => [
'prima' => 1625,
'estado' => 'cancelada'
]
]),
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 \"values\": {\n \"prima\": 1625,\n \"estado\": \"cancelada\"\n }\n}")
val request = Request.Builder()
.url("https://api.insuranceboosters.com/api/v1/databases/{databaseId}/records/{recordId}")
.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 = ["values": [
"prima": 1625,
"estado": "cancelada"
]] 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}")!
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}' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"values": {
"prima": 1625,
"estado": "cancelada"
}
}'{
"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>"
}
