Quickstart
This page walks through hitting the Slothbox API for the first time — creating
an API key, calling /me, and creating an organization.
The examples use raw curl; if you're building in TypeScript, the official
SDK wraps the same calls with typed parameters and errors — see the
SDK quickstart.
1. Get an API key
There are two kinds of key, and which one you want depends on whether a human is driving:
- Personal key — for light, occasional scripting alongside your interactive work. Every seat gets one, created from the web app (Settings → API keys).
- Org service-account key — for headless, unattended use (CI, agents, backends). It belongs to the organization, requires the API plan, and is created by an owner in the org's Service accounts settings. See the headless guide for the full path.
Either way the key is shown once, so copy it somewhere safe.
Minting any key — personal or service-account — requires a signed-in human with a Cognito session: an existing API key can't mint more keys. See Authentication for why.
2. Verify the key
curl https://api.slothbox.dev/me \
-H "Authorization: sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
You should get back a JSON document with your user and the organizations you belong to.
For CI, agents, backends, or any caller that runs with no human present, see Headless authentication — it uses an org-level service-account key instead of a personal one.
3. Create an organization
curl https://api.slothbox.dev/organizations \
-H "Authorization: sk_..." \
-H "Content-Type: application/json" \
-d '{"name":"Acme"}'
The caller automatically becomes the first owner. From here you can invite teammates, connect an AWS account, and start defining environments. The full set of endpoints lives in the API reference.