Documentation

Docs that run

Every snippet on this page targets the real api. Copy a curl, run it against your local stack, and read the response — no screenshots of other people's terminals.

Quickstart: zero to a keyed request

The public developer surface lives under /v1 and authenticates with an x-api-key header. Keys are minted from the account surface — with your JWT via POST /api-keys, or from Dashboard → API keys when you're signed in. Against a fresh local stack:

1 · Register — 201 returns the account and a JWT
curl -X POST http://localhost/api/auth/register \
  -H "Content-Type: application/json" \
  -d '{"email":"dev@example.com","password":"s3cure-passphrase","name":"Dev"}'

{
  "user": { "id": "cml4k9x2b0000jq8f3h5a1d2e", "email": "dev@example.com", … },
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…"
}
2 · Mint a developer key with the JWT
curl -X POST http://localhost/api/api-keys \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…"

{
  "apiKey": {
    "id": "cml4ka7cd0001jq8f9b2c4e6a",
    "key": "pf_9f2c4e6a8b0d1f3e5a7c9b8d7e6f5a4b3c2d1e0f9a8b7c6d",
    "createdAt": "2026-08-06T10:16:02.000Z"
  }
}
3 · Call the public surface with x-api-key
curl http://localhost/api/v1/templates \
  -H "x-api-key: pf_9f2c4e6a8b0d1f3e5a7c9b8d7e6f5a4b3c2d1e0f9a8b7c6d"

{
  "templates": [ { "id": "mailer-box", "name": "Mailer Box", … }, … ],
  "total": 11,
  "categories": [ { "id": "folding-cartons", "label": "Folding Cartons", "count": 1 }, … ]
}

The endpoints you just used

Two mechanisms, no surprises: the account surface takes Authorization: Bearer <JWT>, the public v1 surface takes x-api-key: pf_…. The full index — projects, assets, uploads — lives in the API reference.

MethodPathAuthWhat it does
POST/auth/registerCreate an account. Returns the user and a JWT.
POST/auth/loginExchange email + password for a JWT (7-day TTL).
POST/api-keysJWTMint a developer key (pf_ + 48 hex chars).
GET/api-keysJWTList your keys.
DELETE/api-keys/:idJWTRevoke a key. Returns 204.
GET/v1/templatesx-api-keyThe public catalog — filter with ?category= and ?q=.
GET/v1/templates/:idx-api-keyOne template: dimensions, materials, finishes, dieline flag.