Skip to main content

SDK Contract

SDK Contract

SDKs must send tenant-bound, authenticated event payloads to the ingest API.

Tenancy and auth

  • Tenant is derived from the auth token company_slug claim.
  • companySlug in the payload is optional, but if present must match the token tenant.
  • SDKs send Authorization: Bearer <token> on ingestion calls.

Endpoints

  • POST /api/v1/events
  • POST /api/v1/events/batch

Batch responses include per-event results[]. A response with success: false means at least one event failed, and SDKs must surface the flush as failed after retaining the unsent batch for retry.

Measurement admin helpers

custd-sdk / custd-sdk-go v1.5.8 adds measurement project and observation helpers across TypeScript, Go, PHP, and Python. custd-sdk-go v1.5.9 adds the Go helpers used by the live measurement proof runner for import-run reads, calibration exercises, decision models, forecast runs, and decision simulations.

  • Create/list/get measurement projects through /api/v1/admin/measurement/projects.
  • Submit structured rows through /api/v1/admin/measurement/projects/{projectSlug}/observations:bulk.
  • Import CSV strings through /api/v1/admin/measurement/projects/{projectSlug}/observations:csv.

SDK helpers validate that measurement import responses contain one result per submitted row and that every successful row includes observationUuid; failed rows keep their RFC 9457 problem fields visible.