REST API

Base URL: https://clickbase.thepakclicktes.com/v1/{projectId}. All responses are JSON: { ok: true, … } or { ok: false, error: { code, message } }. Send X-API-Key on every request and Authorization: Bearer <accessToken> for user requests. CORS is enabled for configured origins (* by default).

Auth

Method & pathBodyResponse
POST /auth/signup{email, password, displayName?, photoURL?, phone?, meta?}{user, accessToken, refreshToken, expiresIn}
POST /auth/login{email, password}same
POST /auth/refresh{refreshToken}same (rotated)
POST /auth/logout{refreshToken, all?}{}
GET /auth/me—{user}
PATCH /auth/me{displayName?, photoURL?, phone?, meta?, password?, currentPassword?}{user}
DELETE /auth/me—{}
POST /auth/send-verify—{}
POST /auth/verify{code}{}
POST /auth/forgot{email}{}
POST /auth/reset{email, code, password}{}
POST /auth/google{idToken}tokens

Database

Method & pathNotes
GET /db/{col}query: where (JSON array of [field,op,value]) or field=value / field[op]=value (op: ne,gt,gte,lt,lte,in,contains,like,startsWith), orderBy, dir, limit, offset, page → {docs,total,hasMore}
POST /db/{col}{data:{…}, id?} → {doc} · or {batch:[…]} → {results}
GET /db/{col}/{id}{doc}
PUT /db/{col}/{id}{data} replace (creates if missing) → {doc}
PATCH /db/{col}/{id}{data?, increment?:{field:n}} merge → {doc}
DELETE /db/{col}/{id}{}

Realtime, Files, Admin

See Realtime, Storage, Server / Admin.

curl examples

# sign up
curl -X POST https://clickbase.thepakclicktes.com/v1/my-shop/auth/signup -H "X-API-Key: cb_pk_…" -H "Content-Type: application/json" \
  -d '{"email":"a@b.com","password":"secret1"}'

# create doc as that user
curl -X POST https://clickbase.thepakclicktes.com/v1/my-shop/db/orders -H "X-API-Key: cb_pk_…" -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" -d '{"data":{"item":"Chai","qty":1}}'

# query
curl "https://clickbase.thepakclicktes.com/v1/my-shop/db/orders?qty[gte]=1&orderBy=createdAt&dir=desc" -H "X-API-Key: cb_pk_…" -H "Authorization: Bearer $TOKEN"

PHP example (server, secret key)

<?php
function cb($method, $path, $body = null) {
  $ch = curl_init("https://clickbase.thepakclicktes.com/v1/my-shop" . $path);
  curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => $method,
    CURLOPT_HTTPHEADER => ["X-API-Key: cb_sk_SECRET", "Content-Type: application/json"],
    CURLOPT_POSTFIELDS => $body ? json_encode($body) : null]);
  return json_decode(curl_exec($ch), true);
}
$r = cb("POST", "/db/orders", ["data" => ["item" => "Chai"], "owner" => "someUid"]);
$list = cb("GET", "/db/orders?limit=10");

Was this page helpful? Tell us. · Download SDK