Quickstart

From zero to your first call.

A guided 5-step walkthrough. Install, authenticate, call the API, handle errors, and receive your first webhook — in about 10 minutes.

What you'll build

By the end of this quickstart you'll have an authenticated request working against the CHeKT API and (optionally) a webhook endpoint receiving live events. The same building blocks scale up to any integration you'll build later — there's no "tutorial-only" shortcut here.

Client credentialsclient_id + client_secret stored safely in your secret manager.
A working callGET /partner/v1/dealers/{dealerId}/sites returning real data.
An SDK exampleYour language of choice with auto-refreshing access tokens.
A live receiverExpress, Flask, or Go handler that verifies signed events.

The arc at a glance

Five steps from a fresh terminal to a working integration.

Youdeveloper machine
CHeKTapi.chekt.com
Your serverwebhook endpoint
  1. 01
    YouYou
    Set client credentialsCHEKT_CLIENT_ID, CHEKT_CLIENT_SECRET, CHEKT_DEALER_ID
  2. 02
    YouYou
    Install an SDKOptional — curl works fine too
  3. 03
    YouCHeKT
    Exchange for access tokenPOST /oauth/token
  4. 04
    YouCHeKT
    First authenticated callGET /partner/v1/dealers/{dealerId}/sites
  5. 05
    CHeKTYou
    Handle 2xx / 4xxInspect the response body, retry with x-partner-trace-id
  6. 06
    CHeKTYour server
    Receive your first webhookPOST + HMAC signature
Figure 1. From key setup through your first webhook — the path you'll walk in this quickstart.

1 Set up your shell environment

Every CHeKT request authenticates with your app's API key sent as a Bearer token. Store it as an environment variable so you don't paste it into commands (which ends up in your shell history). Pick your shell:

shell
# Add to ~/.bashrc or ~/.zshrc
export CHEKT_CLIENT_ID='your-client-id'
export CHEKT_CLIENT_SECRET='your-client-secret'
export CHEKT_DEALER_ID='your-dealer-id'

# Confirm they're set
echo $CHEKT_CLIENT_ID $CHEKT_DEALER_ID

2 Install an SDK (optional)

You don't need an SDK — curl works fine for everything. But if you're shipping a real app, the typed SDK gives you autocomplete, schema validation, and built-in retries with exponential backoff.

terminal
npm install @chekt/sdk

3 Make your first call

List the devices on your dealer. A successful response confirms auth, permissions, and connectivity all work end-to-end. Pick your language:

terminal
# 1) Exchange client credentials for an access token
ACCESS_TOKEN=$(
  curl -s -X POST https://api.chekt.com/oauth/token \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -d "grant_type=client_credentials" \
    -d "client_id=${CHEKT_CLIENT_ID}" \
    -d "client_secret=${CHEKT_CLIENT_SECRET}" \
    | jq -r .access_token
)

# 2) List the sites under your dealer
curl https://api.chekt.com/partner/v1/dealers/${CHEKT_DEALER_ID}/sites \
  -H "Authorization: Bearer ${ACCESS_TOKEN}" \
  -H "x-partner-trace-id: $(uuidgen)"

Success looks like this:

response
{
  "data": [
    {
      "id": "dev_8h2j3kfm",
      "type": "camera",
      "name": "Main Entrance",
      "site_id": "site_29snd",
      "status": "online",
      "firmware": "2.14.1",
      "last_seen_at": "2026-05-26T10:21:34Z"
    }
  ],
  "has_more": false,
  "next_cursor": null
}

4 Handle the common errors

Most first-call problems fall into one of four buckets. Skim them now — you'll recognise them faster when something goes sideways at 3am.

401invalid_token / expired_token

Access token missing, malformed, or past its expires_in. Re-exchange your client_id and client_secret at /oauth/token and retry.

403Forbidden

Token is valid but lacks scope for this dealer or resource. Confirm the dealer is connected to your account, or that your Dealer app has access.

404Wrong path or resource ID

All endpoints live under https://api.chekt.com/partner/v1/. Don't forget the /partner/v1/ prefix, and double-check dealerId / siteId values in the URL.

400Bad Request

Failed validation — missing required field or wrong type. The response body names the failed field; fix and retry.

See the full error reference for every stable error code and the right way to handle each.

5 Listen for events

The REST API gets you pull. Webhooks give you push. Register a public HTTPS endpoint in your app's settings, subscribe to the event types you care about, and CHeKT will POST signed payloads to your endpoint in real time.

Here's a minimal receiver with HMAC signature verification:

server.ts
import express from "express";
import crypto from "crypto";

const app = express();

app.post(
  "/webhooks/chekt",
  express.raw({ type: "application/json" }),
  (req, res) => {
    const sig = req.headers["x-chekt-signature"] as string;
    const ts  = req.headers["x-chekt-timestamp"] as string;
    const signed = `${ts}.${req.body.toString("utf8")}`;

    const expected = crypto
      .createHmac("sha256", process.env.CHEKT_WEBHOOK_SECRET!)
      .update(signed)
      .digest("hex");

    if (!crypto.timingSafeEqual(
      Buffer.from(sig, "hex"),
      Buffer.from(expected, "hex"),
    )) return res.status(401).end();

    const event = JSON.parse(req.body.toString("utf8"));
    console.log(`Got ${event.type}`);
    res.sendStatus(200);
  },
);

app.listen(3000);

You're done.

You've authenticated, called the API, handled errors, and received a webhook. That's the complete loop — every CHeKT integration is variations on this pattern. Pick where to go next: