adaptlive
← Documentation

SDKs & Client Libraries

Generate a fully typed client from the adaptlive OpenAPI spec. The recommended TypeScript path uses hey-api — run one command against the live schema and get type-safe functions for every endpoint.

Generate from OpenAPI

Live spec

Always up to date at /api/v1/openapi.json.

Static snapshot

The repo also keeps a generated snapshot at apps/web/public/openapi.json.

Client Examples

Setup

npm install @hey-api/client-fetch
npm install -D @hey-api/openapi-ts

# Generate the typed SDK from the live spec
npx openapi-ts -i https://adaptlive.app/api/v1/openapi.json -o src/adaptlive -c @hey-api/client-fetch

Usage

import { client } from "./adaptlive/client.gen";
import { getWorkRecords, postPeopleUpsert } from "./adaptlive/sdk.gen";

// Configure once
client.setConfig({
  baseUrl: "https://adaptlive.app/api/v1",
  headers: {
    Authorization: `Bearer ${process.env.ADAPT_API_KEY}`,
  },
});

// Fully typed — params, response, and errors
const { data, error } = await getWorkRecords({
  query: { limit: 50 },
});

if (error) throw new Error(error.error.message);
console.log(data.data);

// Create or update a person by phone
const { data: person } = await postPeopleUpsert({
  body: {
    primaryPhone: "+15125551234",
    firstName: "Jane",
    lastName: "Doe",
  },
});

Production Guidance

  • Keep API keys on your server; never ship them to browsers or mobile apps.
  • Honor 429 responses and retry with backoff.
  • Use Idempotency-Key on mutating requests.
  • Re-run npx openapi-ts when the API spec changes to pick up new endpoints.
Quickstart GuideAPI Reference

We use essential cookies to keep the app secure. Optional cookies help us improve reliability and measure campaigns. Cookie policy