Database

circle-info

💡 Understand the bkend database system and learn how to manage data with the REST API.

What is the Database?

If you want to store and query data with just API calls — without defining table structures in advance — use bkend's dynamic tables. bkend provides an isolated database for each project. You can create tables and perform data CRUD (Create, Read, Update, Delete) operations via the REST API without any server setup.

spinner

Key Features

Per-Project Isolation

Each project uses its own independent database. Data is also separated by environment (dev/staging/prod), ensuring development and production data never overlap.

Schema-Based Validation

Data is automatically validated according to the schema defined on each table. Constraints such as required fields, types, patterns, and ranges are enforced.

Role-Based Permissions

You can configure role-based access permissions for each table.

Role
Description

admin

Full access to all data

user

Access based on table permission settings

guest

Access based on table permission settings (no authentication required)

self

Access only to data created by the user

System Fields

The following system fields are automatically added to every record.

Field
Type
Description

id

string

Unique data ID

createdBy

string

Creator ID

createdAt

string

Creation timestamp (ISO 8601)

updatedAt

string

Last modified timestamp (ISO 8601)


API Structure

The database API supports two path formats.

Path
Description

/v1/data/:tableName

Standard path

/v1/:tableName

Shorthand path

Both paths work identically. This documentation uses the standard path (/v1/data/:tableName).

Required Headers

Header
Required
Description

X-API-Key

{pk_publishable_key} — Publishable Key

Authorization

Conditional

Bearer {accessToken} — Required depending on permissions

circle-info

💡 The Publishable Key contains project and environment information, so no additional headers are needed.


Development Workflow

Here is the end-to-end workflow for using the database. Design your structure in the console, then manage data from your app via the REST API.

spinner
Step
Tool
Task
Where to Check

1

Console

Create tables, define columns

Console > Database

2

Console

Set CRUD permissions per role

Console > Database > Table > Permissions

3

Console

Issue an API Key (Bearer Token)

Console > API Keys > Create New Token

4

REST API

Perform data CRUD from your app

POST/GET/PATCH/DELETE /v1/data/:tableName

circle-info

💡 You can find your Publishable Key in Console > API Keys.

If you are integrating the REST API in your app for the first time, see Integrate bkend in Your App first.


Table Management

circle-info

💡 Table naming rules: Must start with a letter. Only letters, numbers, dashes, and underscores are allowed (/^[a-zA-Z][a-zA-Z0-9_-]*$/). Examples: posts, user-profiles, order_items

Table creation, schema editing, and index management are performed in the console.

If you use AI tools, you can also manage tables through MCP tools.


In This Section

Document
Description

Schema, permissions, system fields

POST — Add new data

GET — Retrieve data by ID

GET — Retrieve a list of data

PATCH — Update data

DELETE — Remove data

AND/OR filters, search

Sorting, paging

Inspect table structure

Full endpoint listing

Implement CRUD in your app

circle-info

💡 Learn by doing: To see how data CRUD is used in real projects, check out the Cookbooksarrow-up-right.

Last updated