API reference
Overview of the public v1 resources. The complete, machine-readable contract is the generated OpenAPI 3.1 document.
Resources
| Endpoint | Purpose |
|---|---|
| GET /v1/{accounts | contacts | leads | opportunities | campaigns | cases | tasks | products} | List with limit/cursor, q, filters (field=a,b; field.gte/lte/gt/lt=value) |
| POST /v1/{object} | Create (Idempotency-Key supported) |
| GET · PATCH · DELETE /v1/{object}/{id} | Read, update (If-Match: row_version), archive or delete |
| GET /v1/quotes · GET /v1/quotes/{id} · POST /v1/quotes | List and read quotes with lines and approvals; create a draft quote |
| GET /v1/orders · GET /v1/orders/{id} | Orders with lines, fulfillments, invoices and subscriptions (read-only) |
| GET /v1/invoices · GET /v1/invoices/{id} | Invoices with lines, allocations and credit notes (read-only) |
| GET /v1/meta/objects · GET /v1/pipelines | Field metadata with your permissions; pipelines and stages |
| POST /v1/leads/{id}/convert · POST /v1/opportunities/{id}/stage | Lead conversion (Idempotency-Key) and stage moves with entry criteria |
Example
curl https://<workspace>.enstride.app/api/v1/accounts?limit=50 \
-H "Authorization: Bearer $ENSTRIDE_API_KEY"
curl -X POST https://<workspace>.enstride.app/api/v1/accounts \
-H "Authorization: Bearer $ENSTRIDE_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: crm-sync-4711" \
-d '{"name":"Acme Corp","type":"customer"}'List responses have the shape { "data": [...], "has_more": true, "next_cursor": "..." }.
Webhooks
Each event is a POST with a JSON body { id, type, created_at, tenant_id, data: { object, id, record, details } }. data.record is a snapshot taken when the event is queued, filtered with the endpoint’s payload role (fields that role cannot read are omitted). Headers follow the Standard Webhooks convention:
webhook-id— the event id, identical across retries; use it to deduplicate.webhook-timestamp— Unix seconds when this attempt was signed.webhook-signature—v1,<base64 HMAC-SHA256>of"<id>.<timestamp>.<body>", keyed with the base64-decoded part of yourwhsec_secret. During a secret rotation the header holds two space-separated signatures; accept either.
Respond with any 2xx within 10 seconds. Other statuses, redirects (never followed) and timeouts are retried after about 30 s, 2 min, 10 min, 30 min, 1 h, 2 h, 4 h, 8 h and 8 h (10 attempts over roughly 24 hours). Endpoints that keep failing for 24 hours are disabled and administrators are notified; failed deliveries can be redelivered from Settings → Webhooks.
import { createHmac, timingSafeEqual } from 'node:crypto';
// secret: "whsec_..." from Settings → Webhooks; body: the raw request body string
export function verify(secret: string, headers: Record<string, string>, body: string): boolean {
const id = headers['webhook-id'], ts = Number(headers['webhook-timestamp']);
if (!id || !Number.isFinite(ts) || Math.abs(Date.now() / 1000 - ts) > 300) return false; // replay window
const key = Buffer.from(secret.slice('whsec_'.length), 'base64');
const expected = createHmac('sha256', key).update(`${id}.${ts}.${body}`).digest();
return (headers['webhook-signature'] ?? '').split(' ').some((part) => {
const [v, sig] = part.split(',');
const got = Buffer.from(sig ?? '', 'base64');
return v === 'v1' && got.length === expected.length && timingSafeEqual(got, expected);
});
}Event types
account.createdaccount.updatedcontact.createdcontact.updatedlead.createdlead.updatedlead.convertedopportunity.createdopportunity.updatedopportunity.stage_changedcase.createdcase.updatedtask.createdtask.updatedproduct.createdproduct.updatedproduct.publishedquote.acceptedquote.declinedorder.createdinvoice.postedpayment.recorded