How to Bulk-Import Content into the CMS
The internal reference for pushing batches of articles, reports and resources into the platform via the ingest API.
The short version#
The content platform has a dedicated ingestion endpoint — the ingest Cloud Function. You POST JSON (or Markdown with frontmatter) to it, and it validates, dedupes, resolves taxonomy, and writes documents to Firestore as drafts for editorial review.
Endpoint: POST https://ingest-msr5tekcjq-uc.a.run.app
Auth: Authorization: Bearer <INGEST_API_KEY> (stored in Secret Manager; a working copy is in /tmp/packerlabs-ingest-key.txt on the deploy machine)
Contract: docs/CONTENT-CONTRACT.md in the repo
Example#
curl -X POST https://ingest-msr5tekcjq-uc.a.run.app \
-H "Authorization: Bearer $(cat /tmp/packerlabs-ingest-key.txt)" \
-H "Content-Type: application/json" \
-d '{
"strategy": "upsert",
"source": "manual-import",
"items": [
{
"schemaVersion": 1,
"externalId": "my-article-001",
"type": "resource",
"title": "My Article",
"body": "## Markdown body...",
"categories": ["Artificial Intelligence"],
"author": "Jeremy Packer"
}
]
}'
Payload options#
items— batch of up to 100 items, resources and reports mixed. A single contract item object also works.markdown— a Markdown string with YAML frontmatter, for one-off imports.strategy—upsert(default),create,update, orskip-duplicates.autoPublish— defaults tofalse; everything lands as a draft. Settrueto publish immediately.source— a label recorded on the audit record (e.g."notion-export","quarterly-reports").
Behaviors to rely on#
- Idempotent. Give every item a stable
externalId. Re-running an import withupsertupdates existing docs instead of duplicating. - Missing fields get generated.
slugfrom the title,excerptfrom the first paragraph,readingTimeMinutescomputed automatically. - Taxonomy auto-resolves.
categoriesandtagsaccept names or slugs; missing ones are created (noted in the responsewarnings). Authors must already exist in the CMS. - Rate limit is 120 requests/hour. Each item fails independently — check the
resultsarray in the response. - Audit trail. Every run writes an
importsrecord, visible in the CMS under Imports.
Typical workflow#
- Export source content to the contract format (one JSON item per piece).
- POST in batches of 100 or fewer.
- Review the drafts in the CMS at cms.packerlabs.com.
- Publish from the CMS — the site picks it up within 5 minutes via ISR, no rebuild needed.
Related services
Work with us
Building something ambitious?
Packer Labs designs and builds high-performance software for organizations that need senior-level engineering. Let's talk about what you're working on.
Related resources
A Practical Guide to Firebase-Native Content Management
How to run a production content platform on Firebase without adding a database provider or a CMS subscription.