Quickstart

Create a database, define a collection and open a document.

1. Create a database

Sign up, create an organization and a project, then create a database in the region closest to your users. Its connection details are on the database page.

2. Create a database key

On the database's Keys tab, create a key with the write or admin permission. Its secret (mk_…) is shown once: store it in your backend's secrets.

3. Define a collection

With an admin key, create a collection with its first schema:

curl -X POST "$DATABASE_API_URL/collections" \
  -H "Authorization: Bearer $MIMIC_DATABASE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "todos", "schema": { ... }}'

4. Let a user open a document

Your backend mints a short-lived document token for the signed-in user, and your app opens the WebSocket URL it returns:

curl -X POST "$DATABASE_API_URL/collections/todos/documents/list-42/tokens" \
  -H "Authorization: Bearer $MIMIC_DATABASE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"permission": "write", "origins": ["https://app.example.com"], "expiresInSeconds": 600}'

To mint tokens without calling the API, register an Ed25519 public key on the Token keys tab and sign tokens in your backend.