Managed Content Sync

Preview and apply a versioned release of public knowledge, the AI system prompt, and visitor quick actions from an authorized external program.

Create a narrowly scoped token

Open API in the workspace sidebar, name a token, and choose the Content synchronization preset. It selects the knowledge, AI-settings, widget-settings, and release scopes needed for the complete workflow. The token belongs only to this workspace.

Doorwick shows the dw_… value once. Put it in your secret manager and provide it to the client as DOORWICK_API_TOKEN or through standard input. It is never recoverable from the page.

Never put the bearer in a manifest, command-line argument, browser bundle, or repository.

Describe one managed collection

A manifest uses a stable managed_collection and one external_key per source. Those identifiers let later releases update or restore the same rows instead of creating duplicates. URL sources are fetched through Doorwick's public-address safety checks; markdown is sent directly.

content-manifest.json
{
  "schema_version": 2,
  "release_id": "public-docs-2026-08-29.1",
  "managed_collection": "public-product-docs",
  "source_revision": "documentation-release-42",
  "retire_missing": false,
  "sources": [
    {
      "external_key": "pricing",
      "kind": "url",
      "title": "Pricing",
      "url": "https://example.com/pricing",
      "required": true,
      "refresh_interval_minutes": 1440
    },
    {
      "external_key": "commercial-facts",
      "kind": "markdown",
      "title": "Current commercial facts",
      "content": "Current, dated public facts.",
      "required": true
    }
  ],
  "ai_settings": {
    "system_prompt": "Answer from current public documentation and do not guess.",
    "brand_summary": "Example Co provides approved home products and support."
  },
  "widget_settings": {
    "quick_actions": [
      { "id": "start", "type": "link", "label": "Get started", "url": "https://example.com/start", "enabled": true }
    ]
  },
  "verification": {
    "required_phrases": ["current public facts"],
    "forbidden_phrases": ["retired plan"],
    "test_questions": [
      { "question": "What are the current commercial facts?", "expected_source_keys": ["commercial-facts"] }
    ]
  }
}

Doorwick recomputes content hashes, rejects duplicate keys and unsupported fields, bounds source count and markdown size, and validates quick actions with the same rules as the owner dashboard.

Preview first, then apply

The maintained client previews by default:

terminal
DOORWICK_API_TOKEN=... bin/doorwick-content-sync \
  --base-url https://chat.example.com \
  --manifest /secure/path/content-manifest.json

Review its create, update, reindex, unchanged, restore, retire, prompt, and quick-action actions. Preview does not create a source or run. It returns a short-lived signed token bound to this workspace, token, manifest digest, and current content revision.

Run POST /v1/ai_readiness_probes for chat and embeddings before the first release. Add --apply to preview and stage that exact result. Save and pass an explicit --idempotency-key when an interrupted apply must be retried with the same identity. Doorwick fetches, indexes, verifies phrases and test questions, then atomically activates knowledge, AI guidance, and quick actions. Until then the previous release remains live. If an owner or another client changes managed content after preview, Doorwick returns 409 instead of overwriting it.

Run history is cursor-paginated. Subscribe to content_sync.succeeded, content_sync.partially_failed, and content_sync.failed webhooks when your client prefers a signed completion callback over polling.

A failed, non-activated run can resume through POST /v1/content_sync_runs/:id/retry_attempts; only failed items are reset. Use GET /v1/knowledge_readiness for provider, embedding, indexed-source, latest-release, retry, and capacity status. Use POST /v1/knowledge_reindexings for a bounded failed-only recovery.

Retirement is explicit

retire_missing: false
The default. A source omitted from the list remains untouched.
retire_missing: true
Preview lists retire actions only for active sources in the same managed collection.
Manual sources
Never changed or retired by a manifest.

Retirement preserves history but removes the source from answers. Restoring the same external key reuses its existing record deterministically.

Read serving and freshness separately

Serving means Doorwick has a usable last-known-good index. Refresh tells you whether a newer check is queued, running, successful, or failed. Last checked and last successfully indexed are shown separately, along with current, overdue, stale, or unknown freshness.

A failed refresh does not discard a healthy earlier index. Doorwick keeps those chunks available, marks the refresh failed, and never claims the old content is current. Unchanged URL text skips another embeddings call. Required-source or phrase verification failure makes the run fail; optional-source failure is partially_failed.

Rotate or revoke access

Create a replacement token, update the client's secret, verify a preview, then revoke the old token from the API page. Revocation takes effect on its next request. Existing run history keeps release identifiers, hashes, actions, timing, and bounded errors—not bearer tokens, manifests, prompts, or source bodies.

Next