Backend API Overview
Relevant source files
The following files were used as context for generating this wiki page:
The Budibase Public API provides a RESTful interface for interacting with your Budibase applications, data, and services. It is designed to enable interoperability with other systems and allow developers to use Budibase as a powerful backend for custom applications. The API is built on Koa.js and exposes endpoints for managing core resources such as tables, rows, queries, users, and applications.
All interactions with the API are secured and based on user permissions, ensuring that data access is controlled by the Role-Based Access Control (RBAC) settings configured within your Budibase instance. The API is defined using the OpenAPI 3.1.0 specification, which provides detailed, interactive documentation for all available endpoints.
Sources: README.md, packages/server/specs/openapi.yaml, examples/nextjs-api-sales/README.md
API Architecture
The Budibase backend is a monorepo containing several packages. The packages/server package is a Koa application responsible for serving the API. It handles requests for interacting with the database, file system, and other services.
Sources: README.md
Authentication
Authentication is handled via an API key passed in the request headers. Each user has an individual API key which grants access based on their configured permissions.
| Header | Description |
|---|---|
x-budibase-api-key | Your individual user API key. |
x-budibase-app-id | The ID of the app the request is targeting (e.g., app_dev_... or app_...). |
Sources: packages/server/specs/openapi.yaml
The following diagram illustrates the basic authentication and request flow.
Sources: packages/server/specs/openapi.yaml
Core Resources and Endpoints
The API is organized around several core resources. The base URL for the public API on Budibase Cloud is https://budibase.app/api/public/v1.
Sources: packages/server/specs/openapi.yaml
Tables
Tables are the primary data structures in Budibase. The API provides full CRUD functionality for managing tables and their schemas.
| Endpoint | HTTP Method | Description |
|---|---|---|
/api/public/v1/tables | POST | Create a new table. |
/api/public/v1/tables/search | POST | Search for tables by name. |
/api/public/v1/tables/{tableId} | GET | Retrieve a specific table by its ID. |
/api/public/v1/tables/{tableId} | PUT | Update an existing table's schema or properties. |
/api/public/v1/tables/{tableId} | DELETE | Delete a table. |
Sources: packages/server/specs/openapi.yaml
Rows
Rows represent individual records within a table. The API allows for creating, reading, updating, deleting, and searching for rows.
| Endpoint | HTTP Method | Description |
|---|---|---|
/api/public/v1/tables/{tableId}/rows | POST | Create a new row in a table. |
/api/public/v1/tables/{tableId}/rows/search | POST | Search for rows within a table using a JSON-based query language. |
/api/public/v1/tables/{tableId}/rows/{rowId} | GET | Retrieve a specific row by its ID. |
/api/public/v1/tables/{tableId}/rows/{rowId} | PUT | Update an existing row. |
/api/public/v1/tables/{tableId}/rows/{rowId} | DELETE | Delete a row. |
/api/public/v1/views/{viewId}/rows/search | POST | Search for rows within a specific view. |
Sources: packages/server/specs/openapi.yaml
Row Search
The row search endpoint (/api/public/v1/tables/{tableId}/rows/search) is particularly powerful, allowing for complex data retrieval using a variety of filters. The request body accepts a JSON object with a query property.
The following diagram shows the flow for searching rows.
Sources: packages/server/specs/openapi.yaml
The query object can contain the following filter types:
| Filter | Description | Example |
|---|---|---|
string | Finds rows where a column value starts with the given string. | {"name": "Mike"} |
fuzzy | Finds rows where a column value contains the given substring. | {"email": "@example.com"} |
range | Finds rows where a numeric or date column is within a given range. | {"age": {"low": 18, "high": 30}} |
equal | Finds rows with an exact match for a column value. | {"status": "active"} |
notEqual | Finds rows that do not have the specified column value. | {"status": "inactive"} |
empty | Finds rows where a specific column is null or has no value. | {"address": ""} |
notEmpty | Finds rows where a specific column has a value. | {"address": ""} |
oneOf | Finds rows where a column value matches any of the values in an array. | {"city": ["Belfast", "Dublin"]} |
contains | For array-type columns, finds rows where the array contains all specified values. | {"tags": ["dev", "api"]} |
Sources: packages/server/specs/openapi.yaml
Queries
The API allows execution of pre-defined queries created within the Budibase builder. This is useful for running complex SQL queries, REST API calls, or other custom data operations.
| Endpoint | HTTP Method | Description |
|---|---|---|
/api/public/v1/queries/search | POST | Search for queries by name. |
/api/public/v1/queries/{queryId} | POST | Execute a specific query with parameters. |
Sources: packages/server/specs/openapi.yaml
Users and Roles
User management is available through the API, enabling programmatic creation and administration of users. These endpoints are typically restricted to admin users.
| Endpoint | HTTP Method | Description |
|---|---|---|
/api/public/v1/users | POST | Create a new user. |
/api/public/v1/users/search | POST | Search for users by name. |
/api/public/v1/users/{userId} | GET | Retrieve a user by ID. |
/api/public/v1/users/{userId} | PUT | Update a user's details. |
/api/public/v1/users/{userId} | DELETE | Delete a user. |
/api/public/v1/roles/assign | POST | Assign a role to a list of users (Business/Enterprise only). |
/api/public/v1/roles/unassign | POST | Un-assign a role from a list of users (Business/Enterprise only). |
Sources: packages/server/specs/openapi.yaml
Applications & Workspaces
The API provides endpoints for managing the lifecycle of applications and workspaces, including creation, publishing, and export/import functionality.
| Endpoint | HTTP Method | Description |
|---|---|---|
/api/public/v1/workspaces | POST | Create a new workspace. |
/api/public/v1/workspaces/{workspaceId}/publish | POST | Publish a workspace. |
/api/public/v1/workspaces/{workspaceId}/export | POST | Export a workspace (Business/Enterprise only). |
/api/public/v1/workspaces/{workspaceId}/import | POST | Import into an existing workspace (Business/Enterprise only). |
Sources: packages/server/specs/openapi.yaml
Metrics
Budibase exposes a metrics endpoint for monitoring and observability, compatible with Prometheus.
| Endpoint | HTTP Method | Description |
|---|---|---|
/api/public/v1/metrics | GET | Retrieve Budibase tenant metrics in OpenMetrics format. |
Sources: packages/server/specs/openapi.yaml
Summary
The Budibase Backend API is a comprehensive and secure interface for programmatic interaction with the platform's resources. It enables a wide range of use cases, from simple data manipulation to complex integrations and using Budibase as a complete backend-as-a-service. Its OpenAPI specification ensures that it is well-documented and easy for developers to consume.
Sources: README.md, packages/server/specs/openapi.yaml