> ## Documentation Index
> Fetch the complete documentation index at: https://developers.insuranceboosters.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Consultar tablero

> Obtén la definición y los campos de un tablero por ID.

Obtén la definición completa de un tablero. Usa esta operación antes de enviar registros para conocer las `key` y los tipos de sus campos.

## Endpoint

```text theme={null}
GET /databases/{databaseId}
```

## Parámetros de ruta

| Parámetro    | Descripción                             |
| ------------ | --------------------------------------- |
| `databaseId` | ID devuelto al crear o listar tableros. |

## Ejemplo de solicitud

```bash theme={null}
curl "https://api.insuranceboosters.com/api/v1/databases/{databaseId}" \
  -H "x-ib-api-key: TU_API_KEY"
```

## Respuesta exitosa (`200`)

```json theme={null}
{
  "id": "<database-id>",
  "name": "Pólizas",
  "description": "Control de pólizas vigentes",
  "fields": [
    {
      "id": "<field-id>",
      "key": "numeroPoliza",
      "name": "Número de póliza",
      "type": "string",
      "required": true
    },
    {
      "id": "<field-id>",
      "key": "prima",
      "name": "Prima",
      "type": "number"
    }
  ],
  "createdAt": 1720000000000,
  "updatedAt": 1720000000000
}
```

## Errores frecuentes

| HTTP  | Qué significa                              | Qué hacer                                 |
| ----- | ------------------------------------------ | ----------------------------------------- |
| `401` | API key inválida o faltante.               | Verifica `x-ib-api-key`.                  |
| `404` | El tablero no existe o no está disponible. | Confirma `databaseId`.                    |
| `500` | No fue posible consultar el tablero.       | Reintenta; si continúa, contacta soporte. |


## OpenAPI

````yaml openapi/tableros-v1.yaml GET /databases/{databaseId}
openapi: 3.1.0
info:
  title: Insurance Boosters API — Tableros
  version: 1.0.0
  description: API pública para administrar tableros, campos, registros y archivos.
  license:
    name: Propietaria
    url: https://insuranceboosters.com
servers:
  - url: https://api.insuranceboosters.com/api/v1
    description: Producción
security:
  - IbApiKey: []
tags:
  - name: Tableros
    description: Administración de tableros.
  - name: Campos
    description: Configuración del esquema de un tablero.
  - name: Registros
    description: Lectura y escritura de registros.
  - name: Archivos
    description: Archivos adjuntos a registros.
paths:
  /databases/{databaseId}:
    parameters:
      - $ref: '#/components/parameters/DatabaseId'
    get:
      tags:
        - Tableros
      summary: Consultar tablero
      operationId: getDatabase
      responses:
        '200':
          description: Tablero solicitado.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Database'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    DatabaseId:
      name: databaseId
      in: path
      required: true
      description: ID del tablero.
      schema:
        type: string
  schemas:
    Database:
      type: object
      required:
        - id
        - name
        - fields
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
        fields:
          type: array
          items:
            $ref: '#/components/schemas/Field'
        defaultSort:
          $ref: '#/components/schemas/DatabaseSort'
        createdAt:
          type: integer
        updatedAt:
          type: integer
    Field:
      allOf:
        - $ref: '#/components/schemas/FieldInputProperties'
        - type: object
          required:
            - id
            - key
            - name
            - type
          properties:
            id:
              type: string
            inverseFieldId:
              type: string
            relationPairId:
              type: string
    DatabaseSort:
      type: object
      additionalProperties: false
      required:
        - fieldKey
        - direction
      properties:
        fieldKey:
          type: string
          minLength: 1
          description: '`key` de un campo existente.'
        direction:
          type: string
          enum:
            - asc
            - desc
    Error:
      type: object
      properties:
        message:
          type: string
        error:
          type: string
      additionalProperties: false
    FieldInputProperties:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          description: Nombre visible del campo.
        key:
          type: string
          pattern: ^[a-z][a-zA-Z0-9]*(?:_[a-z0-9]+)*$
          description: Clave estable; se genera desde `name` si la omites.
        type:
          type: string
          enum:
            - string
            - number
            - boolean
            - date
            - enum
            - enum_multi
            - relation_single
            - relation_multi
            - contact_single
            - contact_multi
            - lookup
            - files
          description: Tipo inmutable después de crear el campo.
        required:
          type: boolean
          default: false
          description: >-
            Marca el campo como obligatorio en el esquema y en la captura del
            tablero.
        description:
          type: string
        defaultValue:
          description: Valor predeterminado para tipos compatibles.
        dateConfig:
          allOf:
            - $ref: '#/components/schemas/DateConfig'
          description: Configuración de presentación cuando `type` es `date`.
        options:
          type: array
          minItems: 1
          description: Requerido para `enum` y `enum_multi`.
          items:
            $ref: '#/components/schemas/EnumOptionInput'
        toDatabaseId:
          type: string
          description: Requerido para campos de relación.
        displayFieldId:
          type: string
          description: Campo mostrado en relaciones o contactos.
        bidirectional:
          type: boolean
          default: false
        inverseField:
          $ref: '#/components/schemas/InverseFieldInput'
        relationFieldId:
          type: string
          description: Requerido para `lookup`.
        targetFieldId:
          type: string
          description: Requerido para `lookup`.
        multipleValuesBehavior:
          type: string
          enum:
            - allValues
            - uniqueValues
            - firstValue
            - lastValue
          description: Requerido para `lookup`.
        maxFiles:
          type: integer
          minimum: 1
          description: Máximo de archivos cuando `type` es `files`.
        accept:
          type: array
          description: Tipos MIME aceptados cuando `type` es `files`.
          items:
            type: string
        numberFormat:
          $ref: '#/components/schemas/NumberFormat'
    DateConfig:
      type: object
      additionalProperties: false
      required:
        - includeTime
      properties:
        includeTime:
          type: boolean
          default: false
          description: >-
            Controla si el tablero captura y muestra hora. No cambia la
            validación del valor.
    EnumOptionInput:
      type: object
      additionalProperties: false
      required:
        - label
      properties:
        id:
          type: string
          description: ID estable; se genera automáticamente si lo omites.
        label:
          type: string
          minLength: 1
        color:
          type: string
        order:
          type: integer
          minimum: 0
    InverseFieldInput:
      type: object
      additionalProperties: false
      description: >-
        Vincula un campo existente con `id` o crea uno nuevo con `name` y
        `type`.
      properties:
        id:
          type: string
          description: ID de un campo de relación existente en el tablero destino.
        name:
          type: string
          minLength: 1
          description: Nombre de un campo inverso nuevo.
        key:
          type: string
          pattern: ^[a-z][a-zA-Z0-9]*(?:_[a-z0-9]+)*$
        type:
          type: string
          enum:
            - relation_single
            - relation_multi
        displayFieldId:
          type: string
    NumberFormat:
      type: object
      additionalProperties: false
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - none
            - currency
            - percent
          description: Formato visual del número.
        currencyCode:
          type: string
          enum:
            - USD
            - EUR
            - MXN
            - BRL
            - ARS
            - COP
            - CLP
            - PEN
            - UYU
            - GTQ
          description: Requerido cuando `type` es `currency`.
        decimalPlaces:
          type: integer
          minimum: 0
          maximum: 6
          default: 2
        thousandsSeparator:
          type: boolean
          default: true
  responses:
    Unauthorized:
      description: API key inválida o faltante.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Recurso no encontrado.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalError:
      description: Error del servicio.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    IbApiKey:
      type: apiKey
      in: header
      name: x-ib-api-key
      description: API key de Insurance Boosters.

````