Crear campo
Agrega una columna al esquema de un tablero.
curl --request POST \
--url https://api.insuranceboosters.com/api/v1/databases/{databaseId}/fields \
--header 'Content-Type: application/json' \
--header 'x-ib-api-key: <api-key>' \
--data '
{
"name": "Estado",
"type": "enum"
}
'import requests
url = "https://api.insuranceboosters.com/api/v1/databases/{databaseId}/fields"
payload = {
"name": "Estado",
"type": "enum"
}
headers = {
"x-ib-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-ib-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Estado', type: 'enum'})
};
fetch('https://api.insuranceboosters.com/api/v1/databases/{databaseId}/fields', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {'x-ib-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Estado', type: 'enum'})
};
fetch('https://api.insuranceboosters.com/api/v1/databases/{databaseId}/fields', 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}/fields';
const options = {
method: 'POST',
headers: {'x-ib-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Estado', type: 'enum'})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.insuranceboosters.com/api/v1/databases/{databaseId}/fields")
.header("x-ib-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Estado\",\n \"type\": \"enum\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.insuranceboosters.com/api/v1/databases/{databaseId}/fields");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-ib-api-key", "<api-key>");
request.AddJsonBody("{\n \"name\": \"Estado\",\n \"type\": \"enum\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
using RestSharp;
var options = new RestClientOptions("https://api.insuranceboosters.com/api/v1/databases/{databaseId}/fields");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-ib-api-key", "<api-key>");
request.AddJsonBody("{\n \"name\": \"Estado\",\n \"type\": \"enum\"\n}", false);
var response = await client.PostAsync(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}/fields"
payload := strings.NewReader("{\n \"name\": \"Estado\",\n \"type\": \"enum\"\n}")
req, _ := http.NewRequest("POST", 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}/fields")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-ib-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Estado\",\n \"type\": \"enum\"\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}/fields",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Estado',
'type' => 'enum'
]),
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 \"name\": \"Estado\",\n \"type\": \"enum\"\n}")
val request = Request.Builder()
.url("https://api.insuranceboosters.com/api/v1/databases/{databaseId}/fields")
.post(body)
.addHeader("x-ib-api-key", "<api-key>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute()falseimport Foundation
let parameters = [
"name": "Estado",
"type": "enum"
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://api.insuranceboosters.com/api/v1/databases/{databaseId}/fields")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
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}/fields' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": "Estado",
"type": "enum"
}'{
"name": "<string>",
"key": "<string>",
"type": "string",
"id": "<string>",
"required": false,
"description": "<string>",
"defaultValue": "<unknown>",
"dateConfig": {
"includeTime": false
},
"options": [
{
"label": "<string>",
"id": "<string>",
"color": "<string>",
"order": 1
}
],
"toDatabaseId": "<string>",
"displayFieldId": "<string>",
"bidirectional": false,
"inverseField": {
"id": "<string>",
"name": "<string>",
"key": "<string>",
"type": "relation_single",
"displayFieldId": "<string>"
},
"relationFieldId": "<string>",
"targetFieldId": "<string>",
"multipleValuesBehavior": "allValues",
"maxFiles": 2,
"accept": [
"<string>"
],
"numberFormat": {
"type": "none",
"currencyCode": "USD",
"decimalPlaces": 2,
"thousandsSeparator": true
},
"pdfTemplateConfig": {
"buttonLabel": "<string>",
"templates": [
{
"id": "<string>",
"name": "<string>",
"orientation": "portrait",
"fileNameTemplate": "<string>"
}
]
},
"inverseFieldId": "<string>",
"relationPairId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"error": "<string>"
}{
"code": "<string>",
"message": "<string>",
"error": "<string>"
}{
"code": "<string>",
"message": "<string>",
"error": "<string>"
}{
"code": "<string>",
"message": "<string>",
"error": "<string>"
}{
"code": "<string>",
"message": "<string>",
"error": "<string>"
}Endpoint
POST /databases/{databaseId}/fields
Body común
| Campo | Tipo | Requerido | Descripción |
|---|---|---|---|
name | string | Sí | Nombre visible del campo. |
type | string | Sí | Tipo de dato. |
key | string | No | Clave estable para values; si la omites, se genera desde name. |
required | boolean | No | Marca el campo como obligatorio en el esquema y en la captura del tablero. |
description | string | No | Ayuda para quien captura datos. |
defaultValue | Cualquiera | No | Valor predeterminado para tipos compatibles. |
key debe iniciar con una letra minúscula y usar camelCase o snake_case. Después de crear el campo, key y type son inmutables.
Cada type admite propiedades diferentes. Consulta Tipos y configuración de campos antes de construir el body.
Ejemplo: campo de selección
curl -X POST "https://api.insuranceboosters.com/api/v1/databases/{databaseId}/fields" \
-H "Content-Type: application/json" \
-H "x-ib-api-key: TU_API_KEY" \
-d '{
"name": "Estado",
"key": "estado",
"type": "enum",
"required": true,
"options": [
{ "label": "Vigente", "color": "green" },
{ "label": "Cancelada", "color": "red" }
]
}'
Respuesta exitosa (201)
Devuelve el campo creado con id, key y la configuración normalizada.
{
"id": "<field-id>",
"key": "estado",
"name": "Estado",
"type": "enum",
"required": true,
"options": [
{ "id": "vigente", "label": "Vigente", "color": "green", "order": 0 },
{ "id": "cancelada", "label": "Cancelada", "color": "red", "order": 1 }
]
}
Errores frecuentes
| HTTP | Qué significa | Qué hacer |
|---|---|---|
400 | Configuración inválida o incompleta. | Revisa los campos requeridos para el type. |
403 | Tu integración no puede modificar el tablero. | Confirma el acceso al tablero. |
404 | El tablero no existe. | Confirma databaseId. |
Authorizations
API key de Insurance Boosters.
Path Parameters
ID del tablero.
Body
Nombre visible del campo.
1Tipo inmutable después de crear el campo.
string, number, boolean, date, enum, enum_multi, relation_single, relation_multi, contact_single, contact_multi, lookup, files, pdf_template Clave estable; se genera desde name si la omites.
^[a-z][a-zA-Z0-9]*(?:_[a-z0-9]+)*$Marca el campo como obligatorio en el esquema y en la captura del tablero.
Valor predeterminado para tipos compatibles.
Configuración de presentación cuando type es date.
Show child attributes
Show child attributes
Requerido para enum y enum_multi.
1Show child attributes
Show child attributes
Requerido para campos de relación.
Campo mostrado en relaciones o contactos.
Vincula un campo existente con id o crea uno nuevo con name y type.
Show child attributes
Show child attributes
Requerido para lookup.
Requerido para lookup.
Requerido para lookup.
allValues, uniqueValues, firstValue, lastValue Máximo de archivos cuando type es files.
x >= 1Tipos MIME aceptados cuando type es files.
Show child attributes
Show child attributes
Requerido cuando type es pdf_template.
Show child attributes
Show child attributes
Response
Campo creado.
Nombre visible del campo.
1Clave estable; se genera desde name si la omites.
^[a-z][a-zA-Z0-9]*(?:_[a-z0-9]+)*$Tipo inmutable después de crear el campo.
string, number, boolean, date, enum, enum_multi, relation_single, relation_multi, contact_single, contact_multi, lookup, files, pdf_template Marca el campo como obligatorio en el esquema y en la captura del tablero.
Valor predeterminado para tipos compatibles.
Configuración de presentación cuando type es date.
Show child attributes
Show child attributes
Requerido para enum y enum_multi.
1Show child attributes
Show child attributes
Requerido para campos de relación.
Campo mostrado en relaciones o contactos.
Vincula un campo existente con id o crea uno nuevo con name y type.
Show child attributes
Show child attributes
Requerido para lookup.
Requerido para lookup.
Requerido para lookup.
allValues, uniqueValues, firstValue, lastValue Máximo de archivos cuando type es files.
x >= 1Tipos MIME aceptados cuando type es files.
Show child attributes
Show child attributes
Requerido cuando type es pdf_template.
Show child attributes
Show child attributes
Was this page helpful?
curl --request POST \
--url https://api.insuranceboosters.com/api/v1/databases/{databaseId}/fields \
--header 'Content-Type: application/json' \
--header 'x-ib-api-key: <api-key>' \
--data '
{
"name": "Estado",
"type": "enum"
}
'import requests
url = "https://api.insuranceboosters.com/api/v1/databases/{databaseId}/fields"
payload = {
"name": "Estado",
"type": "enum"
}
headers = {
"x-ib-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-ib-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Estado', type: 'enum'})
};
fetch('https://api.insuranceboosters.com/api/v1/databases/{databaseId}/fields', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {'x-ib-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Estado', type: 'enum'})
};
fetch('https://api.insuranceboosters.com/api/v1/databases/{databaseId}/fields', 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}/fields';
const options = {
method: 'POST',
headers: {'x-ib-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Estado', type: 'enum'})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.insuranceboosters.com/api/v1/databases/{databaseId}/fields")
.header("x-ib-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Estado\",\n \"type\": \"enum\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.insuranceboosters.com/api/v1/databases/{databaseId}/fields");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-ib-api-key", "<api-key>");
request.AddJsonBody("{\n \"name\": \"Estado\",\n \"type\": \"enum\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
using RestSharp;
var options = new RestClientOptions("https://api.insuranceboosters.com/api/v1/databases/{databaseId}/fields");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("x-ib-api-key", "<api-key>");
request.AddJsonBody("{\n \"name\": \"Estado\",\n \"type\": \"enum\"\n}", false);
var response = await client.PostAsync(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}/fields"
payload := strings.NewReader("{\n \"name\": \"Estado\",\n \"type\": \"enum\"\n}")
req, _ := http.NewRequest("POST", 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}/fields")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-ib-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Estado\",\n \"type\": \"enum\"\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}/fields",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Estado',
'type' => 'enum'
]),
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 \"name\": \"Estado\",\n \"type\": \"enum\"\n}")
val request = Request.Builder()
.url("https://api.insuranceboosters.com/api/v1/databases/{databaseId}/fields")
.post(body)
.addHeader("x-ib-api-key", "<api-key>")
.addHeader("Content-Type", "application/json")
.build()
val response = client.newCall(request).execute()falseimport Foundation
let parameters = [
"name": "Estado",
"type": "enum"
] as [String : Any?]
let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])
let url = URL(string: "https://api.insuranceboosters.com/api/v1/databases/{databaseId}/fields")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
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}/fields' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": "Estado",
"type": "enum"
}'{
"name": "<string>",
"key": "<string>",
"type": "string",
"id": "<string>",
"required": false,
"description": "<string>",
"defaultValue": "<unknown>",
"dateConfig": {
"includeTime": false
},
"options": [
{
"label": "<string>",
"id": "<string>",
"color": "<string>",
"order": 1
}
],
"toDatabaseId": "<string>",
"displayFieldId": "<string>",
"bidirectional": false,
"inverseField": {
"id": "<string>",
"name": "<string>",
"key": "<string>",
"type": "relation_single",
"displayFieldId": "<string>"
},
"relationFieldId": "<string>",
"targetFieldId": "<string>",
"multipleValuesBehavior": "allValues",
"maxFiles": 2,
"accept": [
"<string>"
],
"numberFormat": {
"type": "none",
"currencyCode": "USD",
"decimalPlaces": 2,
"thousandsSeparator": true
},
"pdfTemplateConfig": {
"buttonLabel": "<string>",
"templates": [
{
"id": "<string>",
"name": "<string>",
"orientation": "portrait",
"fileNameTemplate": "<string>"
}
]
},
"inverseFieldId": "<string>",
"relationPairId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"error": "<string>"
}{
"code": "<string>",
"message": "<string>",
"error": "<string>"
}{
"code": "<string>",
"message": "<string>",
"error": "<string>"
}{
"code": "<string>",
"message": "<string>",
"error": "<string>"
}{
"code": "<string>",
"message": "<string>",
"error": "<string>"
}
