ShipStack API Documentation
One REST API for authentication, database, and file storage — powered by Supabase, Firebase, Appwrite, PocketBase, or Upstash.
https://shipstack.codes/apiQuick Start
Get your first API call working in under 5 minutes.
1Create an account
Sign up at shipstack.codes/signup. You'll get a free Hobby plan with 5,000 API calls/month.
2Get your API token
Register or login to get a Bearer token:
curl -X POST https://shipstack.codes/api/register \
-H "Content-Type: application/json" \
-d '{
"name": "Jane Doe",
"email": "jane@example.com",
"password": "securepass123",
"password_confirmation": "securepass123"
}'Response:
{
"data": {
"user": { "id": 1, "name": "Jane Doe", "email": "jane@example.com" },
"token": "1|abc123..."
}
}3Connect a provider
Go to Dashboard → Connect Provider and paste your provider credentials. ShipStack will verify the connection automatically.
Or create a tenant via API:
curl -X POST https://shipstack.codes/api/tenants \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "My App",
"auth_provider": "supabase",
"db_provider": "supabase",
"storage_provider": "supabase",
"provider_credentials": {
"supabase": {
"url": "https://xyzcompany.supabase.co",
"api_key": "your-supabase-api-key"
}
}
}'4Make API calls
Every request needs two headers:
Authorization: Bearer YOUR_TOKENX-Tenant-Token: YOUR_TENANT_TOKEN
curl https://shipstack.codes/api/db/todos \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Tenant-Token: YOUR_TENANT_TOKEN"Authentication
Manage end-users in your connected provider. These endpoints proxy to Supabase Auth, Firebase Auth, Appwrite Auth, or PocketBase Auth depending on your tenant configuration.
Register a user
curl -X POST https://shipstack.codes/api/auth/register \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Tenant-Token: YOUR_TENANT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "password123"
}'Log in a user
curl -X POST https://shipstack.codes/api/auth/login \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Tenant-Token: YOUR_TENANT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "password123"
}'Returns an access token from your provider. Store this on the client for subsequent requests.
Get current user
curl https://shipstack.codes/api/auth/user \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Tenant-Token: YOUR_TENANT_TOKEN" \
-H "X-User-Token: USER_ACCESS_TOKEN"Log out
curl -X POST https://shipstack.codes/api/auth/logout \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Tenant-Token: YOUR_TENANT_TOKEN" \
-H "X-User-Token: USER_ACCESS_TOKEN"Password reset
curl -X POST https://shipstack.codes/api/auth/reset-password \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Tenant-Token: YOUR_TENANT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"email": "user@example.com"}'Database CRUD
Insert, query, update, and delete rows in any table. Supports filters, pagination, and ordering.
Insert a row
curl -X POST https://shipstack.codes/api/db/todos \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Tenant-Token: YOUR_TENANT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"data": {
"title": "Ship it",
"completed": false
}
}'Query rows
# Get all rows
curl "https://shipstack.codes/api/db/todos" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Tenant-Token: YOUR_TENANT_TOKEN"
# With filters, ordering, and pagination
curl "https://shipstack.codes/api/db/todos?completed=false&order=created_at.desc&limit=10&offset=0" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Tenant-Token: YOUR_TENANT_TOKEN"Query Parameters
column=value— Filter by exact matchorder=column.asc|desc— Sort resultslimit=N— Max rows to returnoffset=N— Skip N rows (pagination)select=col1,col2— Select specific columns
Update a row
curl -X PUT https://shipstack.codes/api/db/todos/1 \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Tenant-Token: YOUR_TENANT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"data": {
"completed": true
}
}'Delete a row
curl -X DELETE https://shipstack.codes/api/db/todos/1 \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Tenant-Token: YOUR_TENANT_TOKEN"Real-Time Subscriptions
Subscribe to table changes via Server-Sent Events (SSE). Works with all providers.
Subscribe to changes
curl -N "https://shipstack.codes/api/db/todos/subscribe?interval=2" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Tenant-Token: YOUR_TENANT_TOKEN"Returns an SSE stream. You'll receive a snapshot event with the initial data, then INSERT, UPDATE, and DELETE events as changes occur.
Query Parameters
interval=N— Poll frequency in seconds (1–10, default 2)filters[column]=value— Only subscribe to matching rows
Using the JavaScript SDK
const sub = shipstack.db.subscribe("todos", { interval: 2 })
.onSnapshot((records) => {
console.log("Initial data:", records);
})
.onChange((event, data) => {
// event: 'INSERT' | 'UPDATE' | 'DELETE'
console.log(event, data);
})
.onError((err) => console.error(err));
// Cleanup when done
sub.unsubscribe();File Storage
Upload, download, list, and delete files. Returns signed URLs for secure access.
Upload a file
curl -X POST https://shipstack.codes/api/storage/avatars \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Tenant-Token: YOUR_TENANT_TOKEN" \
-F "file=@photo.jpg" \
-F "path=users/123/avatar.jpg"List files in a bucket
curl "https://shipstack.codes/api/storage/avatars" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Tenant-Token: YOUR_TENANT_TOKEN"Download a file
curl "https://shipstack.codes/api/storage/avatars/users/123/avatar.jpg" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Tenant-Token: YOUR_TENANT_TOKEN" \
-o avatar.jpgGet signed URL
curl "https://shipstack.codes/api/storage/avatars/users/123/avatar.jpg/url" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Tenant-Token: YOUR_TENANT_TOKEN"Returns a time-limited signed URL (default 1 hour) for public access.
Delete a file
curl -X DELETE "https://shipstack.codes/api/storage/avatars/users/123/avatar.jpg" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Tenant-Token: YOUR_TENANT_TOKEN"JavaScript SDK
Use @shipstack/js for a typed TypeScript/JavaScript client.
Install
npm install @shipstack/jsInitialize
import { createClient } from "@shipstack/js";
const shipstack = createClient({
token: process.env.SHIPSTACK_TOKEN!,
tenantToken: process.env.SHIPSTACK_TENANT_TOKEN!,
});Usage
// Auth
await shipstack.auth.register("user@example.com", "password123");
await shipstack.auth.login("user@example.com", "password123");
// Database
await shipstack.db.insert("todos", { title: "Ship it" });
const { data } = await shipstack.db.select("todos", { limit: 10 });
await shipstack.db.update("todos", "1", { completed: true });
await shipstack.db.delete("todos", "1");
// Real-time
const sub = shipstack.db.subscribe("todos")
.onSnapshot(console.log)
.onChange((event, data) => console.log(event, data));
// Storage
await shipstack.storage.upload("avatars", "user/photo.jpg", file);
const url = await shipstack.storage.getSignedUrl("avatars", "user/photo.jpg");API Reference
Complete list of all endpoints.
Account
/registerCreate account/loginGet auth token/userGet current user (needs auth)Tenants
/tenantsList all tenants/tenantsCreate a tenant/tenants/:idGet tenant details/tenants/:idUpdate tenant/tenants/:idDelete tenant/tenants/:id/regenerate-tokenRegenerate API token/tenants/:id/usageGet usage logsAuth (Tenant)
/auth/registerRegister end-user/auth/loginLogin end-user/auth/logoutLogout end-user/auth/userGet end-user profile/auth/reset-passwordSend password resetDatabase (Tenant)
/db/:tableQuery rows/db/:tableInsert row/db/:table/:idUpdate row/db/:table/:idDelete row/db/:table/subscribeReal-time SSE streamStorage (Tenant)
/storage/:bucketList files/storage/:bucketUpload file/storage/:bucket/:pathDownload file/storage/:bucket/:path/urlGet signed URL/storage/:bucket/:pathDelete fileUsage
/usage/quotaGet monthly usage & limitsProvider Testing
/providers/testValidate provider credentialsBilling
/stripe/configGet publishable key + tiers/stripe/statusGet subscription status/stripe/checkoutCreate checkout session/stripe/portalOpen billing portalErrors
All errors return JSON with a message field. Standard HTTP status codes are used.
{
"message": "The email field is required.",
"errors": {
"email": ["The email field is required."]
}
}Ready to start building?
Create a free account and connect your first provider in under 5 minutes.
Get Started Free