# Quickstart

Source: https://cubibase.com/docs/quickstart

Also available: [Markdown version](https://cubibase.com/docs/quickstart.md) · [llms.txt](https://cubibase.com/llms.txt) · [full site content](https://cubibase.com/llms-full.txt)

Create a project, define a table, expose the operations you want, sign up a user, and call the Data API. About ten minutes, all HTTP.

## 1 · Create a project

1. **Register in the Console** — Create a developer account and verify your email address. Project creation requires a verified email.
2. **Create a project** — Pick a name and a slug. The slug becomes the first label of your API host: `{slug}.api.cubibase.com`.
3. **Wait for provisioning** — Provisioning is queued. The project page shows the status; wait until it reports active before creating tables.

**Provisioning state change, illustration.** Project example-project Provisioning → Active.

- Database example_project_db
- Roles ddl · api · sql · auth
- Schemas public · auth · vault · logs

Illustration of the state change. Creating a project queues the database; it exists when provisioning finishes.

> **important**: The database exists when provisioning finishes, not when you type the project name. Calls to a project that is not active return `404 project_not_found`.

## 2 · Define a table

In the Console, open your project and create a table. This guide uses a `customers` table:

**customers — example schema**

| Column | Type | Notes |
| --- | --- | --- |
| `id` | `uuid` | Primary key, default `gen_random_uuid()` |
| `name` | `text` | Required |
| `email` | `text` | Required |
| `plan` | `text` | Required |
| `owner_id` | `text` | Set as the user column for row-level security |

Setting `owner_id` as the user column at creation time makes every row belong to the user whose JWT subject matches it. The policy is created with the table — you cannot attach it later.

> **tip**: Skip the user column only for tables every signed-in user may read and write, such as a shared product catalog.

## 3 · Expose the operations you want

New tables are not exposed. On the table screen, switch on the operations your app needs — here, `select` and `insert`. Leave `update` and `delete` off until you need them.

**customers · exposure illustration.** Operation switches: select (GET) on, insert (POST) on, update (PATCH) off, delete (DELETE) off.

Served at /rest/v1/customers for the operations you switched on. With everything off: The Data API treats this table as not found. Nothing is exposed.

Illustration. Toggles here do not change any real table.

## 4 · Sign up your first user

Copy the publishable key from the project’s API keys screen, then sign a user up. The response contains the `accessToken` your Data API calls need.

**Sign up · request**

```http
POST https://example-project.api.cubibase.com/auth/v1/signup
apikey: cb_pub_EXAMPLE_ONLY
Content-Type: application/json

{
  "email": "mina@example.com",
  "password": "<USER_PASSWORD>"
}
```

> **note**: Email autoconfirm is on by default: the user is verified immediately and CubiBase does not send a confirmation email yet.

## 5 · Call the Data API

Send the publishable key in the `apikey` header and the user’s access token as the bearer token. With the `owner_id` policy in place, this user only sees their own rows.

**Request**

```http
GET https://example-project.api.cubibase.com/rest/v1/customers?plan=eq.pro&order=name.asc&limit=20
apikey: cb_pub_EXAMPLE_ONLY
Authorization: Bearer <USER_JWT>
```

**200 · response**

```json
{
  "data": [
    {
      "id": "8c1a0b2e-7d44-4a11-9c31-0b51a6e4d901",
      "name": "Mina Cho",
      "email": "mina@example.com",
      "plan": "pro",
      "owner_id": "user_mina"
    },
    {
      "id": "44ab91c3-0e55-4d72-b018-6f2c8a91bb70",
      "name": "Priya Shah",
      "email": "priya@example.org",
      "plan": "pro",
      "owner_id": "user_priya"
    }
  ]
}
```

> **tip**: Rows you insert should carry the user’s id in `owner_id`. The policy checks reads and writes: a row with someone else’s id is rejected with `403 forbidden`.

## Additional resources

- [Querying rows](https://cubibase.com/docs/data-api/querying) Filters, column selection, sorting, and pagination.
- [Sessions and tokens](https://cubibase.com/docs/auth/sessions) Refresh the session before the access token expires.
- [Row-level security](https://cubibase.com/docs/database/row-level-security) How the user column becomes a PostgreSQL policy.
