From CREATE TABLE to curl
Make the table with SQL, from the dashboard or any client, then call it:
API=https://api.hornethive.io/v1
DB=<database id> # from the dashboard
KEY=<api key> # read, dml or ddl; all databases or the ones you select
# insert a row
curl $API/rest/$DB/books -H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" -d '{"title":"The Hive and the Hornet"}'
# list, filtered, ordered and paged, with the total
curl -i "$API/rest/$DB/books?select=id,title&author=eq.Aina&year=gte.2020&order=year.desc&limit=20" \
-H "Authorization: Bearer $KEY" -H "Prefer: count=exact"What the REST API does
- GET https://api.hornethive.io/v1/rest/{database}/{table} lists rows: ?select= picks columns; filters such as ?price=gt.10, ?id=in.(1,2,3), ?name=ilike.*tea* and ?or=(…) narrow them; ?order= sorts by several columns; ?limit= (up to 1,000) and ?offset= page; Prefer: count=exact gives the total.
- GET /rest/{database}/{table}/{key} reads one row by its primary key.
- POST inserts one row or an array of them, or upserts them on a unique key; PATCH updates and DELETE removes every row matching your filters. A filter is required, so one request cannot wipe a table by accident.
- POST /rest/{database}/rpc/{function} calls a Postgres function; POST /rest/{database}/query runs one SQL statement. Read-only keys may only read.
- GET /rest/{database}/openapi.json describes every table and function as OpenAPI 3.1, for Swagger UI, Postman or a generated client.
Keys that only do what you allow
Each API key is read, DML (rows only, never structure) or DDL, for all your databases or only the ones you select, shown once and stored only as a hash. A read-only key can be used from the browser, from the origins you register, so a static site can read its data with no server in between. Keep DML and DDL keys on your server.
Calls are counted against your plan: 500K a month on the free plan, 2.5M on Starter and 25M on Pro.
Still a real database
The REST API sits on an ordinary PostgreSQL 18 database. When you outgrow it, the same tables are there for your ORM, for GraphQL, or for a direct connection on the Pro plan. Nothing to migrate.
Every route, operator and header is in the REST API reference.
Updated