Docs Sign in Get a key

Docs / Platform

Libraries

The official Hapti libraries for JavaScript and Python. Retries, idempotency, live waiting, pagination and webhook signature checks built in.

The libraries wrap the API with the good habits built in: an idempotency key on every POST, retries of 429 and 5xx with a growing wait, live waiting through the stream, pagination and webhook checks.

JavaScript and TypeScript

Terminal
npm install hapti-sdk
JavaScript
import Hapti from 'hapti-sdk';

const hapti = new Hapti(process.env.HAPTI_KEY);
const task = await hapti.tasks.run(
  { url: 'https://portal.example.com', goal: 'Download my last statement.', user: 'customer_42' },
  { onWaiting: (pending) => askTheCustomer(pending.text), onStep: (s) => console.log(s.summary) },
);

It works in Node 18 and later, has no dependencies, and ships its TypeScript types.

Python

Terminal
pip install hapti
Python
from hapti import Hapti

hapti = Hapti()
task = hapti.tasks.run(
    {"url": "https://portal.example.com", "goal": "Download my last statement.", "user": "customer_42"},
    on_waiting=lambda pending, task: ask_the_customer(pending["text"]),
)

It has no dependencies and works with Python 3.9 and later.

Options

OptionJavaScriptPythonDefault
API keyfirst argumentfirst argumentHAPTI_API_KEY
Base addressbaseUrlbase_urlhttps://api.hapti.dev
Retriesretriesretries3
API versionversionversionyour pinned version

What they cover

AreaJavaScriptPython
Taskstasks.create, get, list, all, run, wait, stream, answer, approve, cancel, retry, estimate, proof, filetasks.create, get, list, all, run, wait, stream, answer, approve, cancel, retry, estimate, proof, file
Peopleusers.create, get, update, forget, putAccount, connectLink, giveMandate, setLimits, phoneusers.create, get, update, forget, put_account, connect_link, give_mandate, set_limits, phone
Webhookswebhooks.endpoints.*, webhooks.deliveries, Hapti.verifyWebhookwebhooks.endpoints.*, webhooks.deliveries, verify_webhook
EventseventLog.list, eventLog.all, events (live)webhooks.list_events, events (live)
Batches and schedulesbatches.*, schedules.*batches.*, schedules.*