Skip to main content

Native API and JSON:API migration

Use the native operation API for Hypermeter reads and commands. The public JSON:API resource and relationship endpoints and the Atomic endpoint are removed, without a compatibility route. External integrations must migrate.

JSON:API documents, include, sparse fieldsets, relationship URLs, and Atomic local IDs have no public replacement. Changing only the media type or URL does not migrate a request.

Migrate an integration​

  1. List the operations available to your caller.
  2. Read the input, result, scope, and delegation contract of each operation you need.
  3. Replace resource envelopes and relationship traversal with those inputs and results.
  4. Keep your organization, Task, and mutation identities explicit.
  5. Handle command receipts and uncertain outcomes before you submit another change.

If no offered operation covers an old request, your caller has no supported replacement. Use the web app where an operation requires a person, not retired URLs or undocumented endpoints.

Each operation keeps its own publication and support status. See Public API support.

Discover operations and schemas​

Use these authenticated endpoints on your Hypermeter API origin:

RequestResult
GET /api/v1/operationsThe operation catalog for your caller type.
GET /api/v1/operations/openapi.jsonOpenAPI 3.1 for those operations.
POST /api/v1/operations/{transportName}Invoke one operation with its declared input.

The catalog supplies id, revision, transportName, input and output schemas, effects, and delegation rules. Use the literal transportName in the URL. An operation ID can contain dots, and its transport name uses underscores: charging_rule.list goes to /api/v1/operations/charging_rule_list.

curl --fail --silent --show-error \
-H "Authorization: Bearer $HYPER_ACCESS_TOKEN" \
-H "Accept: application/json" \
"$HYPERMETER_API_ORIGIN/api/v1/operations/openapi.json" \
-o operations-openapi.json
  • Send credentials only to a trusted API origin, not to the documentation site unless it is also your API deployment.
  • The catalog is not proof of permission. Every call checks current access.
  • Use the catalog returned for your caller and deployment, not the former resource OpenAPI inventory.

Use the existing CLI​

hyper discovers operations and validates their contracts. Sign in and get Task access as described in The hyper command-line tool. Then inspect and call an operation:

hyper op list
hyper op describe charging_rule.list
hyper op call charging_rule.list \
--tenant <tenant-id> --task <task-id> \
--input '{"projection":"rich","page_number":1,"page_size":25}' --json
  • --tenant and --task are routing options, separate from --input. Use the IDs of your organization and approved Task.
  • Machine mode offers only published operations that are eligible for machines.
  • A delegate grant does not open human-only operations.

Call an operation from code​

This TypeScript example reads a rich charging-rule page with approved delegate access. The operation ID, transport name, and input come from the catalog.

const operationId = 'charging_rule.list';
const transportName = 'charging_rule_list';

export async function listChargingRules(
apiOrigin: string,
tenantId: string,
taskId: string,
accessToken: string,
signal: AbortSignal,
) {
const input = {
projection: 'rich',
page_number: 1,
page_size: 25,
};

const url = new URL(`/api/v1/operations/${transportName}`, apiOrigin);
const response = await fetch(url, {
method: 'POST',
headers: {
Authorization: `Bearer ${accessToken}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
signal,
body: JSON.stringify({ tenant_id: tenantId, task_id: taskId, input }),
});

if (response.status === 401 ||
(response.status === 403 &&
/insufficient_scope/.test(response.headers.get('www-authenticate') ?? ''))) {
throw new Error('Authentication or token scope was refused.');
}
const envelope = await response.json();
if (envelope?.status === 'failed') throw new Error(envelope.error.code);
if (!response.ok || envelope?.status !== 'completed' ||
envelope.operation?.id !== operationId || envelope.result_kind !== 'output') {
throw new Error('Unexpected charging-rule result.');
}
return envelope.result;
}
  • Pass your cancellation signal and the tenant and Task that your grant covers.
  • Validate the input and envelope.result against the catalog schemas.
  • This read sends no mutation ID and does not retry. For writes, use a client with command identity and receipt recovery, such as hyper. Do not resend a command after a schema validation failure.

Request and response headers​

Send Content-Type: application/json for operation calls and Accept: application/json for native results. Put arguments under input, with the call scope outside it:

{
"tenant_id": "12345678-1234-4234-8234-123456789abc",
"task_id": "23456789-2345-4234-8234-23456789abcd",
"input": { "projection": "rich", "page_number": 1, "page_size": 25 }
}

Tenant operations require tenant_id on every call. Account operations do not use it. An account-or-tenant operation follows its declared scope.

Browser calls require the current browser session and CSRF token, and send x-csrf-token and X-Hypermeter-Contract-Digest from the matching selected contract. Do not use a browser session as a delegate bearer token.

Native results use an operation envelope, not data.attributes or included. Check status and the operation identity first:

Status or result kindWhat to do
completedRead result_kind before decoding the result.
acceptedKeep the returned run handle and observe its declared status operation.
input_requiredComplete the declared interaction through its supported owner flow.
failedBranch on error.code and follow its remediation.
outputValidate result against the selected output schema.
acknowledgementValidate the compact acknowledgement, then use its declared read target if present.
committed_not_visibleThe change committed, but no result is visible to your current authority. Do not resend it.

An authentication challenge can arrive without an operation envelope. Handle the HTTP status and the WWW-Authenticate challenge first.

Recover an uncertain command​

A mutation needs one UUIDv7 mutation_id. When delivery becomes uncertain, keep the original ID, operation, tenant, Task, and arguments. The same ID cannot name a different change.

hyper records the command identity before delivery and blocks another unresolved command for the same operation and scope. To observe the receipt:

hyper journal reconcile
  • Reconciliation does not resend the mutation. receipt.get observes the original identity under current authority.
  • A missing or hidden receipt does not prove failure.
  • An acknowledgement can prove the commit without the full output. Follow its declared read target before you edit again.
  • A timeout, canceled request, broken connection, or invalid response does not prove a rollback. Do not retry a write with a new mutation ID.

Replace an Atomic batch​

The native API has no general batch executor and no replacement for arbitrary resource relationships. Separate calls do not share a transaction, even with the same Task, so sequential writes are not all-or-nothing.

Some commands define a complete transaction for one task, for example tenant.invitation.create and cube.producer.create. These two require an authorized human browser session, so they do not replace a batch for a delegate or machine.

Use such a command only when its declared behavior matches your task. Otherwise, redesign the integration.

Map resource reads to declared operations​

These operations are starting points. They do not reproduce resource documents, include, fieldsets, relationship traversal, or resource filters.

Former resource needExisting operation contracts
Workflow catalog and detailworkflow.list, workflow.get
Working Draft read, edit or discardworkflow.draft.get, workflow.draft.update, workflow.draft.discard
Cube catalog and detailcube.list, cube.get
Space catalog and detailspace.list, space.get
Reusable instruction catalog and detailinstruction.list, instruction.get
Semantic definition catalog and detailfield.list, field.get
Schedule readsschedule.list, schedule.get
Input Group readsinput_group.list, input_group.get
Charging Rulescharging_rule.list, charging_rule.get, and the declared authoring commands
Run statusrun.get
  • Use only the filters and pagination that an operation declares.
  • For a pinned Run and Attempt, keep both IDs. Without an Attempt ID you do not necessarily get the same Attempt.
  • run.attempt.get, membership management, and Attention operations are human-only. Use the web app when discovery does not offer an operation, even if you know its ID.

Replace If-Match conditional writes​

The retired resource API accepted an optional If-Match header. A native command that supports a conditional write declares the expected version in its own input. A command without such a field has no conditional form.

For schedules, schedule.update, schedule.delete, schedule.switch_on, and schedule.switch_off accept an optional expected_updated_at. Send the updated_at from your last read. If the schedule changed since then, the command returns STATE_CONFLICT and changes nothing: read the schedule again, then send the corrected change with a new mutation ID.

Without expected_updated_at, the command does not check the version and can overwrite a change made after your read.

Error identity​

  • Use the native error.code to select an error class. Do not branch on a translated message.
  • Read error.field_issues, when present, for validation paths, codes, and safe messages.
  • For support, keep the original request and command identity, without credentials or secret values.

Report preparation and cancellation​

The timeout of a saved-view report also stops its source-data discovery and retention requests. A canceled or expired request acquires no more source data, but cleanup of reserved data can finish later. A timeout does not change the saved view or its filters.

Protocol responses​

These endpoints keep their own response contracts and media types. Do not decode them as resource documents.

EndpointResponse
Authentication (browser session)Login and callback: 302 redirect. Session inspection: 200. Successful refresh and logout: 201. Unsuccessful refresh: 401 with anonymous session JSON. Logout returns redirectTo after it revokes the session. These routes refuse a bearer credential, even with a session cookie. Delegates read their identity through the session.get operation.
Event streams (SSE)A ticket denial or immediate subscription denial returns the shared error document with the matching HTTP status. A subscription access denial returns 403. After the SSE headers, a failure sends a native error event and closes the stream, also before the first data event. No second JSON error follows.
DownloadsCan return an application error before output starts. Handle interruptions through the download protocol.
Explorer CSV/TSV exportsThe completed file with its media type, byte length, and no-store cache policy. CSV downloads have an attachment filename.
Preview artifactsThe source MIME type, or octet-stream as a fallback.
Retained production source downloadsOctet-stream attachments with non-executable content headers.
Catalog imagesimage/png with an ETag. Send it in If-None-Match to get 304 without a body when the image is unchanged.
ReadinessA JSON state map: 200 when ready, 503 when a required dependency is unknown or down. Ready does not guarantee that every request succeeds.
Telemetry204 for an empty or default collector success. Other successful replies keep their status and body.
Cube proxyEach attempt has a deadline for the complete upstream response, including the wait for a connection. More response bytes do not extend it. After the retry allowance, expiry returns 504 if output has not started. Otherwise the connection closes: treat an incomplete response as failed.
Report proxyRequests use the structured query wrapper, with optional queryType and cache. The published description lists the supported fields and bounds. Query and authorization checks still apply. Success is native Cube JSON with the upstream status, normally 200. Upstream protocol errors and native adaptation errors keep their format.