Skip to main content

Integrate one structured workload

Your application decides what success and failure mean; Kam maintains the history of what it accepts.

Implemented in sourceReviewed 2026-10-07 · prelaunchRead this guide as Markdown
Guide context

Keep your agent and business rules. Send explicit completed outcomes through the repository-local SDK.

Your application sends Kam small structured results: what happened, to which thing, when, and whether it succeeded. Kam keeps every version of those results so you can read back exactly what was recorded.

On this page · 4 sections

One complete request and read

  1. Authorize

    Evaluation endpoint and scoped identity required.

  2. Record

    Submit an outcome; retry the same identity.

  3. Read exactly

    Correct it, then request both retained revisions.

Send identity, time, and a declared result#

Supply ID, subject, type, occurrence time, status, category, and optional source references. Revision defaults to 1. The server resolves the authorized tenant; a supplied tenant ID is not authorization by itself.

Only success and failure are accepted. Do not convert pending, cancelled, or unknown results into failure just to fit the API. Occurrence time must be canonical UTC, not in the future, and within the working window.

Choose the read that matches your question#

  1. outcome()

    Record a result, retry the exact same payload, or supply the next correction revision.

  2. allIds() → byIds()

    Browse a pinned UTC-day collection, then retrieve its exact revision references. Keep generation and cursor together.

  3. trajectory()

    Read precomputed last-ten and 30/90-day comparisons, with freshness and pending-work information.

  4. history() / why()

    Inspect accepted-revision history or a deterministic explanation of calculated values. why() is not causal investigation.

  5. deliveryStatus()

    Read metadata-only delivery counts, coverage, and oldest unfinished work. It does not return memory content.

Bind a scope once; preserve the returned references#

SDK 0.36.0 provides state({ subjectId, type }) (scope() is the same adapter) as a thin layer over the same API. It cannot override its bound subject or type and does not create a second state engine. Use the exact approved package or authorized source checkout; there is no public npm release.

Read one bounded page using the existing SDK candidate
// Save as a .mjs file in an authorized backend source checkout. SDK candidate 0.36.0.
// This is a read-only example, not code executed by the website.
import { createKamClient } from './server/trajectory/sdk/index.mjs';
const kam = createKamClient({
  baseUrl: process.env.KAM_API_URL,
  tenantId: process.env.KAM_TENANT_ID,
  accessToken: () => process.env.KAM_ACCESS_TOKEN,
});
const deployments = kam.scope({ subjectId: 'checkout', type: 'deployment' });
const page = await deployments.allIds({ day: '2026-10-06', limit: 16 });
if (page.status === 'ready' && page.items.length > 0) {
  const exact = await deployments.byIds({
    day: page.day,
    generation: page.generation,
    refs: page.items,
  });
  console.log(exact.records); // Keep every position and result status.
}
// A short page is not the end when nextCursor is present.
// Continue with the SAME generation and returned cursor.

Authorize the destination separately#

A subscription does not grant access to a customer AWS account. Server-owned bindings select the approved Region, memory, strategy, and namespace. Background jobs do not retain a browser JWT.

Agent-readable documentation manifest