Core Concepts
Understand the key concepts behind PageGun before diving into the API.
Projects
A project is a container for your site. Each project has:
- A unique ID
- A name
- An optional custom domain
- Settings (theme, SEO defaults, analytics)
- Pages (your content)
Most users have one project per site. You can have multiple projects under one account.
Pages
A page is a piece of content in your project. Every page has:
- A type that determines its content format
- A slug that defines its URL path
- A subroute that groups related pages
- A status:
draftorpublished
Page Types
| Type | Content Format | Use Case |
|---|---|---|
page | JSON sections array | Landing pages, marketing pages |
article | Markdown | Blog posts, SEO content |
docs | Markdown + nav tree | Documentation, help centers |
item | Structured data | Directory entries, listings |
Sections
Sections are the building blocks of page type pages. Each section is a JSON object with a type and type-specific props:
{
"config": {
"sections": [
{ "type": "hero", "heading": "Welcome", "ctaText": "Get Started" },
{ "type": "features", "features": [...] },
{ "type": "cta", "heading": "Ready?", "ctaText": "Sign Up" }
]
}
}PageGun includes 14 section types: hero, problem, solution, features, how-it-works, FAQ, CTA, content, testimonials, pricing, directory hero, items grid, and articles grid.
Subroutes
A subroute is the URL path prefix for a group of pages. Common subroutes:
| Subroute | URL Pattern | Typical Use |
|---|---|---|
pages | /pages/about | Static pages |
blog | /blog/my-post | Blog articles |
docs | /docs/quick-start | Documentation |
tools | /tools/my-tool | Directory items |
You can use any string as a subroute. The final URL is: yourdomain.com/{subroute}/{slug}
Publishing
Pages start as drafts and become published when you call the publish endpoint:
Draft → Publish → Live on your domain
↓
Update content → Re-publish → Updated liveKey points:
- Editing a published page does not auto-update — you must re-publish
- Publishing a docs page regenerates navigation for the entire docs tree
- Unpublishing removes the page from your site but keeps the content
Hosting Modes
PageGun offers three ways to host your content:
| Mode | You Manage | PageGun Manages |
|---|---|---|
| Full Host | Content only | Everything else (hosting, SSL, CDN) |
| Rewrite | Your app + routing | Content rendering |
| Data Mode | Everything | Encrypted content storage |
API Keys
API keys authenticate your requests. Each key is scoped to your account and can access all projects.
- Keys start with
pgk_live_(production) orpgk_test_(sandbox) - Include in the
Authorization: Bearerheader - Never expose keys in client-side code