Database
💡 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.
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.
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.
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.
/v1/data/:tableName
Standard path
/v1/:tableName
Shorthand path
Both paths work identically. This documentation uses the standard path (/v1/data/:tableName).
Required Headers
X-API-Key
✅
{pk_publishable_key} — Publishable Key
Authorization
Conditional
Bearer {accessToken} — Required depending on permissions
💡 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.
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
💡 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
💡 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.
Table Management — Create and manage tables in the console
Schema Editor — Configure columns and constraints
Index Management — Indexes for performance optimization
If you use AI tools, you can also manage tables through MCP tools.
Table Tools — Manage tables via AI
In This Section
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
💡 Learn by doing: To see how data CRUD is used in real projects, check out the Cookbooks.
Last updated