Skip to main content

Integration Registry API

The Integration Registry provides HTTP endpoints for jobs, executions, steps, and logs. Use these endpoints for custom runtimes, configuration updates, or run-history queries. Node.js processes can use the Integration SDK for registration and reporting.

Use a PostgreSQL-backed deployment with the Integration Registry migrations applied. Running executions and storing secret settings require integration encryption keys. Confirm endpoint availability on the server you are targeting. Paths below are relative to that server's REST prefix, such as /v2/.

Authentication and permissions​

Send Authorization: Bearer <token> and Content-Type: application/json on every request, including GET. Deployment administrators have full Registry access. Other clients need an explicit $hkt_integration grant in the permission map, using an exact job key or * for all jobs. This scope covers cluster-wide jobs, so use the exact key when a client handles only one job. Realm grants and tenant membership are separate from Registry access.

CapabilityPermits
CRegister or update the job manifest.
RList and read jobs, health, masked configuration, executions, steps, and logs.
USet configuration values and enable or disable monitoring.
PStart, heartbeat, and complete executions, update steps, and write logs. Execution start returns the resolved configuration, including secret values.

This is a per claim for a worker that looks up and reports runs for one job, with no realm grants.

{
"$hkt_realm": "",
"$hkt_integration": {
"sample-readings": "RP"
}
}

For a self-managed deployment that signs HS256 API tokens, an administrator can use the server checkout's tools/create-api-token.js with --integration-permissions and an explicit --lifetime-seconds. The signing secret stays with the administrator. Give the worker only the scoped bearer token. See Authentication for the general token model.

Job and configuration endpoints​

Method and pathGrantInput or result
POST service/integration/job/CA body with manifest. Create or update by manifest.key and return the job.
GET service/integration/job/RList authorized jobs ordered by key. Optional key, afterKey, and limit.
GET service/integration/job/{jobId}RGet a job by UUID, including its manifest and revisions.
GET service/integration/job/{jobId}/configurationRRead the revision and saved field values. Each saved field reports configured, secret, and value. A secret's value is null.
PUT service/integration/job/{jobId}/configurationUMerge the values object and clear the fields named in unset.
PUT service/integration/job/{jobId}/monitoringUSet monitoringEnabled to a boolean.
GET service/integration/job/{jobId}/healthRGet one job's observed health, latest run, last outcomes, and statistics. Optional from and until.
GET service/integration/overviewRGet jobs and summary statistics. Optional key, kind, health, latest execution status, search, afterKey, limit, from, and until.

Configuration​

The preferred manifest schema is a closed JSON Schema object with type: "object", additionalProperties: false, and flat primitive properties. Use enum, default, root-level required, and optional annotations such as title, description, and $comment. If supplied, set $schema to https://json-schema.org/draft/2020-12/schema. Use x-hivekit-secret: true for a string secret without a default. The original field-map format with per-field required and secret is supported. The API rejects unsupported validation keywords, nested objects, arrays, and remote references.

A configuration update is atomic. For example, the following body sets one override and clears another, restoring its default if it has one.

{
"values": { "sourceUrl": "https://readings.example/api" },
"unset": ["includeArchived"]
}

Configure only fields from the manifest. Leave unrelated fields out of both inputs. Partial settings can be saved, but all required fields must resolve when an execution starts. A changed manifest advances manifestRevision and a non-empty configuration update advances configRevision. If existing values conflict with a proposed type, enum, or secret flag change, clear or replace the incompatible values before registering the new manifest. An execution receives a snapshot with both revisions and keeps the values resolved at its start.

Execution, step, and log endpoints​

Method and pathGrantInput or result
POST service/integration/job/{jobId}/execution/PStart a run with optional idempotencyKey, steps, and metadata. Returns execution and resolved configuration.
GET service/integration/job/{jobId}/execution/RList run history. Optional status, health, from, until, limit, and a paired beforeStartedAt and beforeId cursor.
GET service/integration/execution/{executionId}RGet run status, revisions, metadata, weighted progress, health, and duration.
POST service/integration/execution/{executionId}/heartbeatPRecord activity on a running execution.
POST service/integration/execution/{executionId}/completePSet status to succeeded or failed with an optional errorSummary.
GET service/integration/execution/{executionId}/step/RRead declared steps, ordered by key.
PUT service/integration/execution/{executionId}/step/{stepKey}PUpdate a declared step's status or progress. HTTP progress uses 0–100.
POST service/integration/execution/{executionId}/log/PAppend an atomic logs batch of 1–1,000 entries. Each entry has level and message, plus optional stepKey, details, and occurredAt.
GET service/integration/execution/{executionId}/log/RRead logs in ID order. Optional afterId, limit, level, and stepKey.

An execution start accepts up to 1,000 step definitions. Each definition needs a unique non-empty key, a non-empty name, and a positive finite weight stored to six decimal places. An equivalent retry with the same per-job idempotencyKey returns the same run and original configuration while that run is retained. Reusing the key for a different start request returns 409 when the server has the original request fingerprint. Use a new key for a new execution.

Keep the returned configuration in the runtime. Read-only execution endpoints omit it. A successful execution requires every step to be succeeded or skipped. A failed execution can retain unfinished steps. Equivalent terminal reports can be retried, and conflicting terminal changes return 409.

Log levels are debug, info, warn, and error. Messages must contain 1–16,384 UTF-8 bytes. Logs can arrive after the run finishes. Use the decimal-string log ID as the afterId cursor to preserve its precision. Timestamps use RFC 3339. The server records receivedAt separately from the supplied occurredAt, which defaults to receipt time. Retried log batches can duplicate messages.

Responses and pagination​

Successful resource requests return { "result": "success", "data": ... }. Log insertion returns { "res": "suc" }. Registry errors return { "result": "error", "message": "..." }. Common statuses are 400 for invalid input, 403 for missing capability, 404 for a missing or inaccessible resource, 409 for a conflict, and 503 for unavailable or invalid encryption keys.

Paginated reads accept limit from 1 to 1,000, with a default of 100. Use the last key, run start and ID, or log ID as the next cursor, depending on the endpoint. The overview response includes jobs, summary, hasMore, and nextAfterKey. For health and overview statistics, the time window defaults to the last 24 hours and can span up to 366 days. History and statistics reflect retained data, so keep separate archival records if your workflow requires them.