> ## 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.

# Get database information

> Query and manage Datum databases stored in Jelou.

<Note>
  The schema structure is key to validating data before inserting or querying records from your flows and workflows.
</Note>

## Description

The Datum API allows you to query the databases available in Jelou and access their structure and metadata.\
It is useful for listing schemas, validating fields, and preparing read or write operations from your flows.

## Get databases

### Endpoint

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

### Query parameters

<ParamField query="shouldPaginate" type="string">
  Defines whether the results should be returned in paginated form.

  ### Responses

  * **200 – OK** Successful request.
  * **401 – Unauthorized** Invalid or missing credentials.
  * **500 – Internal Server Error** Internal server error.

  ### \\

  Response example

  ```json theme={null}
  {
    "message": ["Databases retrieved successfully!"],
    "statusMessage": "success",
    "status": 1,
    "data": [
      {
        "id": 123456789,
        "name": "JELOU TEST",
        "slug": "jeloutest",
        "driver": "elastic",
        "description": "JELOU TEST",
        "companyId": 135,
        "schema": {
          "type": "object",
          "properties": {
            "total": { "type": "string", "database": "text" },
            "name": { "type": "string", "database": "text" }
          },
          "required": ["total", "name"]
        }
      }
    ]
  }
  ```
</ParamField>

## Database structure

Each database in Datum is composed of the following attributes:

| Property    | Type    | Description                                                  |
| ----------- | ------- | ------------------------------------------------------------ |
| id          | string  | Unique database identifier.                                  |
| name        | string  | Database name.                                               |
| description | string  | Functional description of the database.                      |
| schema      | object  | Schema that defines the fields and data types.               |
| state       | boolean | Database state. `true` = active, `false` = deleted.          |
| createdAt   | date    | Creation date.                                               |
| updatedAt   | date    | Date of last update.                                         |
| columns     | array   | Columns visible in Datum, with name, description, and order. |
| metadata    | array   | Additional metadata associated with the database.            |

## Schema structure

Defines the shape and validations of stored data.

| Property   | Type   | Description                                         |
| ---------- | ------ | --------------------------------------------------- |
| type       | string | Schema type (usually `object`).                     |
| required   | array  | Required fields when inserting a record.            |
| properties | object | Each property represents a field and its data type. |

## Get information about a specific database

### Endpoint

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

### Path parameters

<ParamField path="DATABASE_ID" type="string" required>
  Unique database identifier.
</ParamField>

### Responses

* **200 – OK** Database found.
* **401 – Unauthorized** Unauthorized.
* **404 – Not Found** Database not found.
* **500 – Internal Server Error** Internal server error.

### Response example

```json theme={null}
{
  "message": ["Database retrieved successfully!"],
  "statusMessage": "success",
  "status": 1,
  "data": {
    "id": 123456789,
    "name": "JELOU TEST",
    "slug": "jeloutest",
    "schema": {
      "type": "object",
      "properties": {
        "total": { "type": "string", "database": "text" },
        "name": { "type": "string", "database": "text" }
      },
      "required": ["total", "name"]
    }
  }
}
```


## OpenAPI

````yaml GET /v2/databases
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:
    get:
      tags:
        - Datum
      summary: List Databases
      description: Retrieve all Datum databases.
      operationId: listDatabases
      parameters:
        - name: shouldPaginate
          in: query
          schema:
            type: string
      responses:
        '200':
          description: Databases retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatabasesListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    DatabasesListResponse:
      type: object
      properties:
        message:
          type: array
          items:
            type: string
        statusMessage:
          type: string
        status:
          type: integer
        data:
          type: array
          items:
            $ref: '#/components/schemas/Database'
    Database:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        slug:
          type: string
        driver:
          type: string
        description:
          type: string
        companyId:
          type: integer
        schema:
          type: object
        state:
          type: boolean
        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:
    Unauthorized:
      description: Unauthorized - Invalid authentication credentials
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: Basic authentication using Base64 encoded clientId:clientSecret

````