Reference

REST API.

Mounted at /api/v1 on the local daemon. Resources are addressed by logical IDs, never absolute paths. Mutations require an idempotency key, a revision precondition, and — where policy says so — an approval bound to an exact preview.

Base and authentication

text
http://127.0.0.1:8765/api/v1

local browser:  intralock_session cookie (HTTP-only, SameSite)
programmatic:   Authorization: Bearer ilk_…
                scoped to actor + workspace + capabilities + expiry

Loopback binding is not authentication. The server checks Origin, session, capability, scope, and object version on every mutating request. A missing or invalid credential returns 401; a valid credential without the capability returns 403 without revealing whether the object exists.

Routes

Method & pathPurposeAuth
GET /healthDaemon, catalog, watcher, extract healthnone (local)
GET /api/v1/workspacesList registered workspacessession
POST /api/v1/workspacesRegister a directorysession + capability
GET /api/v1/workspaces/{id}Workspace detail and freshnesssession
GET /api/v1/objects/{id}Object metadata, provenance, edgessession
GET /api/v1/objects/{id}/contentAuthorized content, bounded rangesession
GET /api/v1/searchFull-text search, permission-filteredsession
POST /api/v1/graph/queryTyped, bounded traversalsession
POST /api/v1/context/bundlesBudgeted context assemblysession
GET /api/v1/capabilitiesCapability registry for the callersession
POST /api/v1/tasksStart durable async worksession + capability
GET /api/v1/tasks/{id}Task state, progress, outcomesession
POST /api/v1/changes/previewThree-way diff; no writesession + capability
POST /api/v1/changes/applyApproved, versioned writeapproval + capability
POST /api/v1/backupsConsistent backupsession + capability
GET /api/v1/auditLedger entries and receiptssession
http
GET /api/v1/search?query=architecture&workspace_id=wks_01JEX&limit=10
Accept: application/json

{
  "results": [
    {
      "object_id": "obj_01J9F2",
      "version": "sha256:8b708e8a…",
      "title": "workspace-architecture.md",
      "kind": "document",
      "score": 0.82,
      "freshness": { "indexed_at": "2026-11-09T12:31:02Z", "lag_seconds": 12 },
      "provenance": "observed"
    }
  ],
  "next_cursor": "eyJvZmZzZXQiOjEwfQ"
}

The response never includes a hidden object, a hidden count, or an excluded path. If the catalog lags, lag_seconds is reported rather than silently presenting the result as current.

Writes: preview, then apply

http
POST /api/v1/changes/preview
Idempotency-Key: 0f3c2a9e-…
Content-Type: application/json

{
  "workspace_id": "wks_01JEX",
  "operation": "homepage.publish",
  "targets": ["obj_01J9F2"],
  "expected_versions": { "obj_01J9F2": "sha256:8b708e8a…" }
}

→ 200 with preview hash, diff, warnings
→ approval_id (if human approval required)

POST /changes/apply requires the approval bound to that preview hash. If any precondition changed, the approval is stale and the server returns 409 with conflict_version — it does not apply a partial write.

Problem details

json
{
  "code": "conflict",
  "message": "Object changed since preview.",
  "request_id": "req_01JEX7",
  "conflict_version": "sha256:9c1d…",
  "retry_after": null,
  "approval_request_id": null,
  "field_errors": []
}
CodeHTTPClient action
validation_failed400Fix fields; re-read field_errors.
unauthorized401Re-authenticate; do not retry blindly.
forbidden403Request a narrower capability or stop.
not_found404Resolve by ID, not path.
conflict409Re-preview against the new version.
approval_required428Route to an authenticated human surface.
rate_limited429Honor retry_after.
unavailable503Daemon not ready; retry with backoff.

Contract rules

  • Writes require Idempotency-Key; a replay returns the prior receipt instead of applying again.
  • Writes use If-Match or an explicit expected version; a mismatch is a conflict, not a last-writer-wins.
  • Unknown fields are rejected on security-sensitive mutations; reads may be liberal where documented.
  • Breaking changes are versioned by route or media type, with a machine-readable compatibility table.
  • No direct source-file write endpoint exists before safe mutation and rollback are proven.

OpenAPI

yamlopenapi.json (excerpt)
openapi: 3.1.0
info:
  title: Intralock Local API
  version: 1.0.0
paths:
  /api/v1/search:
    get:
      operationId: searchWorkspace
      security: [{ localSession: [] }]
      parameters:
        - { name: query, in: query, required: true,
            schema: { type: string, minLength: 1 } }
        - { name: workspace_id, in: query, required: true,
            schema: { type: string } }
      responses:
        '200': { description: Permission-filtered results }
        '403': { description: Not authorized for this workspace }