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

# Obtener registros de una base de datos

> Consulta todos los registros de una base de datos de Datum con paginación.

<Note>
  Este endpoint devuelve resultados paginados. Usa los parámetros `limit` y `page` para controlar la cantidad de registros por página.
</Note>

## Descripción

Este endpoint te permite **obtener todos los registros (filas)** almacenados en una base de datos de Datum.\
Es útil para listar datos, construir reportes o sincronizar información con sistemas externos.

## Obtener registros

### Endpoint

```
GET https://api.jelou.ai/v2/databases/DATABASE_ID/rows
```

## Parámetros de ruta

<ParamField path="DATABASE_ID" type="string" required>
  Identificador único de la base de datos de la cual se desean obtener los registros.
</ParamField>

## Parámetros de consulta

<ParamField query="limit" type="number" default="10">
  Número máximo de registros a devolver por página.
</ParamField>

<ParamField query="page" type="number" default="1">
  Número de página a consultar.
</ParamField>

## Respuestas

* **200 – OK**: Registros obtenidos exitosamente.
* **404 – Not Found**: Base de datos no encontrada.
* **500 – Internal Server Error**: Error interno del servidor.

## Ejemplo de solicitud

```bash cURL theme={null}
curl --request GET \
  --url 'https://api.jelou.ai/v2/databases/DATABASE_ID/rows?limit=10&page=1' \
  --header 'Authorization: Basic <Base64Encoded clientId:clientSecret>' \
  --header 'Accept: application/json'
```

## Ejemplo de respuesta

```json theme={null}
{
  "pagination": {
    "limit": 10,
    "page": 1,
    "total": 3,
    "offset": 0,
    "totalPages": 1
  },
  "_metadata": {},
  "results": [
    {
      "Plan": "Básico",
      "Precio": "$29",
      "createdAt": "2026-03-18T13:57:31.067Z",
      "updatedAt": "2026-03-18T13:57:31.067Z",
      "_id": "b358a9b2-be44-47bc-aa40-00e59aa3d6c8"
    },
    {
      "Plan": "Profesional",
      "Precio": "$59",
      "createdAt": "2026-03-18T13:57:31.016Z",
      "updatedAt": "2026-03-18T13:57:31.016Z",
      "_id": "33b9d984-80c3-4b55-b982-2970bed8cc59"
    },
    {
      "Plan": "Empresarial",
      "Precio": "$99",
      "createdAt": "2026-03-18T13:57:29.204Z",
      "updatedAt": "2026-03-18T13:57:29.204Z",
      "_id": "070612cc-d9bf-44b8-a419-55f71b03d09e"
    }
  ],
  "links": [
    {
      "number": 1,
      "url": "/v2/databases/DATABASE_ID/rows?limit=10&page=1"
    }
  ]
}
```

## Estructura de la respuesta

| Propiedad  | Tipo   | Descripción                                                          |
| ---------- | ------ | -------------------------------------------------------------------- |
| pagination | object | Información de paginación (limit, page, total, totalPages).          |
| \_metadata | object | Metadatos adicionales de la consulta.                                |
| results    | array  | Lista de registros con sus campos, `_id`, `createdAt` y `updatedAt`. |
| links      | array  | Links de navegación para paginación.                                 |


## OpenAPI

````yaml GET /v2/databases/{databaseId}/rows
openapi: 3.1.0
info:
  title: Jelou API
  description: >-
    API for the Jelou platform. Send messages, manage campaigns, handle
    conversations, users, databases, and widgets.
  version: 1.0.0
servers:
  - url: https://api.jelou.ai
    description: Production server
security:
  - basicAuth: []
tags:
  - name: Messages
    description: Send messages to users
  - name: Campaigns
    description: HSM campaigns and templates
  - name: Conversations
    description: Chat history and metrics
  - name: Users
    description: User state and cache management
  - name: Resources
    description: Media resource management
  - name: Datum
    description: Database CRUD operations
  - name: Widget
    description: Widget and room management
  - name: PMA Custom
    description: External support panel integration
paths:
  /v2/databases/{databaseId}/rows:
    get:
      tags:
        - Datum
      summary: Obtener registros
      description: >-
        Obtiene todos los registros (filas) de una base de datos de Datum con
        paginación.
      operationId: listRows
      parameters:
        - name: databaseId
          in: path
          required: true
          schema:
            type: string
        - name: limit
          in: query
          description: Número de registros por página.
          schema:
            type: integer
            default: 10
        - name: page
          in: query
          description: Número de página.
          schema:
            type: integer
            default: 1
      responses:
        '200':
          description: Rows retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RowsListResponse'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    RowsListResponse:
      type: object
      properties:
        pagination:
          type: object
          properties:
            limit:
              type: integer
            page:
              type: integer
            total:
              type: integer
            offset:
              type: integer
            totalPages:
              type: integer
        _metadata:
          type: object
        results:
          type: array
          items:
            $ref: '#/components/schemas/Row'
        links:
          type: array
          items:
            type: object
            properties:
              number:
                type: integer
              url:
                type: string
    Row:
      type: object
      additionalProperties: true
      properties:
        _id:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        message:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        statusMessage:
          type: string
        status:
          type: integer
        error:
          type: object
          properties:
            code:
              type: string
            key:
              type: string
            description:
              type: string
            developerMessages:
              type: object
            clientMessages:
              type: object
        validationError:
          type: object
  responses:
    NotFound:
      description: Not found - Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: Basic authentication using Base64 encoded clientId:clientSecret

````