Skip to main content
Lark exposes a REST API for reading and writing data over plain HTTP. If you’re working from a server, a script, a CLI tool, or any environment where you don’t want to maintain a persistent connection, the REST API is the way to go.

URL format

Every REST request targets a path in a database, with .json appended. The database goes in the subdomain, separated from your project ID by --:
For example, to access /players/alice in the my-game database of project chess-app:
The root of the database:

The default database

If you leave the database out of the subdomain, Lark routes to a database named default:
That request is identical to:

Authentication

Pass an auth token as a query parameter:
The auth parameter accepts any token that Lark supports: Lark tokens (HS256 JWTs signed with your secret key) or Firebase Auth tokens. You can also use access_token as an alias:
If you omit the token, the request is treated as anonymous. Your security rules determine what anonymous clients can access.

Operations at a glance

When to use the REST API

  • Reading or writing data from your backend without maintaining a WebSocket connection.
  • One-off scripts to import data, seed a database, or run migrations.
  • Receiving a webhook and writing to Lark with a single HTTP call.
  • Edge functions, serverless workers, or other runtimes without WebSocket support.
  • Quick reads with curl to inspect your data.
For real-time subscriptions and persistent connections, use the Lark SDK or Firebase SDKs instead.

Quick example

What’s next

Reading data

GET requests, shallow reads, queries, and formatting options.

Writing data

PUT, POST, PATCH, DELETE, multi-path updates, and server values.

Streaming

Server-Sent Events for real-time updates over HTTP.

Conditional requests

ETags and compare-and-swap for safe concurrent writes.