Palace Ingest, Capture, And Source Workflows

Source basis: Palace of Truth backend/app/main.py, backend/app/api/ingest.py, backend/app/api/capture.py, backend/app/api/web_saves.py, backend/app/api/feeds.py, backend/app/api/source_subscriptions.py, backend/app/api/jobs.py, backend/app/api/palace.py, backend/app/schemas/ingest.py, backend/app/schemas/feed.py, backend/app/schemas/source_subscription.py, backend/app/services/palace.py, backend/app/pipelines/webpage.py, backend/app/pipelines/youtube.py, docs/source-subscriptions.md, and extension/README.md, last reviewed for this landing surface on July 9, 2026.

This guide separates current public workflows from compatibility aliases, operator-only surfaces, and deferred ideas. Use generated OpenAPI at /api/openapi.json for exact schemas in a running Palace environment.

Current Workflow Map

WorkflowCurrent public route familyStatusNotes
NotesPOST /api/v1/ingest/noteSupportedAccepts a title, content, optional tags, optional webhook URL, and optional model override.
WebpagesPOST /api/v1/ingest/webpageSupportedAccepts an HTTP(S) URL and queues webpage processing. Duplicate active URLs return a conflict instead of creating another item.
Media linksPOST /api/v1/ingest/mediaSupportedQueues audio/video URL processing through the media pipeline. YouTube URLs are media ingest, not a separate current workflow. Operators can choose OpenAI, AssemblyAI, or local WhisperX transcription providers.
Documents and PDFsPOST /api/v1/ingest/docSupportedUploads .pdf, .docx, .xlsx, .md, or .txt; extracts text before queueing work so extraction failures do not leave orphaned jobs.
ImagesPOST /api/v1/ingest/imageSupportedUploads .jpg, .jpeg, .png, .gif, or .webp; analyzes image content before queueing the ingest job.
Batch ingestPOST /api/v1/ingest/batchSupported for notes, webpages, media, and legacy youtube item typeAccepts up to 100 entries. It does not upload binary docs or images.
Browser capturePOST /api/v1/capture/browserSupportedThe extension sends one capture contract; Palace resolves it to note, media, social post, or webpage capture.
Saved web lookupGET /api/v1/web-saves and PATCH /api/v1/web-saves/{web_save_id}SupportedUsed to list active saved URLs, identify duplicate saves, filter by capture kind or tag, and archive or restore a saved-web record.
RSS feeds/api/v1/feedsSupportedCreate, list, edit, poll, enable, disable, soft-delete, restore, list items, and import OPML.
OPML importPOST /api/v1/feeds/import_opmlSupportedUploads an OPML file and creates missing RSS feed records; newly created feeds are queued for immediate polling.
YouTube channel subscriptions/api/v1/source-subscriptionsSupported v1 providerOnly youtube_channel subscriptions are supported in v1. Preview before create, manually sync, list entries, and retry failed entries.
Job visibility and retry/api/v1/jobsSupportedList, read, cancel, and retry ingest jobs that are visible to the authenticated tenant or capture token.
Palace sync sources/api/v1/palace/sync-sources and /api/v1/palace/sync-runsOperator/API-key surfaceCurrent sync-source support covers local folder, repository, and S3-compatible source kinds under the Palace control-plane API. Treat it as an operator workflow, not browser capture.

All route families above are mounted under /api/v1 by the backend. Auth is tenant-scoped unless a route explicitly belongs to an operator-only or capture-token path.

Direct Ingest

Direct ingest is the right path when a client already knows the content type.

The async response gives a job_id with status queued. Use /api/v1/jobs/{job_id} or /api/v1/jobs to inspect progress before claiming the item is searchable.

Webpage extraction can use the built-in local scraper or an operator-configured Firecrawl Cloud/self-hosted provider. That provider choice is deployment configuration, not a different public route.

Media transcription provider choice is also deployment configuration. The public route remains /api/v1/ingest/media; local WhisperX is available for deployments that intentionally select it.

Browser Capture And Saved Web

The browser extension submits to POST /api/v1/capture/browser. The extension sends page URL, page title, optional selection text, user tags, optional detected kind, and extension metadata.

Palace resolves that request as follows:

The extension checks /api/v1/web-saves before save so exact active URL matches can show an already-saved state. Saved-web records can also be filtered by query, capture kind, tag, sort, and active-only state. Archiving a saved-web record is separate from deleting production knowledge.

RSS Feeds And OPML

RSS feeds use /api/v1/feeds.

Feed polling writes item provenance through feed metadata. It is distinct from YouTube channel source subscriptions.

YouTube Channel Source Subscriptions

Source subscriptions use /api/v1/source-subscriptions. The current v1 provider is youtube_channel.

Recommended flow:

  1. Preview the channel with POST /api/v1/source-subscriptions/preview.
  2. Create the subscription with POST /api/v1/source-subscriptions.
  3. Let the worker poll on its configured interval, or request a bounded manual sync with POST /api/v1/source-subscriptions/{subscription_id}/sync.
  4. Inspect discovered, queued, captured, skipped, or failed entries with GET /api/v1/source-subscriptions/entries or GET /api/v1/source-subscriptions/{subscription_id}/entries.
  5. Retry failed entries with POST /api/v1/source-subscriptions/entries/{entry_id}/retry.

V1 supports public YouTube channel uploads. It does not claim support for unbounded historical backfill, Shorts, live streams, upcoming streams, comments, playlists as independent sources, or private/member-only videos. Backfill must be bounded with backfill_limit, backfill_published_after, or both.

Palace Sync Sources

Palace sync sources use /api/v1/palace/sync-sources and /api/v1/palace/sync-runs. They are operator/API-key workflows for curated corpora, not browser capture flows.

Supported source kinds:

Create, edit, soft-delete, restore, and manually sync these sources through the Palace control-plane API. Keep secret material in deployment-managed secrets or encrypted stored credentials. Public docs should describe the shape, not include real repository tokens, object-store keys, or private corpus paths.

Compatibility And Deprecated Surfaces

Auth And Secret Boundaries

Verification Checklist

Before publishing workflow copy, verify:

Source Inventory