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

# Zite Database REST API

> Interact with Zite's built-in database (ZiteDB) via a REST API. Get programmatic access to your databases, tables, and records.

### Introduction

The **Zite DB API** lets you access and manage your Zite databases programmatically, without using the Zite interface.

You can create databases, manage table schemas, define field types, and perform CRUD operations on records via the API.

### Field types

Zite DB supports over 20 different field types to handle various data structures - from simple text and numbers to complex relationships. See the complete [Field Types](/help/database/api/field-types) guide for details.

### Authentication

Generate and view your API key in the `Developer` [settings tab of your account](https://app.zite.com/home/settings/developer). You can revoke or regenerate your API key at any time via the dashboard.

<Frame>
  <img src="https://mintcdn.com/zite/RtRJbTQxR6aAduor/help/images/advanced/api-key.png?fit=max&auto=format&n=RtRJbTQxR6aAduor&q=85&s=a787bcad80b0b9f6d685d884ed3cde6e" alt="Developer settings showing the Zite REST API base URL and API key" width="1686" height="1008" data-path="help/images/advanced/api-key.png" />
</Frame>

To authenticate your requests, you need to provide your API key in the `Authorization` header in the following format:

```bash theme={null}
Authorization: Bearer <your-api-key>
```

Replace `<your-api-key>` with the **API key** obtained from your Zite account.

The API base URL is [https://tables.zite.com/api/v1](https://tables.zite.com/api/v1).

<Check>
  **Important:** If your workspace uses a custom deployment, use the base URL shown in your API dashboard.
</Check>

<Info>
  **Note:** Use the same Zite API key for Zite REST API and Zite DB endpoints.
</Info>

## Finding Database and Table IDs

When working with the Zite Database API, you'll need to provide database IDs and table IDs in your API requests. Here's how to find them:

<Steps>
  <Step title="Open your database">
    Click the database from the home page [dashboard](https://app.zite.com/home).
  </Step>

  <Step title="Get IDs from the URL">
    Look at the URL in your browser. It follows this format:

    ```text theme={null}
    app.zite.com/database/{databaseId}/{tableId}/...
    ```

    For example, in this URL:

    ```text theme={null}
    app.zite.com/database/67ef4d500c50cce9/t7nUTgYUjzF/vkuDPV6ZqBb
    ```

    * **Database ID**: `67ef4d500c50cce9`
    * **Table ID**: `t7nUTgYUjzF`
  </Step>
</Steps>

<Warning>
  **Important:** If you're accessing a database from within a Zite app, make sure to open the database separately and use that URL, not the Zite editor URL itself.
</Warning>

## Rate limits

All endpoints are limited to being called no more than 30 times per second, per Account/API key. Contact [support@zite.com](mailto:support@zite.com) if you need increased rate limits.

## Error handling

All API errors return a consistent response format:

```json theme={null}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human readable error message"
  }
}
```

### Common error codes

| Code                    | Description                                |
| ----------------------- | ------------------------------------------ |
| `INVALID_RECORD_ID`     | Record ID is not in valid UUID format      |
| `NOT_FOUND`             | Requested resource does not exist          |
| `BAD_REQUEST`           | Invalid request data or validation failure |
| `UNAUTHORIZED`          | Invalid or missing API key                 |
| `INTERNAL_SERVER_ERROR` | Server-side error occurred                 |
| `NOT_IMPLEMENTED`       | Feature not yet implemented                |

## API Endpoints

Explore all available endpoints organized by functionality:

<CardGroup cols={2}>
  <Card title="Records" color="#10b981" icon="database" iconType="solid" href="#records">
    Create, read, update, and delete records in your tables
  </Card>

  <Card title="Fields" color="#3b82f6" icon="table-columns" iconType="solid" href="#fields">
    Manage table fields and their configurations
  </Card>

  <Card title="Tables" color="#f59e0b" icon="table" iconType="solid" href="#tables">
    Create and manage database tables
  </Card>

  <Card title="Databases" color="#8b5cf6" icon="server" iconType="solid" href="#databases">
    Create and manage your databases
  </Card>
</CardGroup>

### Records

Manage individual records within your database tables:

<CardGroup cols={2}>
  <Card title="Create Record" color="#10b981" icon="plus" iconType="solid" href="/help/database/api/create-record">
    Add new records to a table with field data
  </Card>

  <Card title="Get Record by ID" color="#3b82f6" icon="magnifying-glass" iconType="solid" href="/help/database/api/get-record-by-id">
    Retrieve a specific record by its unique identifier
  </Card>

  <Card title="Update Record" color="#f59e0b" icon="pencil" iconType="solid" href="/help/database/api/update-record">
    Modify existing record data
  </Card>

  <Card title="List Records" color="#6366f1" icon="list" iconType="solid" href="/help/database/api/list-records">
    Get all records from a table with filtering options
  </Card>

  <Card title="Delete Record" color="#ef4444" icon="trash" iconType="solid" href="/help/database/api/delete-record">
    Remove a record from the database
  </Card>
</CardGroup>

### Fields

Configure and manage table field schemas:

<CardGroup cols={2}>
  <Card title="Create Field" color="#10b981" icon="plus" iconType="solid" href="/help/database/api/create-field">
    Add new fields to existing tables
  </Card>

  <Card title="Update Field" color="#f59e0b" icon="pencil" iconType="solid" href="/help/database/api/update-field">
    Modify field properties and configurations
  </Card>

  <Card title="Delete Field" color="#ef4444" icon="trash" iconType="solid" href="/help/database/api/delete-field">
    Remove fields from tables
  </Card>

  <Card title="Field Types Reference" color="#3b82f6" icon="book-open" iconType="solid" href="/help/database/api/field-types">
    Complete guide to all supported field types
  </Card>
</CardGroup>

### Tables

Create and manage database table structures:

<CardGroup cols={2}>
  <Card title="Create Table" color="#10b981" icon="table-cells" iconType="solid" href="/help/database/api/create-table">
    Create new tables with custom schemas
  </Card>

  <Card title="Update Table" color="#f59e0b" icon="pencil" iconType="solid" href="/help/database/api/update-table">
    Modify table properties and settings
  </Card>

  <Card title="Delete Table" color="#ef4444" icon="trash" iconType="solid" href="/help/database/api/delete-table">
    Remove tables from your database
  </Card>
</CardGroup>

### Databases

Manage your database instances:

<CardGroup cols={2}>
  <Card title="Create Database" color="#10b981" icon="server" iconType="solid" href="/help/database/api/create-database">
    Create new database instances
  </Card>

  <Card title="Get Databases" color="#3b82f6" icon="database" iconType="solid" href="/help/database/api/get-databases">
    List all your databases
  </Card>

  <Card title="Get Database by ID" color="#6366f1" icon="database" iconType="solid" href="/help/database/api/get-database-by-id">
    Retrieve specific database information
  </Card>

  <Card title="Delete Database" color="#ef4444" icon="trash" iconType="solid" href="/help/database/api/delete-database">
    Remove database instances
  </Card>
</CardGroup>

<p className="zite-related-topics-heading">Related topics</p>

<div className="zite-related-topics">
  <a href="/help/database/api/field-types">Field Types</a>
</div>
