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

# Create a database from rows

> Create a database from columns and rows. Limits: 5000 rows, 60 columns, 500 characters per cell, 1 MB.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/databases
openapi: 3.1.0
info:
  title: rial API
  version: 0.1.0
  description: 'Prove a photo is real. Base URL: https://api.rial.io'
  contact:
    name: rial-platform team
    url: https://github.com/Rial-ventures-Inc/rial-platform
  license:
    name: UNLICENSED — proprietary, internal use only
servers:
  - url: https://api.rial.io
    description: Production
security: []
tags:
  - name: Verifications
    description: >-
      Create, fetch, list, and finalize verifications. The core of the API —
      every tenant integration starts here.
  - name: Templates
    description: >-
      Publish, update, revoke and inspect link templates — the reusable capture
      links behind `/l/{token}` (a compact JWT carrying the org and template
      slugs; the legacy `/l/{org}/{slug}` keeps resolving). Callable with a
      secret key; each publish snapshots a versioned capture spec (GET-83).
  - name: Databases
    description: >-
      Create, update, inspect and synchronize tenant-scoped databases used by
      reusable verification templates. Callable with a dashboard session or
      secret API key.
paths:
  /v1/databases:
    post:
      tags:
        - Databases
      summary: Create a database from rows
      description: >-
        Create a database from columns and rows. Limits: 5000 rows, 60 columns,
        500 characters per cell, 1 MB.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  pattern: ^[A-Za-z0-9_-]{1,64}$
                name:
                  type: string
                  minLength: 1
                  maxLength: 80
                identifier_column:
                  type: string
                  minLength: 1
                  maxLength: 80
                source:
                  type: string
                  enum:
                    - csv
                  default: csv
                columns:
                  type: array
                  items:
                    type: string
                    minLength: 1
                    maxLength: 80
                  minItems: 1
                  maxItems: 60
                rows:
                  type: array
                  items:
                    type: array
                    items:
                      type: string
                      maxLength: 4096
                  maxItems: 5000
              required:
                - name
                - columns
                - rows
              additionalProperties: false
            example:
              name: Flota asegurada
              columns:
                - poliza
                - direccion
                - vehiculo
              rows:
                - - POL-001
                  - Godoy Cruz 5218, Buenos Aires
                  - Toyota Hilux gris
      responses:
        '201':
          description: Table created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperatorDatabase'
              example:
                id: db_01hz3k9m2q
                name: Flota asegurada
                source: csv
                columns:
                  - poliza
                  - direccion
                  - vehiculo
                rows:
                  - - POL-001
                    - Godoy Cruz 5218, Buenos Aires
                    - Toyota Hilux gris
                created_at: '2026-08-01T00:00:00.000Z'
                updated_at: '2026-08-01T00:00:00.000Z'
        '400':
          description: Body failed validation (duplicate columns, misaligned rows, limits).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: The id already exists for this tenant.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    enum:
                      - duplicate_id
                required:
                  - error
              example:
                error: duplicate_id
        '503':
          description: The store is unreachable — retry with backoff.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  cause:
                    type: string
                required:
                  - error
              example:
                error: storage_unavailable
      security:
        - bearerApiKey: []
components:
  schemas:
    OperatorDatabase:
      oneOf:
        - type: object
          properties:
            id:
              type: string
              pattern: ^[A-Za-z0-9_-]{1,64}$
            name:
              type: string
              minLength: 1
              maxLength: 80
            identifier_column:
              type: string
            columns:
              type: array
              items:
                type: string
            rows:
              type: array
              items:
                type: array
                items:
                  type: string
            created_at:
              type: string
              format: date-time
            updated_at:
              type: string
              format: date-time
            source:
              type: string
              enum:
                - csv
          required:
            - id
            - name
            - columns
            - rows
            - created_at
            - updated_at
            - source
          additionalProperties: false
        - type: object
          properties:
            id:
              type: string
              pattern: ^[A-Za-z0-9_-]{1,64}$
            name:
              type: string
              minLength: 1
              maxLength: 80
            identifier_column:
              type: string
            columns:
              type: array
              items:
                type: string
            rows:
              type: array
              items:
                type: array
                items:
                  type: string
            created_at:
              type: string
              format: date-time
            updated_at:
              type: string
              format: date-time
            source:
              type: string
              enum:
                - provider
            source_details:
              type: object
              properties:
                provider:
                  type: string
                  enum:
                    - google_sheets
                connection_id:
                  type: string
                  pattern: ^[A-Za-z0-9_-]{1,64}$
                spreadsheet_id:
                  type: string
                  minLength: 1
                spreadsheet_title:
                  type: string
                sheet_id:
                  type: integer
                sheet_title:
                  type: string
                source_url:
                  type: string
                  format: uri
              required:
                - provider
                - connection_id
                - spreadsheet_id
                - spreadsheet_title
                - sheet_id
                - sheet_title
                - source_url
              additionalProperties: false
            sync:
              type: object
              properties:
                status:
                  type: string
                  enum:
                    - synced
                    - syncing
                    - error
                    - reauthorization_required
                last_synced_at:
                  type: string
                  format: date-time
                last_attempt_at:
                  type: string
                  format: date-time
                next_sync_at:
                  type: string
                  format: date-time
                error_code:
                  type: string
                  enum:
                    - source_not_found
                    - tab_not_found
                    - invalid_table
                    - quota
                    - upstream
              required:
                - status
                - last_synced_at
                - last_attempt_at
              additionalProperties: false
          required:
            - id
            - name
            - columns
            - rows
            - created_at
            - updated_at
            - source
            - source_details
            - sync
          additionalProperties: false
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            fields:
              type: array
              items:
                type: object
                properties:
                  path:
                    type: string
                  message:
                    type: string
                required:
                  - path
                  - message
          required:
            - code
            - message
      required:
        - error
      description: >-
        Uniform error envelope. `code` is the stable string SDKs branch on
        (`invalid_request`, `unauthorized`, `not_found`, `expired`, `step_full`,
        `unknown_step`, `steps_incomplete`, `already_finalized`,
        `too_many_requests`, `storage_unavailable`, `internal_error`). `fields`
        is only present on `invalid_request` validation failures.
  securitySchemes:
    bearerApiKey:
      type: http
      scheme: bearer
      bearerFormat: rk_secret_<key>
      description: >-
        Secret API key, created in the dashboard under Settings → API. Send it
        as `Authorization: Bearer rk_secret_…` from your server only.
        Publishable keys (`pk_live_…`) are for the native SDKs and reach the
        capture endpoints alone. An unknown key returns 401.

````