Guide for developers

Chronosfy API — how to start with Node.js

Node 22 already get fetch. Set CHRONOSFY_AUTH to API key wey get di right scope or JWT from POST /auth/login.
const BASE = 'https://chronosfy.com/api';
const authorization = process.env.CHRONOSFY_AUTH;
async function create(path, body, key) {
  const response = await fetch(BASE + path, { method: 'POST',
    headers: { Authorization: authorization, 'Content-Type': 'application/json', 'Idempotency-Key': key },
    body: JSON.stringify(body) });
  const result = await response.json();
  if (!response.ok) throw new Error(JSON.stringify(result));
  return result;
}
const person = await create('/crm/persons', {"name":"Alice","email":"[email protected]","external_id":"customer-42","metadata":{"source":"integration"}}, 'person:customer-42:v1');
const action = await create('/actions', {"name":"Monthly reminder","type":"email","template":{"subject":"Reminder","body_html":"<p>Hello</p>"}}, 'action:reminder:v1');
const recurrence = await create('/recurrences', { ...{"name":"Monthly reminder","subject_type":"person","frequency_config":{"type":"monthly","day":31,"time":"09:00","timezone":"Europe/London"},"client_reference":"subscription-42"},
  action_id: action.id, subject_id: person.id }, 'recurrence:subscription-42:v1');
Use API key wey get di right permissions or JWT from POST /auth/login. Keep one key for each logical request, even after timeout or restart. If you change di payload but use di same key, you go get 409. Creation keys na optional for people, actions and schedules wey dey repeat. Payment links need dem. MCP dey use request_key. external_id must dey unique among active people for one tenant. More than one business record fit share di same client_reference. For one-time purchases, agreement to pay regularly, or to save card only, see /docs/quickstart/checkout for di hosted URL and embedded SDK. To use Stripe Elements directly, set up verified PSP and use /payment/setup-intent with Stripe.js. Checkout fit save card with save_payment_method. first_run_at dey set di earliest time di automatic schedule fit run. See /docs/quickstart/renewals for all di HTTP/MCP steps, permissions and how to recover. If you get 502 or you no know di result, use di original key again. No create another payment ID for di same payment.