Mock APIs
Every seed is also a CORS-enabled JSON API. Pagination, bearer auth, public toggle.
When a seed exists in your library, it's automatically queryable via a REST API rooted at seedkit.dev/api/mocks/<id>. No extra setup — the same dataset that backs your ephemeral DB also backs the API.
Endpoints
| Endpoint | Purpose |
|---|---|
GET /api/mocks/<id> | Schema overview: tables, row counts, sample columns. |
GET /api/mocks/<id>/<table> | Paginated rows for a table. Use ?limit= and ?cursor=. |
GET /api/mocks/<id>/<table>/<pk> | Single row by primary key. |
<id> is the short id printed by seedkit new (e.g. a3fd). Find it in the dashboard or via seedkit list.
Auth modes
Token-gated (default). The API requires a Bearer msk_* header scoped to that mock:
curl -H "Authorization: Bearer msk_..." \
https://seedkit.dev/api/mocks/a3fd/users
Public. Toggle in the dashboard. CORS is wide-open (Access-Control-Allow-Origin: *):
curl https://seedkit.dev/api/mocks/a3fd/users
Public mocks are clearly marked in the dashboard so you don't forget you opened one up.
Pagination
Cursor-based:
curl https://seedkit.dev/api/mocks/a3fd/users?limit=20
{
"data": [ /* 20 rows */ ],
"next": "?cursor=eyJpZCI6MjB9"
}
Follow next to get the next page. Cursor is opaque and stable; don't construct one manually.
Lifecycle
Mock APIs are anchored to their underlying seed. The API stays live as long as the seed is in your cache. The TTL of any backing ephemeral DB is independent — destroying the DB doesn't take the API down.
| Tier | Mocks per org | TTL refresh |
|---|---|---|
| Free | 1 | 7 days, manual extend |
| Pro | 10 | 30 days, click to extend |
| Team | 100 | 90 days, click to extend |
Expired mocks return 404. Re-extend in the dashboard or by running seedkit seed --seed <name> again (which refreshes the cache TTL).