Skip to content
VaultDBDocs

Getting started

This page takes you from an account to your first API request. You need a terminal with curl.

1. Create an account

Create an account at admin.vaultdb.io/signup with your email address and a password. You can also name your organization; if you leave the name blank, VaultDB names it after your email address, and you can change it later. A new organization starts on the Free plan, and you are its admin.

VaultDB then emails you a link to confirm your address. Click it before you go on: you cannot create a database until your email address is confirmed. If the email does not arrive, use the banner at the top of the admin app to send a new one.

If you already have an account, sign in at admin.vaultdb.io. If the sign-up page says sign-up is not open, email hello@vaultdb.io.

2. Create a database

In the admin app, open Databases and create a database.

A database name:

  • uses lowercase letters, digits and dashes only,
  • starts and ends with a letter or digit,
  • is at most 100 characters long,
  • is unique within your account.

This guide uses a database named shop. You can also create a database with the API; see Databases and tables.

3. Create an API key

In the admin app, open System, then Security, then API keys (admin.vaultdb.io/system/security/keys), and create a key.

Give the key the permissions it needs. For this guide, grant:

  • Databases, to read databases, tables and rows,
  • Manage databases, to create tables and write rows.

You can only grant a key permissions that you hold yourself. Authentication lists every permission.

Copy the key and keep it secret: anyone who has it can act on your databases with the permissions you gave it. The examples below read it from an environment variable:

export VAULTDB_API_KEY='aak_your_key_here'

4. Make your first request

List your databases:

curl https://api.vaultdb.io/api/databases \
  -H "Authorization: Bearer $VAULTDB_API_KEY"

The response lists each database with its table and row counts:

{
  "databases": [
    { "name": "shop", "display_name": null, "table_count": 0, "row_count": 0 }
  ],
  "count": 1
}

Each database object carries more fields than shown here.

5. Create a table and add a row

Create a products table:

curl -X POST https://api.vaultdb.io/api/databases/shop/tables \
  -H "Authorization: Bearer $VAULTDB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "products",
    "columns": [
      { "name": "id", "type": "INTEGER", "primaryKey": true },
      { "name": "name", "type": "TEXT", "notNull": true },
      { "name": "price", "type": "REAL" }
    ]
  }'

Insert a row:

curl -X POST https://api.vaultdb.io/api/databases/shop/tables/products/data \
  -H "Authorization: Bearer $VAULTDB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "data": { "name": "Notebook", "price": 4.5 } }'

Read it back:

curl "https://api.vaultdb.io/api/databases/shop/tables/products/data?limit=10" \
  -H "Authorization: Bearer $VAULTDB_API_KEY"
{
  "table": "products",
  "data": [{ "id": 1, "name": "Notebook", "price": 4.5 }],
  "pagination": { "page": 1, "limit": 10, "total": 1, "pages": 1, "nextOffset": null }
}

Delete your organization

An admin of the organization can delete it from Billing in the admin app, under Delete organization. You confirm with your password and by typing the organization's name.

This deletes every database, snapshot, API key and setting of the organization at once. Each member who belongs to no other organization loses their sign-in too. It cannot be undone, so export anything you want to keep first. If you pay for a plan, cancel the subscription in the billing portal before you delete the organization.

Next steps

  • REST API: filter, sort, update and delete rows.
  • Raw SQL: run your own SQL.
  • SDKs: use a TypeScript or Python client instead of curl.